Bug 220492

Summary: TypedArray's [[DefineOwnProperty]] should throw in case of failure
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Trivial CC: darin, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch ews-feeder: commit-queue-

Description Alexey Shvayka 2021-01-08 18:10:21 PST
TypedArray's [[DefineOwnProperty]] should throw in case of failure
Comment 1 Alexey Shvayka 2021-01-08 18:12:47 PST
Created attachment 417324 [details]
Patch
Comment 2 Darin Adler 2021-01-08 18:35:26 PST
Comment on attachment 417324 [details]
Patch

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

> Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h:409
> +            typename Adaptor::Type value = toNativeFromValue<Adaptor>(globalObject, descriptor.value());

Do we really need Adaptor::Type here. Would auto work?
Comment 3 Radar WebKit Bug Importer 2021-01-15 18:11:13 PST
<rdar://problem/73271007>
Comment 4 Alexey Shvayka 2021-03-02 10:02:47 PST
Created attachment 421957 [details]
Patch

Adjust tests and don't throw if the buffer was detached during the coercion.
Comment 5 Alexey Shvayka 2021-03-02 10:05:37 PST
(In reply to Darin Adler from comment #2)

Thank you for review!

> Do we really need Adaptor::Type here. Would auto work?

I've reverted this bit as it was spec-incorrect: in a very unlike case of [[Value]] coercion detaching the buffer, we should silently ignore it.
Comment 6 Alexey Shvayka 2021-03-02 10:45:48 PST
Created attachment 421963 [details]
Patch

Fix unchecked exception.
Comment 7 EWS 2021-03-02 12:00:36 PST
Committed r273750: <https://commits.webkit.org/r273750>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421963 [details].