| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 70ba041 commit 3c4d316
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,3 +32,14 @@ assert.strictEqual(vm.runInContext('x;', ctx), 3); | |||
| 32 | 32 | vm.runInContext('y = 4;', ctx); | |
| 33 | 33 | assert.strictEqual(sandbox.y, 4); | |
| 34 | 34 | assert.strictEqual(ctx.y, 4); | |
| 35 | + | ||
| 36 | + // Test `IndexedPropertyGetterCallback` and `IndexedPropertyDeleterCallback` | ||
| 37 | + const x = { get 1() { return 5; } }; | ||
| 38 | + const pd_expected = Object.getOwnPropertyDescriptor(x, 1); | ||
| 39 | + const ctx2 = vm.createContext(x); | ||
| 40 | + const pd_actual = Object.getOwnPropertyDescriptor(ctx2, 1); | ||
| 41 | + | ||
| 42 | + assert.deepStrictEqual(pd_actual, pd_expected); | ||
| 43 | + assert.strictEqual(ctx2[1], 5); | ||
| 44 | + delete ctx2[1]; | ||
| 45 | + assert.strictEqual(ctx2[1], undefined); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments