Bug 156576

Summary: [ES7] yield star should not return if the inner iterator.throw returns { done: true }
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, darin, fpizlo, ggaren, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Yusuke Suzuki
Reported 2016-04-14 05:50:56 PDT
[ES6] yield star should not return if the inner iterator.throw returns { done: true }
Attachments
Patch (16.80 KB, patch)
2016-04-14 05:54 PDT, Yusuke Suzuki
no flags
Patch (16.72 KB, patch)
2016-04-14 06:37 PDT, Yusuke Suzuki
no flags
Patch (16.56 KB, patch)
2016-04-14 06:40 PDT, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2016-04-14 05:54:58 PDT
Yusuke Suzuki
Comment 2 2016-04-14 05:55:44 PDT
This change is also listed here. http://kangax.github.io/compat-table/esnext/
Yusuke Suzuki
Comment 3 2016-04-14 06:37:06 PDT
Yusuke Suzuki
Comment 4 2016-04-14 06:40:15 PDT
Yusuke Suzuki
Comment 5 2016-04-14 06:42:54 PDT
Comment on attachment 276396 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=276396&action=review > Source/JavaScriptCore/builtins/GeneratorPrototype.js:83 > + return @generatorResume(this, exception, @GeneratorResumeModeThrow); Use bytecode intrinsic constants. We can keep in sync with JSGenerator::constants. > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4442 > + emitThrowTypeError(ASCIILiteral("Iterator result interface is not an object.")); When innerIterator.throw() does not throw, we fall into the usual iteration path (branchOnResult). > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4491 > + emitLabel(branchOnResult.get()); The iterator loop's condition phase.
Yusuke Suzuki
Comment 6 2016-04-17 15:39:34 PDT
Note that this is not staging change. It is already introduced into the spec draft (ECMAScript 2016 spec).
Darin Adler
Comment 7 2016-04-17 16:18:14 PDT
Comment on attachment 276396 [details] Patch Looks OK to me, but it’s slightly outside my expertise which is why I am not marking it review+
Saam Barati
Comment 8 2016-04-17 20:24:05 PDT
Comment on attachment 276396 [details] Patch r=me
Yusuke Suzuki
Comment 9 2016-04-17 23:51:57 PDT
Comment on attachment 276396 [details] Patch Thanks!
WebKit Commit Bot
Comment 10 2016-04-18 00:35:35 PDT
Comment on attachment 276396 [details] Patch Clearing flags on attachment: 276396 Committed r199652: <http://trac.webkit.org/changeset/199652>
WebKit Commit Bot
Comment 11 2016-04-18 00:35:41 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.