Bug 222671

Summary: Calling eval using spread doesn't emit direct eval
Product: WebKit Reporter: Saam Barati <saam>
Component: JavaScriptCoreAssignee: Saam Barati <saam>
Status: REOPENED ---    
Severity: Normal CC: ews-watchlist, ggaren, john.david.dalton, keith_miller, mark.lam, msaboff, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch saam: review-, ews-feeder: commit-queue-

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.