-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: failing behaviour on sandboxed Proxy
CopyProperties() causes sandboxed Proxy to throw error when in fact no code has been run. The function will be removed with the updates to the V8 API. Here, failing Proxy test case is moved to known_issues.
- Loading branch information
Showing
2 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters