Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Adds failing test for subscripting operator #235

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
Adds failing test
When both operands to the subscription operator are yield expressions, it does not compile correctly.  The latter expression (the index) is erroneously used for both operands.
cspotcode committed Feb 24, 2016
commit e64b5174ed80b10bcbb9ecb218e495e5073a68bb
6 changes: 6 additions & 0 deletions test/tests.es6.js
Original file line number Diff line number Diff line change
@@ -92,6 +92,12 @@ describe("simple argument yielder", function() {
itr.next();
itr.next(1);
assert.equal(itr.next(2).value, 3);

function *gen2() { return (yield null)[yield null]; }
var itr2 = gen2();
itr2.next();
itr2.next({propName: 1234});
assert.equal(itr2.next('propName').value, 1234);
});
});