WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 189799
257677
Implementation error in ForStatement with LexicalDeclaration
https://bugs.webkit.org/show_bug.cgi?id=257677
Summary
Implementation error in ForStatement with LexicalDeclaration
webkit
Reported
2023-06-03 04:19:17 PDT
The POC let cb; for (let i = (cb = (() => i), 0); i<10;) { i++; } console.log(cb()); In chrome(V8) and engine262 we got output "0", but WebKit(JSC) we got "1", which is unexpected and completely wrong. The spec(
https://tc39.es/ecma262/#sec-forbodyevaluation
) require to call CreatePerIterationEnvironment in every loop iteration, so the i++ in the loop body cannot effect the variable captured from the LexicalDeclaration, it seems jsc reuse the env in the first iteration.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-06-04 17:40:59 PDT
<
rdar://problem/110238901
>
Alexey Shvayka
Comment 2
2023-10-11 16:53:22 PDT
Hello, thanks for the report & test case! As confirmed by naive fix, it is the same issue as
https://bugs.webkit.org/show_bug.cgi?id=189799
. *** This bug has been marked as a duplicate of
bug 189799
***
Alexey Shvayka
Comment 3
2023-10-11 16:56:05 PDT
(In reply to Alexey Shvayka from
comment #2
)
> Hello, thanks for the report & test case! > > As confirmed by naive fix, it is the same issue as >
https://bugs.webkit.org/show_bug.cgi?id=189799
. > > *** This bug has been marked as a duplicate of
bug 189799
***
We can't ship the naive fix as it bloats the bytecode size, but we are working on a better solution!
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