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; } |