WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
212886
Redeclaration of a function* inside a block definition
https://bugs.webkit.org/show_bug.cgi?id=212886
Summary
Redeclaration of a function* inside a block definition
Jefferson Junior
Reported
2020-06-07 14:58:50 PDT
Hi everyone, I found a case of redeclaration of a generator function inside a block definition. version: 262693 OS: Linux Ubuntu 19.10 x64 steps to reproduce: { function* f() { yield 1 } function f() { print(2) } } f() Actual results: 2 Expected results: SyntaxError: Identifier 'f' has already been declared V8, SpiderMonkey works as expected. cinfuzz
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-06-09 17:39:53 PDT
<
rdar://problem/64188468
>
Rick Waldron
Comment 2
2020-09-08 09:25:05 PDT
This bug affects every combination with a lexical declaration in a block, in non-strict mode code (strict mode code is correct). { async function f() {} async function f() {} } { async function f() {} async function* f() {} } { async function* f() {} async function f() {} } { async function* f() {} async function* f() {} } { async function f() {} class f {} } { async function* f() {} class f {} } { async function f() {} const f = 0 } { async function* f() {} const f = 0 } { async function f() {} function f() {} } { async function* f() {} function f() {} } { async function f() {} function* f() {} } { async function* f() {} function* f() {} } { async function f() {} let f } { async function* f() {} let f } { async function f() {} var f } { async function* f() {} var f } { class f {} async function f() {} } { class f {} async function* f() {} } { class f {} function f() {} } { class f {} function* f() {} } { const f = 0; async function f() {} } { const f = 0; async function* f() {} } { const f = 0; function f() {} } { const f = 0; function* f() {} } { function f() {} async function f() {} } { function f() {} async function* f() {} } { function f() {} class f {} } { function f() {} const f = 0 } { function f() {} function* f() {} } { function f() {} let f } { function f() {} var f } { function* f() {} async function f() {} } { function* f() {} async function* f() {} } { function* f() {} class f {} } { function* f() {} const f = 0 } { function* f() {} function f() {} } { function* f() {} function* f() {} } { function* f() {} let f } { function* f() {} var f } { async function f() {}; { var f; } } { async function* f() {}; { var f; } } { function f() {} { var f; } } { function* f() {}; { var f; } } { let f; async function f() {} } { let f; async function* f() {} } { let f; function f() {} } { let f; function* f() {} } { var f; async function f() {} } { var f; async function* f() {} } { var f; function f() {} } { var f; function* f() {} } { async function f() {}; var f; } { async function* f() {}; var f; } { function f() {}; var f; } { function* f() {}; var f; } These fail in both strict mode code and non-strict mode code: { { var f; } async function f() {}; } { { var f; } async function* f() {}; } { { var f; } function f() {} } { { var f; } function* f() {}; } { var f; async function f() {} } { var f; async function* f() {} } { var f; function f() {} } { var f; function* f() {} } In all cases show here, a SyntaxError exception should be thrown at parse time.
Rick Waldron
Comment 3
2020-09-08 09:26:16 PDT
Fixing this issue would bring JSC into 100% interop with V8 and SpiderMonkey
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug