WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
147600
JSC allows invalid var declarations when the declared name is the same as a let/const variable
https://bugs.webkit.org/show_bug.cgi?id=147600
Summary
JSC allows invalid var declarations when the declared name is the same as a l...
Saam Barati
Reported
2015-08-03 16:47:17 PDT
Unfortunately, this is dependent on which variable was declared first. This should be a syntax error but isn't: "let NAME; var NAME;"
Attachments
patch
(33.81 KB, patch)
2015-09-23 15:02 PDT
,
Saam Barati
ysuzuki
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Saam Barati
Comment 1
2015-09-23 15:02:58 PDT
Created
attachment 261842
[details]
patch
Yusuke Suzuki
Comment 2
2015-09-23 15:12:24 PDT
Comment on
attachment 261842
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261842&action=review
r=me
> LayoutTests/js/script-tests/let-syntax.js:70 > +shouldNotHaveSyntaxError("function foo() { { let x; } var x; }");
Nice!
> LayoutTests/js/script-tests/let-syntax.js:105 > +shouldHaveSyntaxError("let x; var [x] = 20;");
I suggest adding `var x; let x;` cases because this issue depended on the occurrence order.
Saam Barati
Comment 3
2015-09-23 15:38:39 PDT
landed in:
http://trac.webkit.org/changeset/190188
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