You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
397 B

'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);