Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: failing behaviour on sandboxed Proxy #11671

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/known_issues/test-vm-proxy-failure-CP.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

//Sandbox throws in CopyProperties() despite no code being run

require('../common');
const assert = require('assert');
const vm = require('vm');

const handler = {
getOwnPropertyDescriptor: (target, prop) => {
throw new Error('whoops');
}
};
const sandbox = new Proxy({foo: 'bar'}, handler);
const context = vm.createContext(sandbox);


assert.doesNotThrow(() => vm.runInContext('', context));
13 changes: 0 additions & 13 deletions test/parallel/test-vm-proxies.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,3 @@ sandbox = { Proxy: Proxy };
vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert.strictEqual(typeof sandbox.Proxy, 'function');
assert.strictEqual(sandbox.Proxy, Proxy);

// Handle a sandbox that throws while copying properties
assert.throws(() => {
const handler = {
getOwnPropertyDescriptor: (target, prop) => {
throw new Error('whoops');
}
};
const sandbox = new Proxy({foo: 'bar'}, handler);
const context = vm.createContext(sandbox);

vm.runInContext('', context);
}, /whoops/);