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