Bug 150769

Summary: [ES6] Support Generator Syntax
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, buildbot, commit-queue, fpizlo, ggaren, keith_miller, mark.lam, msaboff, rniwa, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 150793    
Bug Blocks: 150290    
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews101 for mac-mavericks
none
Archive of layout-test-results from ews104 for mac-mavericks-wk2
none
Archive of layout-test-results from ews117 for mac-yosemite
none
Patch ggaren: review+

Description Yusuke Suzuki 2015-11-01 00:24:18 PDT
Support Generator Syntax, this is the first step toward implementing Generators.
Comment 1 Yusuke Suzuki 2015-11-01 01:46:49 PST
Created attachment 264508 [details]
Patch

WIP
Comment 2 Yusuke Suzuki 2015-11-01 08:10:24 PST
Created attachment 264517 [details]
Patch
Comment 3 WebKit Commit Bot 2015-11-01 08:11:32 PST
Attachment 264517 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:81:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/JavaScriptCore/parser/Keywords.table:41:  Line contains tab character.  [whitespace/tab] [5]
ERROR: Source/JavaScriptCore/parser/Parser.cpp:207:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/parser/Parser.cpp:2505:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 4 in 42 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Build Bot 2015-11-01 09:13:23 PST
Comment on attachment 264517 [details]
Patch

Attachment 264517 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/367906

New failing tests:
js/dom/reserved-words-as-property.html
Comment 5 Build Bot 2015-11-01 09:13:26 PST
Created attachment 264518 [details]
Archive of layout-test-results from ews101 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 6 Build Bot 2015-11-01 09:17:42 PST
Comment on attachment 264517 [details]
Patch

Attachment 264517 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/367910

New failing tests:
js/dom/reserved-words-as-property.html
Comment 7 Build Bot 2015-11-01 09:17:45 PST
Created attachment 264519 [details]
Archive of layout-test-results from ews104 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 8 Build Bot 2015-11-01 09:22:10 PST
Comment on attachment 264517 [details]
Patch

Attachment 264517 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/367900

New failing tests:
js/dom/reserved-words-as-property.html
Comment 9 Build Bot 2015-11-01 09:22:13 PST
Created attachment 264520 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 10 Geoffrey Garen 2015-11-01 12:49:23 PST
Comment on attachment 264517 [details]
Patch

EWS is red.
Comment 11 Yusuke Suzuki 2015-11-01 17:40:21 PST
Created attachment 264547 [details]
Patch

Oops. Updated the patch
Comment 12 WebKit Commit Bot 2015-11-01 17:43:30 PST
Attachment 264547 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:81:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/JavaScriptCore/parser/Keywords.table:41:  Line contains tab character.  [whitespace/tab] [5]
ERROR: Source/JavaScriptCore/parser/Parser.cpp:207:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/parser/Parser.cpp:2505:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 4 in 43 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Geoffrey Garen 2015-11-01 18:04:57 PST
Comment on attachment 264547 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=264547&action=review

r=me

> Source/JavaScriptCore/parser/Parser.cpp:478
> +            // Intentionally use `match(IDENT) || match(YIELD) || match(LET)` and not use `matchSpecIdentifier()`.

not use => don't use

> Source/JavaScriptCore/parser/Parser.cpp:479
> +            // Because, we would like to fall into parseVariableDeclaration path even if "yield" is not treated as an Identifier.

Because, we => We

> Source/JavaScriptCore/parser/Parser.cpp:483
> +            if (!(match(IDENT) || match(YIELD) || match(LET)) && !match(OPENBRACE) && !match(OPENBRACKET))

Should we test let before yield since it will be more common?

> Source/JavaScriptCore/parser/Parser.cpp:1751
> -        
> +
>          matchOrFail(OPENBRACE, "Expected an opening '{' at the start of a ", stringForFunctionMode(mode), " body");
> -        
> +
>          // BytecodeGenerator emits code to throw TypeError when a class constructor is "call"ed.
>          // Set ConstructorKind to None for non-constructor methods of classes.
> -    
> +

Revert whitespace changes please.
Comment 14 Yusuke Suzuki 2015-11-01 21:25:37 PST
Comment on attachment 264547 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=264547&action=review

Thanks for your review :) After ensuring the patch passes EWS, I'll land it with pointed fixes.

>> Source/JavaScriptCore/parser/Parser.cpp:478
>> +            // Intentionally use `match(IDENT) || match(YIELD) || match(LET)` and not use `matchSpecIdentifier()`.
> 
> not use => don't use

Fixed.

>> Source/JavaScriptCore/parser/Parser.cpp:479
>> +            // Because, we would like to fall into parseVariableDeclaration path even if "yield" is not treated as an Identifier.
> 
> Because, we => We

Changed.

>> Source/JavaScriptCore/parser/Parser.cpp:483
>> +            if (!(match(IDENT) || match(YIELD) || match(LET)) && !match(OPENBRACE) && !match(OPENBRACKET))
> 
> Should we test let before yield since it will be more common?

Nice! I've exchanged :)

>> Source/JavaScriptCore/parser/Parser.cpp:1751
>> +
> 
> Revert whitespace changes please.

OK, reverted.
Comment 15 Yusuke Suzuki 2015-11-01 21:47:12 PST
Committed r191875: <http://trac.webkit.org/changeset/191875>