From a2e1fc713eb7cba7ad9974a8b22f09d414986b20 Mon Sep 17 00:00:00 2001 From: Mike Pennisi <mike@mikepennisi.com> Date: Mon, 25 May 2015 15:16:11 -0400 Subject: [PATCH] Correct test As written, the test behavior and description do not match--the `throw` invocation takes place while generator execution is paused *within* the `finally` block (not following it). Ensure that the test exercises the described behavior (and remove extraneous invocation of method under test). --- .../throw/try-finally-following-finally.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js b/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js index 7db1bbca3a..0c7c061019 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js +++ b/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js @@ -16,6 +16,7 @@ function* g() { yield 3; } yield 4; + $ERROR('This code is unreachable'); } var iter = g(); var result; @@ -28,10 +29,14 @@ result = iter.next(); assert.sameValue(result.value, 2, 'Second result `value`'); assert.sameValue(result.done, false, 'Second result `done` flag'); -result = iter.throw(new Error()); +result = iter.next(); assert.sameValue(result.value, 3, 'Third result `value`'); assert.sameValue(result.done, false, 'Third result `done` flag'); +result = iter.next(); +assert.sameValue(result.value, 4, 'Third result `value`'); +assert.sameValue(result.done, false, 'Third result `done` flag'); + assert.throws(Test262Error, function() { iter.throw(new Test262Error()); }); result = iter.next(); -- GitLab