Bug 222671 - Calling eval using spread doesn't emit direct eval
Summary: Calling eval using spread doesn't emit direct eval
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-03 11:29 PST by Saam Barati
Modified: 2021-04-12 23:15 PDT (History)
8 users (show)

See Also:


Attachments
patch (9.37 KB, patch)
2021-03-03 16:13 PST, Saam Barati
sbarati: review-
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2021-03-03 11:29:33 PST
```
eval(...[])
```

invokes global eval instead of direct eval
Comment 1 Saam Barati 2021-03-03 16:13:44 PST
Created attachment 422158 [details]
patch
Comment 2 Geoffrey Garen 2021-03-03 16:21:11 PST
Comment on attachment 422158 [details]
patch

r=me
Comment 3 Yusuke Suzuki 2021-03-03 20:31:47 PST
Talked with Saam offline, I think we should remove usesEval from UnlinkedCodeBlock/CodeBlock since this is ambiguous whether we should use `usesEval` or `usesCallEval`.
Discussed, and we can put `parserSawEval` in UnlinkedCodeBlockGenerator, and remove `usesEval` from UnlinkedCodeBlock/CodeBlock :)
Comment 4 Yusuke Suzuki 2021-03-03 21:44:07 PST
Comment on attachment 422158 [details]
patch

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

> Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h:345
> +    unsigned m_usesCallEval : 1;

And I think we need to store this new information to Cached UnlinkedCodeBlock.
Comment 5 Saam Barati 2021-03-04 12:06:37 PST
Oops, this is in the wrong bug
Comment 6 Radar WebKit Bug Importer 2021-03-10 11:30:17 PST
<rdar://problem/75274432>
Comment 7 Yusuke Suzuki 2021-04-12 23:14:05 PDT

*** This bug has been marked as a duplicate of bug 222694 ***
Comment 8 Yusuke Suzuki 2021-04-12 23:15:16 PDT
Ah, no. This is different bug from the duped one.