0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-25 16:34:05 +01:00
nodejs/test/known_issues/test-vm-data-property-writable.js
AnnaMag e8bb9e68c0 test: add known_issues test for #10223
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>
2017-01-30 10:22:30 +01:00

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