| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 93ed114 commit 275d257
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + // Ref: https://github.com/nodejs/node/issues/5350 | ||
| 3 | + | ||
| 4 | + require('../common'); | ||
| 5 | + const vm = require('vm'); | ||
| 6 | + const assert = require('assert'); | ||
| 7 | + | ||
| 8 | + const base = { | ||
| 9 | + propBase: 1 | ||
| 10 | + }; | ||
| 11 | + | ||
| 12 | + const sandbox = Object.create(base, { | ||
| 13 | + propSandbox: {value: 3} | ||
| 14 | + }); | ||
| 15 | + | ||
| 16 | + const context = vm.createContext(sandbox); | ||
| 17 | + | ||
| 18 | + const result = vm.runInContext('this.hasOwnProperty("propBase");', context); | ||
| 19 | + | ||
| 20 | + assert.strictEqual(result, false); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments