Bug 173181 - TypedArray constructor with string shouldn't throw
Summary: TypedArray constructor with string shouldn't throw
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-09 14:23 PDT by JF Bastien
Modified: 2017-06-11 19:40 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.35 KB, patch)
2017-06-11 16:37 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-elcapitan (1016.83 KB, application/zip)
2017-06-11 17:35 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.13 MB, application/zip)
2017-06-11 17:41 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews115 for mac-elcapitan (1.77 MB, application/zip)
2017-06-11 17:55 PDT, Build Bot
no flags Details
Patch for landing (21.17 KB, patch)
2017-06-11 19:00 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch for landing (22.11 KB, patch)
2017-06-11 19:02 PDT, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description JF Bastien 2017-06-09 14:23:22 PDT
Uint8Array("hi!") throws, it should instead do this:
https://tc39.github.io/ecma262/#sec-typedarray-length

IIUC it just coerces "hi!" to 0 and goes on its merry way. That's what Chrome does, whereas SM says `typein:1:2 TypeError: invalid arguments`.
Comment 1 Keith Miller 2017-06-11 16:37:38 PDT
Created attachment 312629 [details]
Patch
Comment 2 Build Bot 2017-06-11 17:35:25 PDT
Comment on attachment 312629 [details]
Patch

Attachment 312629 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3914441

New failing tests:
fast/canvas/webgl/array-unit-tests.html
webgl/1.0.2/conformance/typedarrays/array-unit-tests.html
fast/canvas/webgl/webgl-array-invalid-ranges.html
Comment 3 Build Bot 2017-06-11 17:35:26 PDT
Created attachment 312630 [details]
Archive of layout-test-results from ews101 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 4 JF Bastien 2017-06-11 17:39:21 PDT
Comment on attachment 312629 [details]
Patch

Can you also add a test with an object that has toValue, both returning ont and throwing?
Comment 5 Build Bot 2017-06-11 17:41:20 PDT
Comment on attachment 312629 [details]
Patch

Attachment 312629 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3914446

New failing tests:
fast/canvas/webgl/array-unit-tests.html
webgl/1.0.2/conformance/typedarrays/array-unit-tests.html
fast/canvas/webgl/webgl-array-invalid-ranges.html
Comment 6 Build Bot 2017-06-11 17:41:21 PDT
Created attachment 312631 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 7 Build Bot 2017-06-11 17:55:50 PDT
Comment on attachment 312629 [details]
Patch

Attachment 312629 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3914453

New failing tests:
fast/canvas/webgl/array-unit-tests.html
webgl/1.0.2/conformance/typedarrays/array-unit-tests.html
fast/canvas/webgl/webgl-array-invalid-ranges.html
Comment 8 Build Bot 2017-06-11 17:55:51 PDT
Created attachment 312632 [details]
Archive of layout-test-results from ews115 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 9 Keith Miller 2017-06-11 19:00:50 PDT
Created attachment 312633 [details]
Patch for landing
Comment 10 Keith Miller 2017-06-11 19:02:19 PDT
Created attachment 312634 [details]
Patch for landing
Comment 11 WebKit Commit Bot 2017-06-11 19:40:47 PDT
Comment on attachment 312634 [details]
Patch for landing

Clearing flags on attachment: 312634

Committed r218082: <http://trac.webkit.org/changeset/218082>
Comment 12 WebKit Commit Bot 2017-06-11 19:40:49 PDT
All reviewed patches have been landed.  Closing bug.