The ECMAScript specification requires that 'new' be used with DataView (see https://bugs.ecmascript.org/show_bug.cgi?id=695). This was confirmed by discussion about the WebGL test suite (https://github.com/KhronosGroup/WebGL/issues/446). Our DataView implementation should not allow use as a constructor function, and should require the use of 'new'.
Ken Russel notes that this is true of all of the Typed Array constructors as well.
<rdar://problem/15793039>
Created attachment 220907 [details] Patch
Committed r161702: <http://trac.webkit.org/changeset/161702>
This change broke four JS tests: ** The following JSC stress test failures have been introduced: jsc-layout-tests.yaml/js/script-tests/typedarray-constructors.js.layout jsc-layout-tests.yaml/js/script-tests/typedarray-constructors.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/typedarray-constructors.js.layout-no-cjit jsc-layout-tests.yaml/js/script-tests/typedarray-constructors.js.layout-dfg-eager-no-cjit While this is probably expected, it makes the tree red.
And also fast/canvas/webgl/data-view-test.html.
Re-opened since this is blocked by bug 126803
I think all of these changes are expected, and should have been part of the patch. I'll correct and re-land.
Comment on attachment 220907 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=220907&action=review > LayoutTests/js/script-tests/typedarray-constructors.js:7 > +shouldNotThrow("new Int8Array()"); It turns out that 'shouldNotThrow' is NOT part of "standalone-pre.js", which is what's used for the JSC stress tests.
Committed r161789: <http://trac.webkit.org/changeset/161789>