2017-03-02 16:03:54 +00:00
|
|
|
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const vm = require('vm');
|
|
|
|
|
2017-10-17 17:27:27 +02:00
|
|
|
// Check that we do not accidentally query attributes.
|
|
|
|
// Issue: https://github.com/nodejs/node/issues/11902
|
2017-03-02 16:03:54 +00:00
|
|
|
const handler = {
|
2017-07-25 10:37:08 -07:00
|
|
|
getOwnPropertyDescriptor: (target, prop) => {
|
|
|
|
throw new Error('whoops');
|
|
|
|
}
|
2017-03-02 16:03:54 +00:00
|
|
|
};
|
2017-07-10 20:55:21 -04:00
|
|
|
const sandbox = new Proxy({ foo: 'bar' }, handler);
|
2017-03-02 16:03:54 +00:00
|
|
|
const context = vm.createContext(sandbox);
|
|
|
|
|
2018-02-09 02:32:04 +01:00
|
|
|
vm.runInContext('', context);
|