Bug 247497
| Summary: | Access of import in LHS throws unexpected `SyntaxError` | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kanguk Lee <p51lee> |
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | mark.lam, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 12 | ||
Kanguk Lee
// input.js ( file.js exists in current directory)
import ( "file" + ".js" ) [ 0 ] = 0 ;
// Note: this is fine
// import ( "file.js" ) [ 0 ] = 0 ;
_____________________
Hello,
Executing the input.js using JSC throws SyntaxError, but it is expected to be terminated normally.
This bug looks similar to the bug I found yesterday: https://bugs.webkit.org/show_bug.cgi?id=247435.
However, I personally think this may not be a duplicate of Bug 247435, so please let me know if this bug is duplicated or not.
Running the input.js with JSC results in:
---
$ jsc input.js
Exception: SyntaxError: Left hand side of operator '=' must be a reference.
at input.js:1
---
while other engines behave like:
---
# V8
$ node input.js
// no error
# GraalJS
$ js input.js
// no error
---
WebKit version: 615.1.10
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/102064736>
Yusuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/6240
EWS
Committed 256470@main (90b95a3284a6): <https://commits.webkit.org/256470@main>
Reviewed commits have been landed. Closing PR #6240 and removing active labels.