haikuwebkit/LayoutTests/js/dom/dfg-typed-array-neuter-expe...

18 lines
371 B
Plaintext
Raw Permalink Normal View History

Tests that DFG respects neutered typed arrays.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS array.length is 100
PASS array[0] is 42
PASS foo(array) is 100
PASS bar(array) is 42
PASS array.length is 0
Ensure %TypedArray% essential internal methods adhere to spec https://bugs.webkit.org/show_bug.cgi?id=217854 Reviewed by Yusuke Suzuki. JSTests: * stress/array-prototype-splice-making-typed-array.js: * stress/array-species-config-array-constructor.js: * stress/delete-property-dfg-inline.js: * stress/float32array-out-of-bounds.js: * stress/put-direct-index-broken-2.js: * stress/typedarray-access-monomorphic-neutered.js: * stress/typedarray-access-neutered.js: * stress/typedarray-configure-index.js: * stress/typedarray-functions-with-neutered.js: * stress/typedarray-getownproperty.js: Renamed from JSTests/stress/typedarray-getownproperty-not-configurable.js. * stress/typed-array-canonical-numeric-index-string.js: Adjust tests. * test262/expectations.yaml: Address all test failures under built-ins/TypedArrayConstructors/internals. Note that there are a slew of corrections needed for these test cases, which were discovered in the course of working on this patch: https://github.com/tc39/test262/pull/2833#issuecomment-709635850 Accordingly, these remaining lines should all disappear in the future. Source/JavaScriptCore: This patch addresses https://github.com/tc39/ecma262/pull/2164, which aligns detached buffer semantics in typed arrays with web reality. In particular: - [[HasProperty]] must not throw - IntegerIndexedElementGet (i.e. [[GetOwnProperty]] and [[Get]]) must not throw - IntegerIndexedElementSet (i.e. [[DefineOwnProperty]] and [[Set]]) must not throw - Integer-indexed elements must be [[Configurable]] (to avoid breaking a [[HasProperty]] invariant) - [[Delete]] must be overridden to return false for integer-indexed elements (which are *not* deletable) This patch furthermore ensures that all of these essential internal methods have a spec-perfect implementation. Note that there are a couple of interesting ripple effects here: - The fill(), sort(), and set() methods should throw explicitly, but we'd been letting [[Get]] throw instead. - Other callback-taking methods should *not* throw anymore; they only did so implicitly via [[Get]] and [[Set]]. * builtins/TypedArrayPrototype.js: (fill): (sort): * runtime/JSGenericTypedArrayView.h: * runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::set): (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot): (JSC::JSGenericTypedArrayView<Adaptor>::put): (JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty): (JSC::JSGenericTypedArrayView<Adaptor>::deleteProperty): (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlotByIndex): (JSC::JSGenericTypedArrayView<Adaptor>::deletePropertyByIndex): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObjectInlines.h: (JSC::JSObject::getPropertySlot): (JSC::JSObject::getNonIndexPropertySlot): * runtime/JSTypedArrays.cpp: LayoutTests: * fast/canvas/webgl/arraybuffer-transfer-of-control.html: * js/dom/dfg-typed-array-neuter-expected.txt: * js/dom/getOwnPropertyDescriptor-expected.txt: * js/dom/script-tests/dfg-typed-array-neuter.js: * js/resources/getOwnPropertyDescriptor.js: Adjust tests. Canonical link: https://commits.webkit.org/230598@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-17 09:59:28 +00:00
PASS array[0] is undefined
PASS foo(array) is 0
Ensure %TypedArray% essential internal methods adhere to spec https://bugs.webkit.org/show_bug.cgi?id=217854 Reviewed by Yusuke Suzuki. JSTests: * stress/array-prototype-splice-making-typed-array.js: * stress/array-species-config-array-constructor.js: * stress/delete-property-dfg-inline.js: * stress/float32array-out-of-bounds.js: * stress/put-direct-index-broken-2.js: * stress/typedarray-access-monomorphic-neutered.js: * stress/typedarray-access-neutered.js: * stress/typedarray-configure-index.js: * stress/typedarray-functions-with-neutered.js: * stress/typedarray-getownproperty.js: Renamed from JSTests/stress/typedarray-getownproperty-not-configurable.js. * stress/typed-array-canonical-numeric-index-string.js: Adjust tests. * test262/expectations.yaml: Address all test failures under built-ins/TypedArrayConstructors/internals. Note that there are a slew of corrections needed for these test cases, which were discovered in the course of working on this patch: https://github.com/tc39/test262/pull/2833#issuecomment-709635850 Accordingly, these remaining lines should all disappear in the future. Source/JavaScriptCore: This patch addresses https://github.com/tc39/ecma262/pull/2164, which aligns detached buffer semantics in typed arrays with web reality. In particular: - [[HasProperty]] must not throw - IntegerIndexedElementGet (i.e. [[GetOwnProperty]] and [[Get]]) must not throw - IntegerIndexedElementSet (i.e. [[DefineOwnProperty]] and [[Set]]) must not throw - Integer-indexed elements must be [[Configurable]] (to avoid breaking a [[HasProperty]] invariant) - [[Delete]] must be overridden to return false for integer-indexed elements (which are *not* deletable) This patch furthermore ensures that all of these essential internal methods have a spec-perfect implementation. Note that there are a couple of interesting ripple effects here: - The fill(), sort(), and set() methods should throw explicitly, but we'd been letting [[Get]] throw instead. - Other callback-taking methods should *not* throw anymore; they only did so implicitly via [[Get]] and [[Set]]. * builtins/TypedArrayPrototype.js: (fill): (sort): * runtime/JSGenericTypedArrayView.h: * runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::set): (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot): (JSC::JSGenericTypedArrayView<Adaptor>::put): (JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty): (JSC::JSGenericTypedArrayView<Adaptor>::deleteProperty): (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlotByIndex): (JSC::JSGenericTypedArrayView<Adaptor>::deletePropertyByIndex): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObjectInlines.h: (JSC::JSObject::getPropertySlot): (JSC::JSObject::getNonIndexPropertySlot): * runtime/JSTypedArrays.cpp: LayoutTests: * fast/canvas/webgl/arraybuffer-transfer-of-control.html: * js/dom/dfg-typed-array-neuter-expected.txt: * js/dom/getOwnPropertyDescriptor-expected.txt: * js/dom/script-tests/dfg-typed-array-neuter.js: * js/resources/getOwnPropertyDescriptor.js: Adjust tests. Canonical link: https://commits.webkit.org/230598@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-17 09:59:28 +00:00
PASS bar(array) is undefined
PASS successfullyParsed is true
TEST COMPLETE