1// Flags: --disable-proto=delete 2 3'use strict'; 4 5require('../common'); 6const assert = require('assert'); 7const vm = require('vm'); 8const { Worker, isMainThread } = require('worker_threads'); 9 10// eslint-disable-next-line no-proto 11assert.strictEqual(Object.prototype.__proto__, undefined); 12assert(!Object.prototype.hasOwnProperty('__proto__')); 13 14const ctx = vm.createContext(); 15const ctxGlobal = vm.runInContext('this', ctx); 16 17// eslint-disable-next-line no-proto 18assert.strictEqual(ctxGlobal.Object.prototype.__proto__, undefined); 19assert(!ctxGlobal.Object.prototype.hasOwnProperty('__proto__')); 20 21if (isMainThread) { 22 new Worker(__filename); 23} else { 24 process.exit(); 25} 26