Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1237)

Unified Diff: test/mjsunit/harmony/iterator-close.js

Issue 1728973002: Fix priority of exceptions being thrown from for-of loops (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase, with test262 expectations updated Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/iterator-close.js
diff --git a/test/mjsunit/harmony/iterator-close.js b/test/mjsunit/harmony/iterator-close.js
index 94785de51f48f516a658f4de91c2f05b50e35da0..3cc4412e8a967c3c18015af989ecb5ef14bd2e18 100644
--- a/test/mjsunit/harmony/iterator-close.js
+++ b/test/mjsunit/harmony/iterator-close.js
@@ -87,13 +87,15 @@ function* g() { yield 42; return 88 };
for (x of g()) { break; }
}, TypeError);
- assertThrows(() => {
+ // Throw from the body of a for loop 'wins' vs throw
+ // originating from a bad 'return' value.
+ assertThrowsEquals(() => {
for (let x of g()) { throw 666; }
- }, TypeError);
+ }, 666);
- assertThrows(() => {
+ assertThrowsEquals(() => {
for (x of g()) { throw 666; }
- }, TypeError);
+ }, 666);
assertThrows(() => {
for (let x of g()) { return 666; }
« no previous file with comments | « src/parsing/parser.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698