forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes nodejs#1673
- Loading branch information
Showing
2 changed files
with
63 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
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']); |