Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update make it explicit that we are accessing an indexed property
  • Loading branch information
conectado committed Oct 7, 2018
commit 7171a49a10b1abb9cd3781356623ba8178aa2eb0
12 changes: 6 additions & 6 deletions test/parallel/test-vm-context-property-forwarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ vm.runInContext('y = 4;', ctx);
assert.strictEqual(sandbox.y, 4);
assert.strictEqual(ctx.y, 4);

const x = { get a() { return 5; } };
const pd_expected = Object.getOwnPropertyDescriptor(x, 'a');
const x = { get 1() { return 5; } };
const pd_expected = Object.getOwnPropertyDescriptor(x, 1);
const ctx2 = vm.createContext(x);
const pd_actual = Object.getOwnPropertyDescriptor(ctx2, 'a');
const pd_actual = Object.getOwnPropertyDescriptor(ctx2, 1);

assert.deepStrictEqual(pd_actual, pd_expected);
assert.strictEqual(ctx2.a, 5);
delete ctx2.a;
assert.strictEqual(ctx2.a, undefined);
assert.strictEqual(ctx2[1], 5);
delete ctx2[1];
assert.strictEqual(ctx2[1], undefined);