Changeset 202667 in webkit
- Timestamp:
- Jun 29, 2016, 9:24:52 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/js/script-tests/typedarray-constructors.js (modified) (1 diff)
-
LayoutTests/js/script-tests/typedarray-prototype.js (modified) (3 diffs)
-
LayoutTests/js/typedarray-constructors-expected.txt (modified) (1 diff)
-
LayoutTests/js/typedarray-prototype-expected.txt (modified) (6 diffs)
-
LayoutTests/platform/mac/js/dom/constructor-length-expected.txt (modified) (2 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202666 r202667 1 2016-06-29 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] Minor TypedArray fixes 4 https://bugs.webkit.org/show_bug.cgi?id=159286 5 6 Reviewed by Keith Miller. 7 8 * js/script-tests/typedarray-constructors.js: 9 * js/script-tests/typedarray-prototype.js: 10 * js/typedarray-constructors-expected.txt: 11 * js/typedarray-prototype-expected.txt: 12 1 13 2016-06-29 Joseph Pecoraro <pecoraro@apple.com> 2 14 -
trunk/LayoutTests/js/script-tests/typedarray-constructors.js
r161789 r202667 4 4 ); 5 5 6 shouldThrow("Int8Array()"); 7 shouldNotThrow("new Int8Array()"); 6 let arrayTypes = [ 7 Int8Array, 8 Int16Array, 9 Int32Array, 10 Uint8Array, 11 Uint8ClampedArray, 12 Uint16Array, 13 Uint32Array, 14 Float32Array, 15 Float64Array, 16 ]; 8 17 9 shouldThrow("Int16Array()"); 10 shouldNotThrow("new Int16Array()"); 11 12 shouldThrow("Int32Array()"); 13 shouldNotThrow("new Int32Array()"); 14 15 shouldThrow("Uint8Array()"); 16 shouldNotThrow("new Uint8Array()"); 17 18 shouldThrow("Uint16Array()"); 19 shouldNotThrow("new Uint16Array()"); 20 21 shouldThrow("Uint32Array()"); 22 shouldNotThrow("new Uint32Array()"); 23 24 shouldThrow("Uint8ClampedArray()"); 25 shouldNotThrow("new Uint8ClampedArray()"); 26 27 shouldThrow("Float32Array()"); 28 shouldNotThrow("new Float32Array()"); 29 30 shouldThrow("Float64Array()"); 31 shouldNotThrow("new Float64Array()"); 18 // The prototype should be the same for every type of view. 19 for (let arrayType of arrayTypes) { 20 shouldThrow("" + arrayType.name + "()"); 21 shouldNotThrow("new " + arrayType.name + "()"); 22 shouldBe("" + arrayType.name + ".length", "0"); 23 } 32 24 33 25 shouldThrow("DataView(new ArrayBuffer())"); 34 26 shouldNotThrow("new DataView(new ArrayBuffer())"); 35 27 shouldBe("DataView.length", "0"); -
trunk/LayoutTests/js/script-tests/typedarray-prototype.js
r202631 r202667 8 8 Int32Array, 9 9 Uint8Array, 10 Uint8ClampedArray, 10 11 Uint16Array, 11 12 Uint32Array, … … 23 24 let TypedArray = Object.getPrototypeOf(Int8Array); 24 25 26 // buffer. 27 shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.name', 'get buffer'); 28 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.length', '0'); 29 shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer")'); 30 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").enumerable'); 31 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").configurable'); 32 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get', 'function'); 33 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").set', 'undefined'); 34 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'"); 35 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'"); 36 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'"); 37 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'"); 38 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call([])', "'TypeError: Receiver should be a typed array view'"); 39 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'"); 40 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'"); 41 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'"); 42 43 // byteLength. 44 shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.name', 'get byteLength'); 45 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.length', '0'); 46 shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength")'); 47 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").enumerable'); 48 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").configurable'); 49 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get', 'function'); 50 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").set', 'undefined'); 51 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'"); 52 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'"); 53 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'"); 54 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'"); 55 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call([])', "'TypeError: Receiver should be a typed array view'"); 56 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'"); 57 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'"); 58 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'"); 59 60 // byteOffset. 61 shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.name', 'get byteOffset'); 62 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.length', '0'); 63 shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset")'); 64 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").enumerable'); 65 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").configurable'); 66 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get', 'function'); 67 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").set', 'undefined'); 68 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'"); 69 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'"); 70 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'"); 71 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'"); 72 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call([])', "'TypeError: Receiver should be a typed array view'"); 73 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'"); 74 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'"); 75 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'"); 76 77 // entries. 78 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").writable'); 79 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").enumerable'); 80 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").configurable'); 81 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").value', 'function'); 82 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").set', 'undefined'); 83 shouldThrow('TypedArray.prototype.entries.call()', "'TypeError: Receiver should be a typed array view'"); 84 shouldThrow('TypedArray.prototype.entries.call(undefined)', "'TypeError: Receiver should be a typed array view'"); 85 shouldThrow('TypedArray.prototype.entries.call(null)', "'TypeError: Receiver should be a typed array view'"); 86 shouldThrow('TypedArray.prototype.entries.call(5)', "'TypeError: Receiver should be a typed array view'"); 87 shouldThrow('TypedArray.prototype.entries.call([])', "'TypeError: Receiver should be a typed array view'"); 88 shouldThrow('TypedArray.prototype.entries.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'"); 89 shouldThrow('TypedArray.prototype.entries.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'"); 90 shouldThrow('TypedArray.prototype.entries.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'"); 91 25 92 // length. 93 shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.name', 'get length'); 94 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length', '0'); 26 95 shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "length")'); 27 96 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").enumerable'); 28 97 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").configurable'); 29 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length', '0');30 98 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get', 'function'); 31 99 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").set', 'undefined'); 100 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call()', "'TypeError: Receiver should be a typed array view but was not an object'"); 101 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(undefined)', "'TypeError: Receiver should be a typed array view but was not an object'"); 102 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(null)', "'TypeError: Receiver should be a typed array view but was not an object'"); 103 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(5)', "'TypeError: Receiver should be a typed array view but was not an object'"); 104 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call([])', "'TypeError: Receiver should be a typed array view'"); 105 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call({ foo: "bar" })', "'TypeError: Receiver should be a typed array view'"); 106 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(new ArrayBuffer(42))', "'TypeError: Receiver should be a typed array view'"); 107 shouldThrow('Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(new DataView(new ArrayBuffer(8), 0, 1))', "'TypeError: Receiver should be a typed array view'"); 108 109 // toLocaleString. 110 shouldBeEqualToString('TypedArray.prototype.toLocaleString.name', 'toLocaleString'); 111 shouldBe('TypedArray.prototype.toLocaleString.length', '0'); 112 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable'); 113 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable'); 114 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable'); 115 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value', 'function'); 32 116 33 117 // toString. 118 shouldBeEqualToString('TypedArray.prototype.toString.name', 'toString'); 119 shouldBe('TypedArray.prototype.toString.length', '0'); 34 120 shouldBe('TypedArray.prototype.toString', 'Array.prototype.toString'); 35 121 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").writable'); … … 38 124 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value', 'function'); 39 125 40 // toLocaleString. 41 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable'); 42 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable'); 43 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable'); 44 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value', 'function'); 126 // toStringTag 127 shouldBeEqualToString('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.name', 'get [Symbol.toStringTag]'); 128 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.length', '0'); 129 shouldBeFalse('"writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag)'); 130 shouldBeFalse('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).enumerable'); 131 shouldBeTrue('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).configurable'); 132 shouldBeEqualToString('typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get', 'function'); 133 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).set', 'undefined'); 134 shouldBe('TypedArray.prototype[Symbol.toStringTag]', 'undefined'); 135 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call()', 'undefined'); 136 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(undefined)', 'undefined'); 137 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(null)', 'undefined'); 138 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(5)', 'undefined'); 139 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call([])', 'undefined'); 140 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call({ foo: "bar" })', 'undefined'); 141 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new ArrayBuffer(42))', 'undefined'); 142 shouldBe('Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new DataView(new ArrayBuffer(8), 0, 1))', 'undefined'); -
trunk/LayoutTests/js/typedarray-constructors-expected.txt
r196986 r202667 6 6 PASS Int8Array() threw exception TypeError: calling Int8Array constructor without new is invalid. 7 7 PASS new Int8Array() did not throw exception. 8 PASS Int8Array.length is 0 8 9 PASS Int16Array() threw exception TypeError: calling Int16Array constructor without new is invalid. 9 10 PASS new Int16Array() did not throw exception. 11 PASS Int16Array.length is 0 10 12 PASS Int32Array() threw exception TypeError: calling Int32Array constructor without new is invalid. 11 13 PASS new Int32Array() did not throw exception. 14 PASS Int32Array.length is 0 12 15 PASS Uint8Array() threw exception TypeError: calling Uint8Array constructor without new is invalid. 13 16 PASS new Uint8Array() did not throw exception. 17 PASS Uint8Array.length is 0 18 PASS Uint8ClampedArray() threw exception TypeError: calling Uint8ClampedArray constructor without new is invalid. 19 PASS new Uint8ClampedArray() did not throw exception. 20 PASS Uint8ClampedArray.length is 0 14 21 PASS Uint16Array() threw exception TypeError: calling Uint16Array constructor without new is invalid. 15 22 PASS new Uint16Array() did not throw exception. 23 PASS Uint16Array.length is 0 16 24 PASS Uint32Array() threw exception TypeError: calling Uint32Array constructor without new is invalid. 17 25 PASS new Uint32Array() did not throw exception. 18 PASS Uint8ClampedArray() threw exception TypeError: calling Uint8ClampedArray constructor without new is invalid. 19 PASS new Uint8ClampedArray() did not throw exception. 26 PASS Uint32Array.length is 0 20 27 PASS Float32Array() threw exception TypeError: calling Float32Array constructor without new is invalid. 21 28 PASS new Float32Array() did not throw exception. 29 PASS Float32Array.length is 0 22 30 PASS Float64Array() threw exception TypeError: calling Float64Array constructor without new is invalid. 23 31 PASS new Float64Array() did not throw exception. 32 PASS Float64Array.length is 0 24 33 PASS DataView(new ArrayBuffer()) threw exception TypeError: calling DataView constructor without new is invalid. 25 34 PASS new DataView(new ArrayBuffer()) did not throw exception. 35 PASS DataView.length is 0 26 36 PASS successfullyParsed is true 27 37 -
trunk/LayoutTests/js/typedarray-prototype-expected.txt
r202631 r202667 8 8 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Int32Array) is true 9 9 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint8Array) is true 10 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint8ClampedArray) is true 10 11 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint16Array) is true 11 12 PASS Object.getPrototypeOf(Int8Array) === Object.getPrototypeOf(Uint32Array) is true … … 15 16 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Int32Array) is true 16 17 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint8Array) is true 18 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint8ClampedArray) is true 17 19 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint16Array) is true 18 20 PASS Object.getPrototypeOf(Int16Array) === Object.getPrototypeOf(Uint32Array) is true … … 21 23 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Int32Array) is true 22 24 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint8Array) is true 25 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint8ClampedArray) is true 23 26 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint16Array) is true 24 27 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Uint32Array) is true … … 26 29 PASS Object.getPrototypeOf(Int32Array) === Object.getPrototypeOf(Float64Array) is true 27 30 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint8Array) is true 31 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint8ClampedArray) is true 28 32 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint16Array) is true 29 33 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Uint32Array) is true 30 34 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Float32Array) is true 31 35 PASS Object.getPrototypeOf(Uint8Array) === Object.getPrototypeOf(Float64Array) is true 36 PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Uint8ClampedArray) is true 37 PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Uint16Array) is true 38 PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Uint32Array) is true 39 PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Float32Array) is true 40 PASS Object.getPrototypeOf(Uint8ClampedArray) === Object.getPrototypeOf(Float64Array) is true 32 41 PASS Object.getPrototypeOf(Uint16Array) === Object.getPrototypeOf(Uint16Array) is true 33 42 PASS Object.getPrototypeOf(Uint16Array) === Object.getPrototypeOf(Uint32Array) is true … … 40 49 PASS Object.getPrototypeOf(Float32Array) === Object.getPrototypeOf(Float64Array) is true 41 50 PASS Object.getPrototypeOf(Float64Array) === Object.getPrototypeOf(Float64Array) is true 51 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.name is "get buffer" 52 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.length is 0 53 PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer") is false 54 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").enumerable is false 55 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").configurable is true 56 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get is "function" 57 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").set is undefined 58 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object. 59 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object. 60 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object. 61 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object. 62 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call([]) threw exception TypeError: Receiver should be a typed array view. 63 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view. 64 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view. 65 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. 66 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.name is "get byteLength" 67 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.length is 0 68 PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength") is false 69 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").enumerable is false 70 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").configurable is true 71 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get is "function" 72 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").set is undefined 73 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object. 74 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object. 75 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object. 76 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object. 77 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call([]) threw exception TypeError: Receiver should be a typed array view. 78 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view. 79 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view. 80 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. 81 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.name is "get byteOffset" 82 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.length is 0 83 PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset") is false 84 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").enumerable is false 85 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").configurable is true 86 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get is "function" 87 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").set is undefined 88 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object. 89 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object. 90 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object. 91 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object. 92 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call([]) threw exception TypeError: Receiver should be a typed array view. 93 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view. 94 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view. 95 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. 96 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").writable is true 97 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").enumerable is false 98 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").configurable is true 99 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").value is "function" 100 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "entries").set is undefined 101 PASS TypedArray.prototype.entries.call() threw exception TypeError: Receiver should be a typed array view. 102 PASS TypedArray.prototype.entries.call(undefined) threw exception TypeError: Receiver should be a typed array view. 103 PASS TypedArray.prototype.entries.call(null) threw exception TypeError: Receiver should be a typed array view. 104 PASS TypedArray.prototype.entries.call(5) threw exception TypeError: Receiver should be a typed array view. 105 PASS TypedArray.prototype.entries.call([]) threw exception TypeError: Receiver should be a typed array view. 106 PASS TypedArray.prototype.entries.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view. 107 PASS TypedArray.prototype.entries.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view. 108 PASS TypedArray.prototype.entries.call(new DataView(new ArrayBuffer(8), 0, 1)) threw exception TypeError: Receiver should be a typed array view. 109 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.name is "get length" 110 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length is 0 42 111 PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, "length") is false 43 112 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").enumerable is false 44 113 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").configurable is true 45 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.length is 046 114 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get is "function" 47 115 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").set is undefined 116 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call() threw exception TypeError: Receiver should be a typed array view but was not an object. 117 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(undefined) threw exception TypeError: Receiver should be a typed array view but was not an object. 118 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(null) threw exception TypeError: Receiver should be a typed array view but was not an object. 119 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(5) threw exception TypeError: Receiver should be a typed array view but was not an object. 120 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call([]) threw exception TypeError: Receiver should be a typed array view. 121 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call({ foo: "bar" }) threw exception TypeError: Receiver should be a typed array view. 122 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.call(new ArrayBuffer(42)) threw exception TypeError: Receiver should be a typed array view. 123 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. 124 PASS TypedArray.prototype.toLocaleString.name is "toLocaleString" 125 PASS TypedArray.prototype.toLocaleString.length is 0 126 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable is true 127 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable is false 128 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable is true 129 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value is "function" 130 PASS TypedArray.prototype.toString.name is "toString" 131 PASS TypedArray.prototype.toString.length is 0 48 132 PASS TypedArray.prototype.toString is Array.prototype.toString 49 133 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").writable is true … … 51 135 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").configurable is true 52 136 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value is "function" 53 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").writable is true 54 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").enumerable is false 55 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, "toLocaleString").configurable is true 56 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, "toString").value is "function" 137 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.name is "get [Symbol.toStringTag]" 138 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.length is 0 139 PASS "writable" in Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag) is false 140 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).enumerable is false 141 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).configurable is true 142 PASS typeof Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get is "function" 143 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).set is undefined 144 PASS TypedArray.prototype[Symbol.toStringTag] is undefined 145 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call() is undefined 146 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(undefined) is undefined 147 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(null) is undefined 148 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(5) is undefined 149 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call([]) is undefined 150 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call({ foo: "bar" }) is undefined 151 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new ArrayBuffer(42)) is undefined 152 PASS Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.call(new DataView(new ArrayBuffer(8), 0, 1)) is undefined 57 153 PASS successfullyParsed is true 58 154 -
trunk/LayoutTests/platform/mac/js/dom/constructor-length-expected.txt
r189841 r202667 14 14 FAIL DOMFormData.length should be 0. Threw exception ReferenceError: Can't find variable: DOMFormData 15 15 PASS DOMParser.length is 0 16 PASS DataView.length is 3 16 FAIL DataView.length should be 3. Was 0. 17 17 PASS ErrorEvent.length is 1 18 18 PASS Event.length is 1 19 19 PASS EventSource.length is 1 20 PASS Float32Array.length is 3 21 PASS Float64Array.length is 3 20 FAIL Float32Array.length should be 3. Was 0. 21 FAIL Float64Array.length should be 3. Was 0. 22 22 PASS FileReader.length is 0 23 23 FAIL FileReaderSync.length should be 0. Threw exception ReferenceError: Can't find variable: FileReaderSync 24 24 PASS HashChangeEvent.length is 1 25 PASS Int16Array.length is 3 26 PASS Int32Array.length is 3 27 PASS Int8Array.length is 3 25 FAIL Int16Array.length should be 3. Was 0. 26 FAIL Int32Array.length should be 3. Was 0. 27 FAIL Int8Array.length should be 3. Was 0. 28 28 FAIL Intent.length should be 3. Threw exception ReferenceError: Can't find variable: Intent 29 29 PASS MediaController.length is 0 … … 40 40 PASS TextTrackCue.length is 3 41 41 PASS TrackEvent.length is 1 42 PASS Uint16Array.length is 3 43 PASS Uint32Array.length is 3 44 PASS Uint8Array.length is 3 45 PASS Uint8ClampedArray.length is 3 42 FAIL Uint16Array.length should be 3. Was 0. 43 FAIL Uint32Array.length should be 3. Was 0. 44 FAIL Uint8Array.length should be 3. Was 0. 45 FAIL Uint8ClampedArray.length should be 3. Was 0. 46 46 PASS VTTCue.length is 3 47 47 PASS WebGLContextEvent.length is 1 -
trunk/Source/JavaScriptCore/ChangeLog
r202666 r202667 1 2016-06-29 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] Minor TypedArray fixes 4 https://bugs.webkit.org/show_bug.cgi?id=159286 5 6 Reviewed by Keith Miller. 7 8 * runtime/JSGenericTypedArrayViewConstructorInlines.h: 9 (JSC::JSGenericTypedArrayViewConstructor<ViewClass>::finishCreation): 10 See https://tc39.github.io/ecma262/#sec-%typedarray% 11 12 * runtime/JSTypedArrayViewPrototype.cpp: 13 (JSC::typedArrayViewPrivateFuncLength): 14 See https://tc39.github.io/ecma262/#sec-get-%typedarray%.prototype.length 15 16 (JSC::typedArrayViewProtoGetterFuncToStringTag): 17 Yep, that's odd. 18 See https://tc39.github.io/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag 19 20 (JSC::JSTypedArrayViewPrototype::finishCreation): 21 See the last paragraph of https://tc39.github.io/ecma262/#sec-ecmascript-standard-built-in-objects 22 1 23 2016-06-29 Joseph Pecoraro <pecoraro@apple.com> 2 24 -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
r202280 r202667 50 50 Base::finishCreation(vm, name); 51 51 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 52 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber( 3), DontEnum | DontDelete | ReadOnly);52 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), DontEnum | DontDelete | ReadOnly); 53 53 putDirectWithoutTransition(vm, vm.propertyNames->BYTES_PER_ELEMENT, jsNumber(ViewClass::elementSize), DontEnum | ReadOnly | DontDelete); 54 54 -
trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp
r202631 r202667 73 73 EncodedJSValue JSC_HOST_CALL typedArrayViewPrivateFuncLength(ExecState* exec) 74 74 { 75 JSArrayBufferView* thisObject = jsDynamicCast<JSArrayBufferView*>(exec->argument(0)); 76 if (!thisObject) 75 JSValue argument = exec->argument(0); 76 if (!argument.isCell() || !isTypedView(argument.asCell()->classInfo()->typedArrayStorageType)) 77 return throwVMTypeError(exec, "Receiver should be a typed array view"); 78 79 JSArrayBufferView* thisObject = jsCast<JSArrayBufferView*>(argument); 80 if (!thisObject || thisObject->mode() == DataViewMode) 77 81 return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view")); 78 82 if (thisObject->isNeutered()) … … 204 208 JSValue thisValue = exec->thisValue(); 205 209 if (!thisValue.isObject()) 206 return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));210 return JSValue::encode(jsUndefined()); 207 211 208 212 VM& vm = exec->vm(); … … 228 232 case NotTypedArray: 229 233 case TypeDataView: 230 return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));234 return JSValue::encode(jsUndefined()); 231 235 } 232 236 RELEASE_ASSERT_NOT_REACHED(); … … 249 253 putDirectWithoutTransition(vm, vm.propertyNames->toString, globalObject->arrayProtoToStringFunction(), DontEnum); 250 254 251 JSC_NATIVE_GETTER(vm.propertyNames->buffer, typedArrayViewProtoGetterFuncBuffer, DontEnum | ReadOnly | DontDelete);252 JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteLength, typedArrayViewProtoGetterFuncByteLength, DontEnum | ReadOnly | DontDelete, TypedArrayByteLengthIntrinsic);253 JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteOffset, typedArrayViewProtoGetterFuncByteOffset, DontEnum | ReadOnly | DontDelete, TypedArrayByteOffsetIntrinsic);255 JSC_NATIVE_GETTER(vm.propertyNames->buffer, typedArrayViewProtoGetterFuncBuffer, DontEnum | ReadOnly); 256 JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteLength, typedArrayViewProtoGetterFuncByteLength, DontEnum | ReadOnly, TypedArrayByteLengthIntrinsic); 257 JSC_NATIVE_INTRINSIC_GETTER(vm.propertyNames->byteOffset, typedArrayViewProtoGetterFuncByteOffset, DontEnum | ReadOnly, TypedArrayByteOffsetIntrinsic); 254 258 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("copyWithin", typedArrayViewProtoFuncCopyWithin, DontEnum, 2); 255 259 JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("every", typedArrayPrototypeEveryCodeGenerator, DontEnum); … … 275 279 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->subarray, typedArrayViewProtoFuncSubarray, DontEnum, 2); 276 280 JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->toLocaleString, typedArrayPrototypeToLocaleStringCodeGenerator, DontEnum); 277 JSC_NATIVE_GETTER(vm.propertyNames->toStringTagSymbol, typedArrayViewProtoGetterFuncToStringTag, DontEnum | ReadOnly); 281 282 JSFunction* toStringTagFunction = JSFunction::create(vm, globalObject, 0, ASCIILiteral("get [Symbol.toStringTag]"), typedArrayViewProtoGetterFuncToStringTag, NoIntrinsic); 283 GetterSetter* toStringTagAccessor = GetterSetter::create(vm, globalObject); 284 toStringTagAccessor->setGetter(vm, globalObject, toStringTagFunction); 285 putDirectNonIndexAccessor(vm, vm.propertyNames->toStringTagSymbol, toStringTagAccessor, DontEnum | ReadOnly); 278 286 279 287 JSFunction* valuesFunction = JSFunction::createBuiltinFunction(vm, typedArrayPrototypeValuesCodeGenerator(vm), globalObject);
Note:
See TracChangeset
for help on using the changeset viewer.