Bug 64875

Summary: Use of `yield` keyword is broken
Product: WebKit Reporter: lekensteyn
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: barraclough
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Testcases which should all be OK, not FAIL
none
The patch sam: review+

Description lekensteyn 2011-07-20 08:46:53 PDT
Created attachment 101475 [details]
Testcases which should all be OK, not FAIL

The use of `yield` as variable name is impossible, even when not in strict mode. This was confirmed in build 91186 (r91186.tar.bz2">http://builds.nightly.webkit.org/files/trunk/src/WebKit-r91186.tar.bz2)

Although the keyword cannot be used, it does neither work. The example from https://developer.mozilla.org/en/New_in_JavaScript_1.7#Generators gives a parse error:

    SyntaxError: Expected an identifier but found 'i' instead

The attached testcase provides some example code that demonstrates that yield cannot be used in some cases.
Comment 1 Gavin Barraclough 2011-07-20 11:04:45 PDT
Thanks for the bug report - yep, that's a nasty bug, will get on it asap.
Comment 2 Gavin Barraclough 2011-07-21 18:16:41 PDT
Created attachment 101682 [details]
The patch
Comment 3 Gavin Barraclough 2011-07-21 22:30:21 PDT
Fixed in r91553