Bug 225535

Summary: [JSC] Error#cause must recognize explicit undefined
Product: WebKit Reporter: Ross Kirsling <ross.kirsling>
Component: JavaScriptCoreAssignee: Ross Kirsling <ross.kirsling>
Status: RESOLVED FIXED    
Severity: Normal CC: ashvayka, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tsavell, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=223302
Attachments:
Description Flags
Patch
none
Patch for landing none

Comment 1 Ross Kirsling 2021-05-07 16:26:29 PDT
Created attachment 428057 [details]
Patch
Comment 2 Alexey Shvayka 2021-05-07 16:47:00 PDT
Comment on attachment 428057 [details]
Patch

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

Nice clean-up! r=me with a thought on (micro) optimization.

> Source/JavaScriptCore/runtime/ErrorInstance.cpp:145
> +            JSValue cause = object->get(globalObject, vm.propertyNames->cause);

We could use slot.isTaintedByOpaqueObject() to avoid this get() if it's non-observable, like we do in objectConstructorValues() and friends.
Comment 3 Ross Kirsling 2021-05-07 17:03:27 PDT
(In reply to Alexey Shvayka from comment #2)
> Comment on attachment 428057 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=428057&action=review
> 
> Nice clean-up! r=me with a thought on (micro) optimization.
> 
> > Source/JavaScriptCore/runtime/ErrorInstance.cpp:145
> > +            JSValue cause = object->get(globalObject, vm.propertyNames->cause);
> 
> We could use slot.isTaintedByOpaqueObject() to avoid this get() if it's
> non-observable, like we do in objectConstructorValues() and friends.

Thanks, will do!
Comment 4 Ross Kirsling 2021-05-07 17:10:38 PDT
Created attachment 428063 [details]
Patch for landing
Comment 5 EWS 2021-05-07 18:26:39 PDT
Committed r277221 (237492@main): <https://commits.webkit.org/237492@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428063 [details].
Comment 6 Radar WebKit Bug Importer 2021-05-07 18:27:16 PDT
<rdar://problem/77682622>
Comment 7 Truitt Savell 2021-05-14 12:22:31 PDT
It looks like the changes in https://trac.webkit.org/changeset/277221/webkit

broke two tests on test262 queue
https://build.webkit.org/#/builders/19/builds/2485