Optional call of eval (e.g. `eval?.(code)`) should be indirect eval
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | verified |
People
(Reporter: public, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Steps to reproduce:
var a = "global";
(a => eval?.("console.log(a)"))("local");
Actual results:
Printed local
in console.
Expected results:
Prints global
in console.
The direct eval is only step 6.a.vi
in 12.3.6.1 Runtime Semantics: Evaluation.
But optional chaining is 12.3.9.2 Runtime Semantics: ChainEvaluation.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Assignee | ||
Comment 2•4 years ago
|
||
Test case will be added through the next test262 sync:
Updated•4 years ago
|
Comment 4•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 5•4 years ago
•
|
||
Reproduced the issue using Firefox 79.0a1 (20200621093846) on Ubuntu 18.04.
The issue is verified with Firefox 79.0b9 (20200717001501) on Windows 10x64, macOS 10.12 and Ubuntu 18.04. global
string is presented in the console after using:
var a = "global";
(a => eval?.("console.log(a)"))("local");
Description
•