This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
true copy of sandbox properties catch sealed errors, pass global's prototype to CloneObject Fixes #1673
- Loading branch information
Showing
3 changed files
with
74 additions
and
22 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
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
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,26 @@ | ||
var common = require('../common'); | ||
var assert = require('assert'); | ||
var vm = require('vm'); | ||
|
||
var ctx = {}; | ||
|
||
Object.defineProperty(ctx, 'getter', { | ||
get: function() { | ||
return 'ok'; | ||
} | ||
}); | ||
|
||
var val; | ||
Object.defineProperty(ctx, 'setter', { | ||
set: function(_val) { | ||
val = _val; | ||
}, | ||
get: function() { | ||
return 'ok=' + val; | ||
} | ||
}); | ||
|
||
ctx = vm.createContext(ctx); | ||
|
||
var result = vm.runInContext('setter = "test";[getter,setter]', ctx); | ||
assert.deepEqual(result, ['ok', 'ok=test']); |