forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1481248: Use strict instead of sloppy equals for 'throw' method c…
…heck in yield*. r=arai --HG-- extra : rebase_source : 2f870217171182dad620aa2a873cd682e28f95e3
- Loading branch information
Showing
2 changed files
with
62 additions
and
27 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
28 changes: 28 additions & 0 deletions
28
js/src/tests/non262/generators/yield-star-throw-htmldda.js
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,28 @@ | ||
function* g(iter) { | ||
yield* iter; | ||
} | ||
|
||
var calledReturn = false; | ||
|
||
var it = g({ | ||
[Symbol.iterator]() { | ||
return this; | ||
}, | ||
next() { | ||
return {done: false}; | ||
}, | ||
throw: createIsHTMLDDA(), | ||
return() { | ||
calledReturn = true; | ||
return {done: false}; | ||
} | ||
}); | ||
|
||
it.next(); | ||
|
||
assertThrowsInstanceOf(() => it.throw(""), TypeError); | ||
|
||
assertEq(calledReturn, false); | ||
|
||
if (typeof reportCompare === "function") | ||
reportCompare(0, 0); |