mirror of https://github.com/tc39/test262.git
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).
This commit is contained in:
parent
ef5594b675
commit
a2e1fc713e
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue