Bug 247431
| Summary: | Ignored TypeError upon optional function call chain | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kanguk Lee <p51lee> |
| Component: | JavaScriptCore | Assignee: | Ross Kirsling <ross.kirsling> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | mark.lam, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Kanguk Lee
// input.js
var x = function ( ) { } ?. ( ) . x ;
__________________________________________
Hello,
Executing the input.js using JSC, it is terminated normally.
However, it is expected to throw TypeError since `function ( ) { } ?. ( )` is `undefined`.
Running the input.js with JSC results in:
---
$ jsc input.js
// no error
---
while other engines behave like:
---
# V8
$ node input.js
input.js:1: TypeError: Cannot read properties of undefined (reading 'x')
var x = function ( ) { } ?. ( ) . x ;
^
TypeError: Cannot read properties of undefined (reading 'x')
at input.js:1:33
# GraalJS
$ js input.js
TypeError: Cannot read property 'x' of undefined
at <js> :program(input.js:1:8-34)
---
WebKit version: 615.1.10
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/101940388>
Ross Kirsling
*** Bug 247434 has been marked as a duplicate of this bug. ***
Ross Kirsling
Pull request: https://github.com/WebKit/WebKit/pull/6799
EWS
Committed 257004@main (23879e6bd1a0): <https://commits.webkit.org/257004@main>
Reviewed commits have been landed. Closing PR #6799 and removing active labels.