Bug 220492 - TypedArray's [[DefineOwnProperty]] should throw in case of failure
Summary: TypedArray's [[DefineOwnProperty]] should throw in case of failure
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Trivial
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-08 18:10 PST by Alexey Shvayka
Modified: 2021-03-02 12:51 PST (History)
9 users (show)

See Also:


Attachments
Patch (8.96 KB, patch)
2021-01-08 18:12 PST, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (11.52 KB, patch)
2021-03-02 10:02 PST, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (11.62 KB, patch)
2021-03-02 10:45 PST, Alexey Shvayka
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].