Title: [202667] trunk
Revision
202667
Author
[email protected]
Date
2016-06-29 21:24:52 -0700 (Wed, 29 Jun 2016)

Log Message

[JSC] Minor TypedArray fixes
https://bugs.webkit.org/show_bug.cgi?id=159286

Patch by Benjamin Poulain <[email protected]> on 2016-06-29
Reviewed by Keith Miller.

Source/_javascript_Core:

* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::finishCreation):
See https://tc39.github.io/ecma262/#sec-%typedarray%

* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewPrivateFuncLength):
See https://tc39.github.io/ecma262/#sec-get-%typedarray%.prototype.length

(JSC::typedArrayViewProtoGetterFuncToStringTag):
Yep, that's odd.
See https://tc39.github.io/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag

(JSC::JSTypedArrayViewPrototype::finishCreation):
See the last paragraph of https://tc39.github.io/ecma262/#sec-ecmascript-standard-built-in-objects

LayoutTests:

* js/script-tests/typedarray-constructors.js:
* js/script-tests/typedarray-prototype.js:
* js/typedarray-constructors-expected.txt:
* js/typedarray-prototype-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202666 => 202667)


--- trunk/LayoutTests/ChangeLog	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/LayoutTests/ChangeLog	2016-06-30 04:24:52 UTC (rev 202667)
@@ -1,3 +1,15 @@
+2016-06-29  Benjamin Poulain  <[email protected]>
+
+        [JSC] Minor TypedArray fixes
+        https://bugs.webkit.org/show_bug.cgi?id=159286
+
+        Reviewed by Keith Miller.
+
+        * js/script-tests/typedarray-constructors.js:
+        * js/script-tests/typedarray-prototype.js:
+        * js/typedarray-constructors-expected.txt:
+        * js/typedarray-prototype-expected.txt:
+
 2016-06-29  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: API View of Native DOM APIs looks poor (TypeErrors for native getters)

Modified: trunk/LayoutTests/js/script-tests/typedarray-constructors.js (202666 => 202667)


--- trunk/LayoutTests/js/script-tests/typedarray-constructors.js	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/LayoutTests/js/script-tests/typedarray-constructors.js	2016-06-30 04:24:52 UTC (rev 202667)
@@ -3,33 +3,25 @@
 'In particular, makes sure that you use the "new" keyword when using the constructors.'
 );
 
-shouldThrow("Int8Array()");
-shouldNotThrow("new Int8Array()");
+let arrayTypes = [
+    Int8Array,
+    Int16Array,
+    Int32Array,
+    Uint8Array,
+    Uint8ClampedArray,
+    Uint16Array,
+    Uint32Array,
+    Float32Array,
+    Float64Array,
+];
 
-shouldThrow("Int16Array()");
-shouldNotThrow("new Int16Array()");
+// The prototype should be the same for every type of view.
+for (let arrayType of arrayTypes) {
+    shouldThrow("" + arrayType.name + "()");
+    shouldNotThrow("new " + arrayType.name + "()");
+    shouldBe("" + arrayType.name + ".length", "0");
+}
 
-shouldThrow("Int32Array()");
-shouldNotThrow("new Int32Array()");
-
-shouldThrow("Uint8Array()");
-shouldNotThrow("new Uint8Array()");
-
-shouldThrow("Uint16Array()");
-shouldNotThrow("new Uint16Array()");
-
-shouldThrow("Uint32Array()");
-shouldNotThrow("new Uint32Array()");
-
-shouldThrow("Uint8ClampedArray()");
-shouldNotThrow("new Uint8ClampedArray()");
-
-shouldThrow("Float32Array()");
-shouldNotThrow("new Float32Array()");
-
-shouldThrow("Float64Array()");
-shouldNotThrow("new Float64Array()");
-
 shouldThrow("DataView(new ArrayBuffer())");
 shouldNotThrow("new DataView(new ArrayBuffer())");
-
+shouldBe("DataView.length", "0");

Modified: trunk/LayoutTests/js/script-tests/typedarray-prototype.js (202666 => 202667)


--- trunk/LayoutTests/js/script-tests/typedarray-prototype.js	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/LayoutTests/js/script-tests/typedarray-prototype.js	2016-06-30 04:24:52 UTC (rev 202667)
@@ -7,6 +7,7 @@
     Int16Array,
     Int32Array,
     Uint8Array,
+    Uint8ClampedArray,
     Uint16Array,
     Uint32Array,
     Float32Array,
@@ -22,15 +23,100 @@
 
 let TypedArray = Object.getPrototypeOf(Int8Array);
 
+// buffer.
+shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.name', 'get buffer');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.length', '0');
+shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer")');
+shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").enumerable');
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").configurable');
+shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get', 'function');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").set', 'undefined');
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call([])', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'");
+
+// byteLength.
+shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.name', 'get byteLength');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.length', '0');
+shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength")');
+shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").enumerable');
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").configurable');
+shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get', 'function');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").set', 'undefined');
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call([])', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'");
+
+// byteOffset.
+shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.name', 'get byteOffset');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.length', '0');
+shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset")');
+shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").enumerable');
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").configurable');
+shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get', 'function');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").set', 'undefined');
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call([])', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'");
+
+// entries.
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").writable');
+shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").enumerable');
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").configurable');
+shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").value', 'function');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").set', 'undefined');
+shouldThrow('TypedArray.prototype.entries.call()', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('TypedArray.prototype.entries.call(undefined)', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('TypedArray.prototype.entries.call(null)', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('TypedArray.prototype.entries.call(5)', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('TypedArray.prototype.entries.call([])', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('TypedArray.prototype.entries.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('TypedArray.prototype.entries.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('TypedArray.prototype.entries.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'");
+
 // length.
+shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.name', 'get length');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length', '0');
 shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "length")');
 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").enumerable');
 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").configurable');
-shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length', '0');
 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get', 'function');
 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").set', 'undefined');
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call([])', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'");
+shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'");
 
+// toLocaleString.
+shouldBeEqualToString('TypedArray.prototype.toLocaleString.name', 'toLocaleString');
+shouldBe('TypedArray.prototype.toLocaleString.length', '0');
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable');
+shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable');
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable');
+shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value', 'function');
+
 // toString.
+shouldBeEqualToString('TypedArray.prototype.toString.name', 'toString');
+shouldBe('TypedArray.prototype.toString.length', '0');
 shouldBe('TypedArray.prototype.toString', 'Array.prototype.toString');
 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").writable');
 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").enumerable');
@@ -37,8 +123,20 @@
 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").configurable');
 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value', 'function');
 
-// toLocaleString.
-shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable');
-shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable');
-shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable');
-shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value', 'function');
+// toStringTag
+shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.name', 'get [Symbol.toStringTag]');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.length', '0');
+shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag)');
+shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).enumerable');
+shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).configurable');
+shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get', 'function');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).set', 'undefined');
+shouldBe('TypedArray.prototype[Symbol.toStringTag]', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call()', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(undefined)', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(null)', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(5)', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call([])', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call({ foo: "bar" })', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new ArrayBuffer(42))', 'undefined');
+shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new DataView(new ArrayBuffer(8), 0, 1))', 'undefined');

Modified: trunk/LayoutTests/js/typedarray-constructors-expected.txt (202666 => 202667)


--- trunk/LayoutTests/js/typedarray-constructors-expected.txt	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/LayoutTests/js/typedarray-constructors-expected.txt	2016-06-30 04:24:52 UTC (rev 202667)
@@ -5,24 +5,34 @@
 
 PASS Int8Array() threw exception TypeError: calling Int8Array constructor without new is invalid.
 PASS new Int8Array() did not throw exception.
+PASS Int8Array.length is 0
 PASS Int16Array() threw exception TypeError: calling Int16Array constructor without new is invalid.
 PASS new Int16Array() did not throw exception.
+PASS Int16Array.length is 0
 PASS Int32Array() threw exception TypeError: calling Int32Array constructor without new is invalid.
 PASS new Int32Array() did not throw exception.
+PASS Int32Array.length is 0
 PASS Uint8Array() threw exception TypeError: calling Uint8Array constructor without new is invalid.
 PASS new Uint8Array() did not throw exception.
+PASS Uint8Array.length is 0
+PASS Uint8ClampedArray() threw exception TypeError: calling Uint8ClampedArray constructor without new is invalid.
+PASS new Uint8ClampedArray() did not throw exception.
+PASS Uint8ClampedArray.length is 0
 PASS Uint16Array() threw exception TypeError: calling Uint16Array constructor without new is invalid.
 PASS new Uint16Array() did not throw exception.
+PASS Uint16Array.length is 0
 PASS Uint32Array() threw exception TypeError: calling Uint32Array constructor without new is invalid.
 PASS new Uint32Array() did not throw exception.
-PASS Uint8ClampedArray() threw exception TypeError: calling Uint8ClampedArray constructor without new is invalid.
-PASS new Uint8ClampedArray() did not throw exception.
+PASS Uint32Array.length is 0
 PASS Float32Array() threw exception TypeError: calling Float32Array constructor without new is invalid.
 PASS new Float32Array() did not throw exception.
+PASS Float32Array.length is 0
 PASS Float64Array() threw exception TypeError: calling Float64Array constructor without new is invalid.
 PASS new Float64Array() did not throw exception.
+PASS Float64Array.length is 0
 PASS DataView(new ArrayBuffer()) threw exception TypeError: calling DataView constructor without new is invalid.
 PASS new DataView(new ArrayBuffer()) did not throw exception.
+PASS DataView.length is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/js/typedarray-prototype-expected.txt (202666 => 202667)


--- trunk/LayoutTests/js/typedarray-prototype-expected.txt	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/LayoutTests/js/typedarray-prototype-expected.txt	2016-06-30 04:24:52 UTC (rev 202667)
@@ -7,6 +7,7 @@
 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Int16Array) is true
 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Int32Array) is true
 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint8Array) is true
+PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint8ClampedArray) is true
 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint16Array) is true
 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint32Array) is true
 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Float32Array) is true
@@ -14,6 +15,7 @@
 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Int16Array) is true
 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Int32Array) is true
 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint8Array) is true
+PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint8ClampedArray) is true
 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint16Array) is true
 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint32Array) is true
 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Float32Array) is true
@@ -20,15 +22,22 @@
 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Float64Array) is true
 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Int32Array) is true
 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint8Array) is true
+PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint8ClampedArray) is true
 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint16Array) is true
 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint32Array) is true
 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Float32Array) is true
 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Float64Array) is true
 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint8Array) is true
+PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint8ClampedArray) is true
 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint16Array) is true
 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint32Array) is true
 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Float32Array) is true
 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Float64Array) is true
+PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Uint8ClampedArray) is true
+PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Uint16Array) is true
+PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Uint32Array) is true
+PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Float32Array) is true
+PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Float64Array) is true
 PASS Object.getPrototypeOf(Uint16Array) === Object.getPrototypeOf(Uint16Array) is true
 PASS Object.getPrototypeOf(Uint16Array) === Object.getPrototypeOf(Uint32Array) is true
 PASS Object.getPrototypeOf(Uint16Array) === Object.getPrototypeOf(Float32Array) is true
@@ -39,21 +48,108 @@
 PASS Object.getPrototypeOf(Float32Array) === Object.getPrototypeOf(Float32Array) is true
 PASS Object.getPrototypeOf(Float32Array) === Object.getPrototypeOf(Float64Array) is true
 PASS Object.getPrototypeOf(Float64Array) === Object.getPrototypeOf(Float64Array) is true
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.name is "get buffer"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.length is 0
+PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer") is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").enumerable is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").configurable is true
+PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get is "function"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").set is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call([]) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(new DataView(new ArrayBuffer(8), 0, 1)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.name is "get byteLength"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.length is 0
+PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength") is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").enumerable is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").configurable is true
+PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get is "function"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").set is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call([]) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(new DataView(new ArrayBuffer(8), 0, 1)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.name is "get byteOffset"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.length is 0
+PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset") is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").enumerable is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").configurable is true
+PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get is "function"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").set is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call([]) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(new DataView(new ArrayBuffer(8), 0, 1)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").writable is true
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").enumerable is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").configurable is true
+PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").value is "function"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").set is undefined
+PASS TypedArray.prototype.entries.call() threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.entries.call(undefined) threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.entries.call(null) threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.entries.call(5) threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.entries.call([]) threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.entries.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.entries.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.entries.call(new DataView(new ArrayBuffer(8), 0, 1)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.name is "get length"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length is 0
 PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "length") is false
 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").enumerable is false
 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").configurable is true
-PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length is 0
 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get is "function"
 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").set is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call([]) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view.
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(new DataView(new ArrayBuffer(8), 0, 1)) threw exception TypeError: Receiver should be a typed array view.
+PASS TypedArray.prototype.toLocaleString.name is "toLocaleString"
+PASS TypedArray.prototype.toLocaleString.length is 0
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable is true
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable is true
+PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value is "function"
+PASS TypedArray.prototype.toString.name is "toString"
+PASS TypedArray.prototype.toString.length is 0
 PASS TypedArray.prototype.toString is Array.prototype.toString
 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").writable is true
 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").enumerable is false
 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").configurable is true
 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value is "function"
-PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable is true
-PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable is false
-PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable is true
-PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value is "function"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.name is "get [Symbol.toStringTag]"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.length is 0
+PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag) is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).enumerable is false
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).configurable is true
+PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get is "function"
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).set is undefined
+PASS TypedArray.prototype[Symbol.toStringTag] is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call() is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(undefined) is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(null) is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(5) is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call([]) is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call({ foo: "bar" }) is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new ArrayBuffer(42)) is undefined
+PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new DataView(new ArrayBuffer(8), 0, 1)) is undefined
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/platform/mac/js/dom/constructor-length-expected.txt (202666 => 202667)


--- trunk/LayoutTests/platform/mac/js/dom/constructor-length-expected.txt	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/LayoutTests/platform/mac/js/dom/constructor-length-expected.txt	2016-06-30 04:24:52 UTC (rev 202667)
@@ -13,18 +13,18 @@
 PASS CustomEvent.length is 1
 FAIL DOMFormData.length should be 0. Threw exception ReferenceError: Can't find variable: DOMFormData
 PASS DOMParser.length is 0
-PASS DataView.length is 3
+FAIL DataView.length should be 3. Was 0.
 PASS ErrorEvent.length is 1
 PASS Event.length is 1
 PASS EventSource.length is 1
-PASS Float32Array.length is 3
-PASS Float64Array.length is 3
+FAIL Float32Array.length should be 3. Was 0.
+FAIL Float64Array.length should be 3. Was 0.
 PASS FileReader.length is 0
 FAIL FileReaderSync.length should be 0. Threw exception ReferenceError: Can't find variable: FileReaderSync
 PASS HashChangeEvent.length is 1
-PASS Int16Array.length is 3
-PASS Int32Array.length is 3
-PASS Int8Array.length is 3
+FAIL Int16Array.length should be 3. Was 0.
+FAIL Int32Array.length should be 3. Was 0.
+FAIL Int8Array.length should be 3. Was 0.
 FAIL Intent.length should be 3. Threw exception ReferenceError: Can't find variable: Intent
 PASS MediaController.length is 0
 PASS MediaStream.length is 0
@@ -39,10 +39,10 @@
 PASS StorageEvent.length is 1
 PASS TextTrackCue.length is 3
 PASS TrackEvent.length is 1
-PASS Uint16Array.length is 3
-PASS Uint32Array.length is 3
-PASS Uint8Array.length is 3
-PASS Uint8ClampedArray.length is 3
+FAIL Uint16Array.length should be 3. Was 0.
+FAIL Uint32Array.length should be 3. Was 0.
+FAIL Uint8Array.length should be 3. Was 0.
+FAIL Uint8ClampedArray.length should be 3. Was 0.
 PASS VTTCue.length is 3
 PASS WebGLContextEvent.length is 1
 PASS WebKitAnimationEvent.length is 1

Modified: trunk/Source/_javascript_Core/ChangeLog (202666 => 202667)


--- trunk/Source/_javascript_Core/ChangeLog	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-06-30 04:24:52 UTC (rev 202667)
@@ -1,3 +1,25 @@
+2016-06-29  Benjamin Poulain  <[email protected]>
+
+        [JSC] Minor TypedArray fixes
+        https://bugs.webkit.org/show_bug.cgi?id=159286
+
+        Reviewed by Keith Miller.
+
+        * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+        (JSC::JSGenericTypedArrayViewConstructor<ViewClass>::finishCreation):
+        See https://tc39.github.io/ecma262/#sec-%typedarray%
+
+        * runtime/JSTypedArrayViewPrototype.cpp:
+        (JSC::typedArrayViewPrivateFuncLength):
+        See https://tc39.github.io/ecma262/#sec-get-%typedarray%.prototype.length
+
+        (JSC::typedArrayViewProtoGetterFuncToStringTag):
+        Yep, that's odd.
+        See https://tc39.github.io/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag
+
+        (JSC::JSTypedArrayViewPrototype::finishCreation):
+        See the last paragraph of https://tc39.github.io/ecma262/#sec-ecmascript-standard-built-in-objects
+
 2016-06-29  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: API View of Native DOM APIs looks poor (TypeErrors for native getters)

Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h (202666 => 202667)


--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2016-06-30 04:24:52 UTC (rev 202667)
@@ -49,7 +49,7 @@
 {
     Base::finishCreation(vm, name);
     putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(3), DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), DontEnum | DontDelete | ReadOnly);
     putDirectWithoutTransition(vm, vm.propertyNames->BYTES_PER_ELEMENT, jsNumber(ViewClass::elementSize), DontEnum | ReadOnly | DontDelete);
 
     if (privateAllocator)

Modified: trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp (202666 => 202667)


--- trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp	2016-06-30 04:19:42 UTC (rev 202666)
+++ trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp	2016-06-30 04:24:52 UTC (rev 202667)
@@ -72,8 +72,12 @@
 
 EncodedJSValue JSC_HOST_CALL typedArrayViewPrivateFuncLength(ExecState* exec)
 {
-    JSArrayBufferView* thisObject = jsDynamicCast<JSArrayBufferView*>(exec->argument(0));
-    if (!thisObject)
+    JSValue argument = exec->argument(0);
+    if (!argument.isCell() || !isTypedView(argument.asCell()->classInfo()->typedArrayStorageType))
+        return throwVMTypeError(exec, "Receiver should be a typed array view");
+
+    JSArrayBufferView* thisObject = jsCast<JSArrayBufferView*>(argument);
+    if (!thisObject || thisObject->mode() == DataViewMode)
         return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));
     if (thisObject->isNeutered())
         return throwVMTypeError(exec, "Underlying ArrayBuffer has been detached from the view");
@@ -203,7 +207,7 @@
 {
     JSValue thisValue = exec->thisValue();
     if (!thisValue.isObject())
-        return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
+        return JSValue::encode(jsUndefined());
 
     VM& vm = exec->vm();
     switch (thisValue.getObject()->classInfo()->typedArrayStorageType) {
@@ -227,7 +231,7 @@
         return JSValue::encode(jsString(&vm, "Uint16Array"));
     case NotTypedArray:
     case TypeDataView:
-        return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));
+        return JSValue::encode(jsUndefined());
     }
     RELEASE_ASSERT_NOT_REACHED();
 }
@@ -248,9 +252,9 @@
 
     putDirectWithoutTransition(vm, vm.propertyNames->toString, globalObject->arrayProtoToStringFunction(), DontEnum);
 
-    JSC_NATIVE_GETTER(vm.propertyNames->buffer, typedArrayViewProtoGetterFuncBuffer, DontEnum | ReadOnly | DontDelete);
-    JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteLength, typedArrayViewProtoGetterFuncByteLength, DontEnum | ReadOnly | DontDelete, TypedArrayByteLengthIntrinsic);
-    JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteOffset, typedArrayViewProtoGetterFuncByteOffset, DontEnum | ReadOnly | DontDelete, TypedArrayByteOffsetIntrinsic);
+    JSC_NATIVE_GETTER(vm.propertyNames->buffer, typedArrayViewProtoGetterFuncBuffer, DontEnum | ReadOnly);
+    JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteLength, typedArrayViewProtoGetterFuncByteLength, DontEnum | ReadOnly, TypedArrayByteLengthIntrinsic);
+    JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteOffset, typedArrayViewProtoGetterFuncByteOffset, DontEnum | ReadOnly, TypedArrayByteOffsetIntrinsic);
     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("copyWithin", typedArrayViewProtoFuncCopyWithin, DontEnum, 2);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("every", typedArrayPrototypeEveryCodeGenerator, DontEnum);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("filter", typedArrayPrototypeFilterCodeGenerator, DontEnum);
@@ -274,8 +278,12 @@
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("some", typedArrayPrototypeSomeCodeGenerator, DontEnum);
     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->subarray, typedArrayViewProtoFuncSubarray, DontEnum, 2);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->toLocaleString, typedArrayPrototypeToLocaleStringCodeGenerator, DontEnum);
-    JSC_NATIVE_GETTER(vm.propertyNames->toStringTagSymbol, typedArrayViewProtoGetterFuncToStringTag, DontEnum | ReadOnly);
 
+    JSFunction* toStringTagFunction = JSFunction::create(vm, globalObject, 0, ASCIILiteral("get [Symbol.toStringTag]"), typedArrayViewProtoGetterFuncToStringTag, NoIntrinsic);
+    GetterSetter* toStringTagAccessor = GetterSetter::create(vm, globalObject);
+    toStringTagAccessor->setGetter(vm, globalObject, toStringTagFunction);
+    putDirectNonIndexAccessor(vm, vm.propertyNames->toStringTagSymbol, toStringTagAccessor, DontEnum | ReadOnly);
+
     JSFunction* valuesFunction = JSFunction::createBuiltinFunction(vm, typedArrayPrototypeValuesCodeGenerator(vm), globalObject);
 
     putDirectWithoutTransition(vm, vm.propertyNames->builtinNames().valuesPublicName(), valuesFunction, DontEnum);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to