mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 16:34:05 +01:00
e8bb9e68c0
PR-URL: https://github.com/nodejs/node/pull/11024 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
18 lines
397 B
JavaScript
18 lines
397 B
JavaScript
'use strict';
|
|
// Refs: https://github.com/nodejs/node/issues/10223
|
|
|
|
require('../common');
|
|
const vm = require('vm');
|
|
const assert = require('assert');
|
|
|
|
const context = vm.createContext({});
|
|
|
|
const code = `
|
|
Object.defineProperty(this, 'foo', {value: 5});
|
|
Object.getOwnPropertyDescriptor(this, 'foo');
|
|
`;
|
|
|
|
const desc = vm.runInContext(code, context);
|
|
|
|
assert.strictEqual(desc.writable, false);
|