WebKit Bugzilla
Attachment 340124 Details for
Bug 185482
: Update Test262 tests through the new import script - 20180509
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185482-20180510174549.patch (text/plain), 691.40 KB, created by
Leo Balter
on 2018-05-10 13:45:54 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Leo Balter
Created:
2018-05-10 13:45:54 PDT
Size:
691.40 KB
patch
obsolete
>Subversion Revision: 231638 >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index 515972e78001bbc0bee141c39f81c8dc200188c4..89699c7e22e36f805726cb34c82f5d80960bf1a1 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,719 @@ >+2018-05-09 Leo Balter <leonardo.balter@gmail.com> >+ >+ Update Test262 tests through the new import script - 20180509 >+ https://bugs.webkit.org/show_bug.cgi?id=185482 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Also update the test262/expecatations.yaml with the recent imported files. >+ >+ * test262/expectations.yaml: >+ * test262/harness/compareIterator.js: Added. >+ (assert.compareIterator): >+ * test262/harness/nativeFunctionMatcher.js: >+ (const.assertToStringOrNativeFunction): >+ (const.assertNativeFunction): >+ * test262/harness/regExpUtils.js: >+ * test262/harness/testIntl.js: >+ (getInvalidLanguageTags): >+ * test262/harness/testTypedArray.js: >+ * test262/harness/wellKnownIntrinsicObjects.js: Added. >+ (WellKnownIntrinsicObjects.forEach.wkio.catch): >+ * test262/latest-changes-summary.txt: Added. >+ * test262/test/annexB/language/eval-code/direct/block-decl-nostrict.js: Copied from JSTests/test262/test/language/eval-code/direct/block-decl-strict-caller.js. >+ (catch): >+ * test262/test/annexB/language/eval-code/direct/switch-case-decl-nostrict.js: Copied from JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-source.js. >+ (catch): >+ * test262/test/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js: Copied from JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js. >+ (catch): >+ * test262/test/annexB/language/function-code/block-decl-nested-blocks-with-fun-decl.js: Added. >+ (g.f): >+ (g): >+ * test262/test/annexB/language/function-code/block-decl-nostrict.js: Copied from JSTests/test262/test/language/function-code/block-decl-strict.js. >+ (catch): >+ (f): >+ * test262/test/annexB/language/function-code/switch-case-decl-nostrict.js: Copied from JSTests/test262/test/language/function-code/switch-case-decl-strict.js. >+ (catch): >+ (switch.case.1): >+ (switch): >+ * test262/test/annexB/language/function-code/switch-dflt-decl-nostrict.js: Copied from JSTests/test262/test/language/function-code/switch-dflt-decl-strict.js. >+ (catch): >+ (switch.default): >+ (switch): >+ * test262/test/built-ins/Array/prototype/filter/target-array-with-non-writable-property.js: Added. >+ (a.Symbol.species): >+ (r.a.filter): >+ * test262/test/built-ins/Array/prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js: Added. >+ (allowProxyTraps.has): >+ (fromIndex.valueOf): >+ * test262/test/built-ins/Array/prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js: Added. >+ (allowProxyTraps.has): >+ (fromIndex.valueOf): >+ * test262/test/built-ins/Array/prototype/map/target-array-with-non-writable-property.js: Added. >+ (a.Symbol.species): >+ (r.a.map): >+ * test262/test/built-ins/Array/prototype/slice/target-array-with-non-writable-property.js: Added. >+ (a.Symbol.species): >+ * test262/test/built-ins/Array/prototype/splice/property-traps-order-with-species.js: Added. >+ (a.Symbol.species): >+ * test262/test/built-ins/Array/prototype/splice/target-array-with-non-writable-property.js: Added. >+ (a.Symbol.species): >+ * test262/test/built-ins/Atomics/Symbol.toStringTag.js: >+ * test262/test/built-ins/Atomics/add/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/add/good-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/add/non-views.js: >+ * test262/test/built-ins/Atomics/add/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/add/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/and/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/and/good-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/and/non-views.js: >+ * test262/test/built-ins/Atomics/and/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/and/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/compareExchange/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/compareExchange/good-views.js: >+ (testWithTypedArrayConstructors): >+ (view): Deleted. >+ * test262/test/built-ins/Atomics/compareExchange/non-views.js: >+ * test262/test/built-ins/Atomics/compareExchange/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/compareExchange/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/exchange/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/exchange/good-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/exchange/non-views.js: >+ * test262/test/built-ins/Atomics/exchange/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/exchange/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/isLockFree/corner-cases.js: >+ (hide): >+ * test262/test/built-ins/Atomics/isLockFree/value.js: >+ (testIsLockFree): Deleted. >+ * test262/test/built-ins/Atomics/load/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/load/good-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/load/non-views.js: >+ * test262/test/built-ins/Atomics/load/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/load/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/or/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/or/good-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/or/non-views.js: >+ * test262/test/built-ins/Atomics/or/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/or/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/prop-desc.js: >+ * test262/test/built-ins/Atomics/proto.js: >+ * test262/test/built-ins/Atomics/store/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/store/good-views.js: >+ (testWithTypedArrayConstructors): >+ (ToInteger): >+ * test262/test/built-ins/Atomics/store/non-views.js: >+ * test262/test/built-ins/Atomics/store/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/store/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/sub/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/sub/good-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/sub/non-views.js: >+ * test262/test/built-ins/Atomics/sub/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/sub/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/wait/bad-range.js: Copied from JSTests/test262/test/built-ins/Atomics/wake/bad-range.js. >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/wait/cannot-suspend-throws.js: >+ * test262/test/built-ins/Atomics/wait/did-timeout.js: >+ (getReport): >+ * test262/test/built-ins/Atomics/wait/false-for-timeout-agent.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout.js. >+ (getReport): >+ (262.agent.start.valueOf.valueOf): >+ (toPrimitive.Symbol.toPrimitive): >+ (262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/false-for-timeout.js: >+ (valueOf.valueOf): >+ (toPrimitive.Symbol.toPrimitive): >+ (getReport): Deleted. >+ (262.agent.start.262.agent.receiveBroadcast): Deleted. >+ * test262/test/built-ins/Atomics/wait/good-views.js: >+ (r.getReport): >+ (getReport): >+ * test262/test/built-ins/Atomics/wait/nan-for-timeout.js: >+ (getReport): >+ * test262/test/built-ins/Atomics/wait/negative-index-throws.js: >+ * test262/test/built-ins/Atomics/wait/negative-timeout-agent.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/negative-timeout.js. >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/negative-timeout.js: >+ (262.agent.start.262.agent.receiveBroadcast): Deleted. >+ (getReport): Deleted. >+ * test262/test/built-ins/Atomics/wait/no-spurious-wakeup.js: >+ (getReport): >+ * test262/test/built-ins/Atomics/wait/non-int32-typedarray-throws.js: >+ * test262/test/built-ins/Atomics/wait/non-shared-bufferdata-throws.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/nonshared-bufferdata-throws.js. >+ * test262/test/built-ins/Atomics/wait/not-a-typedarray-throws.js: >+ * test262/test/built-ins/Atomics/wait/not-an-object-throws.js: >+ * test262/test/built-ins/Atomics/wait/null-bufferdata-throws.js: >+ * test262/test/built-ins/Atomics/wait/null-for-timeout-agent.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout.js. >+ (getReport): >+ (262.agent.start.valueOf.valueOf): >+ (toPrimitive.Symbol.toPrimitive): >+ (262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/null-for-timeout.js: >+ (valueOf.valueOf): >+ (toPrimitive.Symbol.toPrimitive): >+ (getReport): Deleted. >+ (262.agent.start.262.agent.receiveBroadcast): Deleted. >+ * test262/test/built-ins/Atomics/wait/object-for-timeout-agent.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout.js. >+ (getReport): >+ (262.agent.start.valueOf.valueOf): >+ (toString.toString): >+ (toPrimitive.Symbol.toPrimitive): >+ (262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/object-for-timeout.js: >+ (valueOf.valueOf): >+ (toString.toString): >+ (toPrimitive.Symbol.toPrimitive): >+ (getReport): Deleted. >+ (262.agent.start.262.agent.receiveBroadcast): Deleted. >+ * test262/test/built-ins/Atomics/wait/out-of-range-index-throws.js: >+ * test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js: Added. >+ (getReport): >+ (262.agent.start.poisonedValueOf.valueOf): >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ (262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js: >+ (poisonedValueOf.valueOf): >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ (getReport): Deleted. >+ (262.agent.start.262.agent.receiveBroadcast): Deleted. >+ * test262/test/built-ins/Atomics/wait/symbol-for-index-throws-agent.js: Added. >+ (getReport): >+ (262.agent.start.poisonedValueOf.valueOf): >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ (262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/symbol-for-index-throws.js: >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ (poisoned.valueOf): Deleted. >+ (poisonedWithString.get valueOf): Deleted. >+ (poisonedToPrimitive.get Symbol): Deleted. >+ * test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js: Added. >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws.js: >+ (poisonedValueOf.valueOf): >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ (getReport): Deleted. >+ (262.agent.start.262.agent.receiveBroadcast): Deleted. >+ * test262/test/built-ins/Atomics/wait/symbol-for-value-throws-agent.js: Added. >+ (getReport): >+ (262.agent.start.poisonedValueOf.valueOf): >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ (262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/symbol-for-value-throws.js: Added. >+ (poisonedValueOf.valueOf): >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ * test262/test/built-ins/Atomics/wait/true-for-timeout-agent.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout.js. >+ (getReport): >+ (262.agent.start.valueOf.valueOf): >+ (toPrimitive.Symbol.toPrimitive): >+ (262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/true-for-timeout.js: >+ (valueOf.valueOf): >+ (toPrimitive.Symbol.toPrimitive): >+ (getReport): Deleted. >+ (262.agent.start.262.agent.receiveBroadcast): Deleted. >+ * test262/test/built-ins/Atomics/wait/undefined-for-timeout.js: >+ (getReport): >+ * test262/test/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js: >+ (262.agent.start.262.agent.receiveBroadcast): >+ (getReport): >+ * test262/test/built-ins/Atomics/wait/value-not-equal.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/wait-index-value-not-equal.js. >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/wait-index-value-not-equal.js: >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js: Added. >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js: Added. >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/was-woken-before-timeout.js: >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wait/was-woken.js: >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wake/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/wake/count-boundary-cases.js: Renamed from JSTests/test262/test/built-ins/Atomics/wake/counts.js. >+ * test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-missing.js: Added. >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-undefined.js: Added. >+ (getReport): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wake/count-from-nans.js: Added. >+ * test262/test/built-ins/Atomics/wake/count-symbol-throws.js: Added. >+ * test262/test/built-ins/Atomics/wake/count-tointeger-throws-then-wake-throws.js: Added. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/good-views.js: >+ * test262/test/built-ins/Atomics/wake/negative-count.js: Renamed from JSTests/test262/test/built-ins/Atomics/wake/wake-negative.js. >+ * test262/test/built-ins/Atomics/wake/negative-index-throws.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/negative-index-throws.js. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/non-int32-typedarray-throws.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/non-int32-typedarray-throws.js. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/non-shared-bufferdata-throws.js: Renamed from JSTests/test262/test/built-ins/Atomics/wait/nonshared-bufferdata-throws.js. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/non-views.js: >+ * test262/test/built-ins/Atomics/wake/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/wake/not-a-typedarray-throws.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/not-a-typedarray-throws.js. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/not-an-object-throws.js: Added. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/null-bufferdata-throws.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/null-bufferdata-throws.js. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/out-of-range-index-throws.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/out-of-range-index-throws.js. >+ (poisoned.valueOf): >+ * test262/test/built-ins/Atomics/wake/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/wake/symbol-for-index-throws.js: Added. >+ (poisonedValueOf.valueOf): >+ (poisonedToPrimitive.Symbol.toPrimitive): >+ * test262/test/built-ins/Atomics/wake/undefined-index-defaults-to-zero.js: Copied from JSTests/test262/test/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js. >+ (262.agent.start.262.agent.receiveBroadcast): >+ (getReport): >+ * test262/test/built-ins/Atomics/wake/wake-all-on-loc.js: >+ (262.agent.start.262.agent.receiveBroadcast): >+ (getReport): >+ (waitUntil): >+ * test262/test/built-ins/Atomics/wake/wake-all.js: >+ (262.agent.start.262.agent.receiveBroadcast): >+ (getReport): >+ (waitUntil): >+ * test262/test/built-ins/Atomics/wake/wake-in-order.js: >+ (getReport): >+ (waitUntil): >+ * test262/test/built-ins/Atomics/wake/wake-nan.js: >+ (getReport): >+ * test262/test/built-ins/Atomics/wake/wake-one.js: >+ (getReport): >+ (waitUntil): >+ * test262/test/built-ins/Atomics/wake/wake-rewake-noop.js: Added. >+ (getReport): >+ (waitUntil): >+ (262.agent.start.262.agent.receiveBroadcast): >+ * test262/test/built-ins/Atomics/wake/wake-two.js: >+ (getReport): >+ * test262/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js: Added. >+ (262.agent.start.262.agent.receiveBroadcast): >+ (waitUntil): >+ * test262/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js: Added. >+ (262.agent.start.262.agent.receiveBroadcast): >+ (waitUntil): >+ * test262/test/built-ins/Atomics/wake/wake-zero.js: >+ (i.262.agent.start.262.agent.receiveBroadcast): >+ (getReport): >+ (waitUntil): >+ * test262/test/built-ins/Atomics/xor/bad-range.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/xor/good-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/xor/non-views.js: >+ * test262/test/built-ins/Atomics/xor/nonshared-int-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/Atomics/xor/shared-nonint-views.js: >+ (testWithTypedArrayConstructors): >+ * test262/test/built-ins/BigInt/asIntN/bigint-tobigint-errors.js: >+ * test262/test/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js: >+ * test262/test/built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js: >+ * test262/test/built-ins/BigInt/asIntN/bits-toindex-errors.js: >+ * test262/test/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js: >+ * test262/test/built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js: >+ * test262/test/built-ins/BigInt/asUintN/bigint-tobigint-errors.js: >+ * test262/test/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js: >+ * test262/test/built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js: >+ * test262/test/built-ins/BigInt/asUintN/bits-toindex-errors.js: >+ * test262/test/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js: >+ * test262/test/built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js: >+ * test262/test/built-ins/BigInt/constructor-empty-string.js: >+ * test262/test/built-ins/BigInt/constructor-from-binary-string.js: >+ * test262/test/built-ins/BigInt/constructor-from-decimal-string.js: >+ * test262/test/built-ins/BigInt/constructor-from-hex-string.js: >+ * test262/test/built-ins/BigInt/constructor-from-octal-string.js: >+ * test262/test/built-ins/BigInt/constructor-from-string-syntax-errors.js: >+ * test262/test/built-ins/BigInt/constructor-integer.js: Added. >+ * test262/test/built-ins/BigInt/constructor-trailing-leading-spaces.js: >+ * test262/test/built-ins/BigInt/issafeinteger-true.js: Removed. >+ * test262/test/built-ins/BigInt/out-of-bounds-integer-rangeerror.js: Removed. >+ * test262/test/built-ins/BigInt/prototype/Symbol.toStringTag.js: >+ * test262/test/built-ins/BigInt/prototype/toString/default-radix.js: Added. >+ * test262/test/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js: >+ * test262/test/built-ins/BigInt/prototype/valueOf/cross-realm.js: Added. >+ * test262/test/built-ins/BigInt/tostring-throws.js: Copied from JSTests/test262/test/built-ins/BigInt/value-of-throws.js. >+ * test262/test/built-ins/BigInt/valueof-throws.js: Renamed from JSTests/test262/test/built-ins/BigInt/value-of-throws.js. >+ (BigInt.valueOf): >+ * test262/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js: >+ (values.forEach): >+ * test262/test/built-ins/Function/prototype/bind/length-exceeds-int32.js: Added. >+ (f): >+ * test262/test/built-ins/Function/prototype/toString/anonymous-intrinsics.js: Removed. >+ * test262/test/built-ins/Function/prototype/toString/bound-function.js: >+ (assertNativeFunction): >+ (let.f): Deleted. >+ * test262/test/built-ins/Function/prototype/toString/built-in-function-object.js: Added. >+ * test262/test/built-ins/Function/prototype/toString/intrinsics.js: Removed. >+ * test262/test/built-ins/Function/prototype/toString/proxy-arrow-function.js: Added. >+ (assertNativeFunction.new.Proxy): >+ * test262/test/built-ins/Function/prototype/toString/proxy-async-function.js: Added. >+ (assertNativeFunction.new.Proxy.async): >+ * test262/test/built-ins/Function/prototype/toString/proxy-async-generator-function.js: Added. >+ (assertNativeFunction.new.Proxy.async): >+ * test262/test/built-ins/Function/prototype/toString/proxy-async-generator-method-definition.js: Added. >+ (assertNativeFunction.new.Proxy.async.method): >+ (apply): >+ * test262/test/built-ins/Function/prototype/toString/proxy-async-method-definition.js: Added. >+ (assertNativeFunction.new.Proxy.async.method): >+ (apply): >+ * test262/test/built-ins/Function/prototype/toString/proxy-bound-function.js: Added. >+ (assertNativeFunction.new.Proxy): >+ (bind): >+ * test262/test/built-ins/Function/prototype/toString/proxy-class.js: Added. >+ (assertNativeFunction): >+ * test262/test/built-ins/Function/prototype/toString/proxy-function-expression.js: Added. >+ (assertNativeFunction.new.Proxy): >+ * test262/test/built-ins/Function/prototype/toString/proxy-generator-function.js: Added. >+ (assertNativeFunction.new.Proxy): >+ * test262/test/built-ins/Function/prototype/toString/proxy-method-definition.js: Added. >+ (assertNativeFunction.new.Proxy.method): >+ (apply): >+ * test262/test/built-ins/Function/prototype/toString/proxy-non-callable-throws.js: Added. >+ * test262/test/built-ins/Function/prototype/toString/proxy.js: Removed. >+ * test262/test/built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js: Added. >+ (WellKnownIntrinsicObjects.forEach): >+ * test262/test/built-ins/JSON/prop-desc.js: Added. >+ * test262/test/built-ins/Math/acosh/nan-returns.js: >+ * test262/test/built-ins/Math/asinh/asinh-specialVals.js: >+ * test262/test/built-ins/Math/atanh/atanh-specialVals.js: >+ * test262/test/built-ins/Math/cbrt/cbrt-specialValues.js: >+ * test262/test/built-ins/Math/cbrt/prop-desc.js: >+ * test262/test/built-ins/Math/cosh/cosh-specialVals.js: >+ * test262/test/built-ins/Math/expm1/expm1-specialVals.js: >+ * test262/test/built-ins/Math/log10/Log10-specialVals.js: >+ * test262/test/built-ins/Math/log2/log2-basicTests.js: >+ * test262/test/built-ins/Math/prop-desc.js: >+ * test262/test/built-ins/Math/sign/sign-specialVals.js: >+ * test262/test/built-ins/Math/sinh/sinh-specialVals.js: >+ * test262/test/built-ins/Math/tanh/tanh-specialVals.js: >+ * test262/test/built-ins/Math/trunc/trunc-sampleTests.js: >+ * test262/test/built-ins/Math/trunc/trunc-specialVals.js: >+ * test262/test/built-ins/Object/assign/strings-and-symbol-order.js: Added. >+ * test262/test/built-ins/Object/keys/property-traps-order-with-proxied-array.js: Added. >+ (get t): >+ * test262/test/built-ins/Reflect/Reflect.js: Removed. >+ * test262/test/built-ins/Reflect/prop-desc.js: Added. >+ * test262/test/built-ins/Reflect/properties.js: Removed. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/internal-regexp-lastindex-not-zero.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-is-false.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-throws.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js: Added. >+ (obj.get Symbol): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/length.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/name.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js: Added. >+ (obj.toString): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js: Added. >+ (regexp.get Symbol): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js: Added. >+ (callMatchAll): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js: Added. >+ (TestWithConstructor): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js: Added. >+ (regexp.Symbol.species): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js: Added. >+ (regexp.Symbol.species): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js: Added. >+ (regexp.Symbol.species): >+ (get assert): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js: Added. >+ (regexp.Symbol.species): >+ (get assert): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js: Added. >+ (obj.valueOf): >+ (obj.toString): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js: Added. >+ (obj.toString): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js: Added. >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js: Added. >+ (regexp.lastIndex.valueOf): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js: Added. >+ (callMatchAll): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js: Added. >+ (regexp.lastIndex.valueOf): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js: Added. >+ (value.valueOf): >+ (value.toString): >+ * test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js: Added. >+ (value.toString): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/ancestry.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js: Added. >+ (RegExp.prototype.exec): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js: Added. >+ (return.get string_appeared_here): >+ (RegExp.prototype.exec): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js: Added. >+ (return.toString): >+ (RegExp.prototype.exec): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js: Added. >+ (execResult.get string_appeared_here): >+ (RegExp.prototype.exec): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js: Added. >+ (TestWithRegExpExec): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js: Added. >+ (callNextWithExecReturnValue.RegExp.prototype.exec): >+ (callNextWithExecReturnValue): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/length.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/name.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js: Added. >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js: Added. >+ (RegExp.prototype.exec): >+ * test262/test/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js: Added. >+ (callNext): >+ * test262/test/built-ins/String/prototype/matchAll/length.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/name.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/prop-desc.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/regexp-is-null.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/regexp-is-undefined.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js: Added. >+ (obj.Symbol.matchAll): >+ * test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js: Added. >+ (regexp.Symbol.matchAll): >+ * test262/test/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js: Added. >+ * test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js: Added. >+ (RegExp.prototype.Symbol.matchAll): >+ * test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js: Added. >+ (RegExp.prototype.Symbol.matchAll): >+ * test262/test/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js: Added. >+ * test262/test/built-ins/Symbol/matchAll/cross-realm.js: Added. >+ * test262/test/built-ins/Symbol/matchAll/prop-desc.js: Added. >+ * test262/test/harness/testTypedArray.js: >+ * test262/test/intl402/Array/prototype/toLocaleString/calls-toLocaleString-number-elements.js: Added. >+ * test262/test/intl402/Intl/getCanonicalLocales/invalid-tags.js: >+ * test262/test/intl402/Locale/constructor-newtarget-undefined.js: Added. >+ * test262/test/intl402/Locale/constructor-options-calendar-invalid.js: Added. >+ (const.invalidCalendarOption.of.invalidCalendarOptions.new.Intl.Locale): >+ * test262/test/intl402/Locale/constructor-options-calendar-valid.js: Added. >+ * test262/test/intl402/Locale/constructor-options-language-invalid.js: Added. >+ (const.invalidLanguageOption.of.invalidLanguageOptions.new.Intl.Locale): >+ * test262/test/intl402/Locale/constructor-options-language-valid.js: Added. >+ (toString): >+ * test262/test/intl402/Locale/constructor-options-region-invalid.js: Added. >+ (const.invalidRegionOption.of.invalidRegionOptions.new.Intl.Locale): >+ * test262/test/intl402/Locale/constructor-options-region-valid.js: Added. >+ * test262/test/intl402/Locale/constructor-options-script-invalid.js: Added. >+ (const.invalidScriptOption.of.invalidScriptOptions.new.Intl.Locale): >+ * test262/test/intl402/Locale/constructor-options-script-valid.js: Added. >+ (toString): >+ * test262/test/intl402/Locale/function-prototype.js: Added. >+ * test262/test/intl402/Locale/instance-extensibility.js: Added. >+ * test262/test/intl402/Locale/instance.js: Added. >+ * test262/test/intl402/Locale/invalid-tag-throws-boolean.js: Added. >+ * test262/test/intl402/Locale/invalid-tag-throws-null.js: Added. >+ * test262/test/intl402/Locale/invalid-tag-throws-number.js: Added. >+ * test262/test/intl402/Locale/invalid-tag-throws-symbol.js: Added. >+ * test262/test/intl402/Locale/invalid-tag-throws-undefined.js: Added. >+ * test262/test/intl402/Locale/invalid-tag-throws.js: Added. >+ (const.invalidTag.of.getInvalidLanguageTags): >+ * test262/test/intl402/Locale/length.js: Added. >+ * test262/test/intl402/Locale/name.js: Added. >+ * test262/test/intl402/Locale/prop-desc.js: Added. >+ * test262/test/intl402/Locale/prototype/constructor.js: Added. >+ * test262/test/intl402/Locale/prototype/maximize/length.js: Added. >+ * test262/test/intl402/Locale/prototype/maximize/name.js: Added. >+ * test262/test/intl402/Locale/prototype/maximize/prop-desc.js: Added. >+ * test262/test/intl402/Locale/prototype/prop-desc.js: Added. >+ * test262/test/intl402/Locale/prototype/toStringTag.js: Added. >+ * test262/test/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js: Added. >+ (testWithTypedArrayConstructors): >+ * test262/test/language/asi/S7.9_A11_T8.js: >+ (else.x.1): Deleted. >+ * test262/test/language/asi/S7.9_A4.js: >+ (catch): >+ * test262/test/language/asi/S7.9_A5.1_T1.js: >+ * test262/test/language/asi/S7.9_A5.3_T1.js: >+ * test262/test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js: Added. >+ (g.f): >+ (g): >+ * test262/test/language/destructuring/binding/initialization-requires-object-coercible-null.js: >+ * test262/test/language/destructuring/binding/initialization-requires-object-coercible-undefined.js: >+ * test262/test/language/destructuring/binding/initialization-returns-normal-completion-for-empty-objects.js: >+ * test262/test/language/destructuring/binding/syntax/array-elements-with-initializer.js: >+ * test262/test/language/destructuring/binding/syntax/array-elements-with-object-patterns.js: >+ * test262/test/language/destructuring/binding/syntax/array-elements-without-initializer.js: >+ * test262/test/language/destructuring/binding/syntax/array-pattern-with-elisions.js: >+ * test262/test/language/destructuring/binding/syntax/array-pattern-with-no-elements.js: >+ * test262/test/language/destructuring/binding/syntax/array-rest-elements.js: >+ * test262/test/language/destructuring/binding/syntax/object-pattern-with-no-property-list.js: >+ * test262/test/language/destructuring/binding/syntax/property-list-bindings-elements.js: >+ * test262/test/language/destructuring/binding/syntax/property-list-followed-by-a-single-comma.js: >+ * test262/test/language/destructuring/binding/syntax/property-list-single-name-bindings.js: >+ * test262/test/language/destructuring/binding/syntax/property-list-with-property-list.js: >+ * test262/test/language/destructuring/binding/syntax/recursive-array-and-object-patterns.js: >+ * test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js: Copied from JSTests/test262/test/language/eval-code/direct/block-decl-strict-source.js. >+ * test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js: Renamed from JSTests/test262/test/language/eval-code/direct/block-decl-strict-source.js. >+ (catch): >+ * test262/test/language/eval-code/direct/block-decl-onlystrict.js: Renamed from JSTests/test262/test/language/eval-code/direct/block-decl-strict-caller.js. >+ * test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js: Renamed from JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-source.js. >+ * test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js: Copied from JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-caller.js. >+ (catch): >+ * test262/test/language/eval-code/direct/switch-case-decl-onlystrict.js: Renamed from JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-caller.js. >+ * test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js: Renamed from JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-source.js. >+ * test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js: Copied from JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js. >+ (catch): >+ * test262/test/language/eval-code/direct/switch-dflt-decl-onlystrict.js: Renamed from JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js. >+ * test262/test/language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js: Added. >+ (async): >+ * test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js: Added. >+ (async): >+ * test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js: Added. >+ (async.a): >+ * test262/test/language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js: Added. >+ (async.a): >+ * test262/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js: Added. >+ * test262/test/language/expressions/async-generator/generator-created-after-decl-inst.js: Added. >+ (g.async.a): >+ * test262/test/language/expressions/class/class-name-ident-await-escaped-module.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-await-escaped.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-await-module.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-await.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-let-escaped.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-let.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-static-escaped.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-static.js: Added. >+ * test262/test/language/expressions/class/class-name-ident-yield-escaped.js: Added. >+ (C): >+ * test262/test/language/expressions/class/class-name-ident-yield.js: Added. >+ (C): >+ * test262/test/language/expressions/class/constructor-this-tdz-during-initializers.js: Added. >+ (Base): >+ (C): >+ * test262/test/language/expressions/class/fields-run-once-on-double-super.js: Added. >+ (Base): >+ (C): >+ * test262/test/language/expressions/generators/generator-created-after-decl-inst.js: Added. >+ (g): >+ * test262/test/language/expressions/greater-than-or-equal/bigint-and-incomparable-string.js: Added. >+ * test262/test/language/expressions/greater-than-or-equal/bigint-and-string.js: Added. >+ * test262/test/language/expressions/greater-than/bigint-and-boolean.js: Added. >+ * test262/test/language/expressions/greater-than/bigint-and-incomparable-string.js: Added. >+ * test262/test/language/expressions/greater-than/bigint-and-string.js: Added. >+ * test262/test/language/expressions/less-than-or-equal/bigint-and-incomparable-string.js: Added. >+ * test262/test/language/expressions/less-than-or-equal/bigint-and-string.js: Added. >+ * test262/test/language/expressions/less-than/bigint-and-boolean.js: Added. >+ * test262/test/language/expressions/less-than/bigint-and-incomparable-string.js: Added. >+ * test262/test/language/expressions/less-than/bigint-and-string.js: Added. >+ * test262/test/language/expressions/object/method-definition/generator-super-prop-param.js: >+ * test262/test/language/function-code/block-decl-onlystrict.js: Renamed from JSTests/test262/test/language/function-code/block-decl-strict.js. >+ * test262/test/language/function-code/switch-case-decl-onlystrict.js: Renamed from JSTests/test262/test/language/function-code/switch-case-decl-strict.js. >+ * test262/test/language/function-code/switch-dflt-decl-onlystrict.js: Renamed from JSTests/test262/test/language/function-code/switch-dflt-decl-strict.js. >+ * test262/test/language/line-terminators/S7.3_A2.3.js: Removed. >+ * test262/test/language/line-terminators/S7.3_A2.4.js: Removed. >+ * test262/test/language/literals/regexp/invalid-optional-lookbehind.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/invalid-optional-negative-lookbehind.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/invalid-range-lookbehind.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/invalid-range-negative-lookbehind.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-optional-lookahead.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-optional-lookbehind.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-optional-negative-lookahead.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-optional-negative-lookbehind.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-range-lookahead.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-range-lookbehind.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-range-negative-lookahead.js: Copied from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/regexp/u-invalid-range-negative-lookbehind.js: Renamed from JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js. >+ * test262/test/language/literals/string/line-separator-eval.js: Added. >+ * test262/test/language/literals/string/line-separator.js: Added. >+ * test262/test/language/literals/string/paragraph-separator-eval.js: Added. >+ * test262/test/language/literals/string/paragraph-separator.js: Added. >+ * test262/test/language/module-code/early-strict-mode.js: >+ * test262/test/language/statements/async-generator/generator-created-after-decl-inst.js: Added. >+ (async.g): >+ * test262/test/language/statements/break/S12.8_A8_T1.js: >+ (catch): >+ * test262/test/language/statements/break/S12.8_A8_T2.js: >+ (catch): >+ * test262/test/language/statements/class/class-name-ident-await-escaped-module.js: Added. >+ (aw): >+ * test262/test/language/statements/class/class-name-ident-await-escaped.js: Added. >+ (aw): >+ * test262/test/language/statements/class/class-name-ident-await-module.js: Added. >+ (await): >+ * test262/test/language/statements/class/class-name-ident-await.js: Added. >+ (await): >+ * test262/test/language/statements/class/class-name-ident-let-escaped.js: Added. >+ (l): >+ * test262/test/language/statements/class/class-name-ident-let.js: Added. >+ (let): >+ * test262/test/language/statements/class/class-name-ident-static-escaped.js: Added. >+ (st): >+ * test262/test/language/statements/class/class-name-ident-static.js: Added. >+ * test262/test/language/statements/class/class-name-ident-yield-escaped.js: Added. >+ (yi): >+ * test262/test/language/statements/class/class-name-ident-yield.js: Added. >+ (yield): >+ * test262/test/language/statements/continue/S12.7_A8_T1.js: >+ (catch): >+ * test262/test/language/statements/continue/S12.7_A8_T2.js: >+ (catch): >+ * test262/test/language/statements/generators/generator-created-after-decl-inst.js: Added. >+ (g): >+ * test262/test/language/statements/try/early-catch-duplicates.js: >+ * test262/test/language/statements/try/early-catch-function.js: Added. >+ (f.catch.e): >+ (f): >+ * test262/test/language/statements/try/early-catch-lex.js: >+ * test262/test/language/statements/try/early-catch-var.js: >+ * test262/test262-Revision.txt: >+ > 2018-05-09 Caio Lima <ticaiolima@gmail.com> > > [ESNext][BigInt] Implement support for "==" operation >diff --git a/JSTests/test262/expectations.yaml b/JSTests/test262/expectations.yaml >index 8742fbb8bda46ce4e65982207f9a0c917bf14091..997821996c7020a3b6cad911730ccb16db9e5a2e 100644 >--- a/JSTests/test262/expectations.yaml >+++ b/JSTests/test262/expectations.yaml >@@ -353,6 +353,8 @@ test/annexB/language/function-code/block-decl-func-skip-early-err-switch.js: > default: 'Test262Error: An initialized binding is not created prior to evaluation Expected a ReferenceError to be thrown but no exception was thrown at all' > test/annexB/language/function-code/block-decl-func-skip-early-err-try.js: > default: 'Test262Error: An initialized binding is not created prior to evaluation Expected a ReferenceError to be thrown but no exception was thrown at all' >+test/annexB/language/function-code/block-decl-nested-blocks-with-fun-decl.js: >+ default: 'Test262Error: Expected SameValue(ë2û, ë1û) to be true' > test/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js: > default: 'Test262Error: An initialized binding is not created prior to evaluation Expected a ReferenceError to be thrown but no exception was thrown at all' > test/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-in.js: >@@ -644,15 +646,27 @@ test/built-ins/Array/prototype/concat/is-concat-spreadable-is-array-proxy-revoke > test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy.js: > default: 'Test262Error: Proxy for an array Expected SameValue(ë1û, ë0û) to be true' > strict mode: 'Test262Error: Proxy for an array Expected SameValue(ë1û, ë0û) to be true' >+test/built-ins/Array/prototype/filter/target-array-with-non-writable-property.js: >+ default: 'TypeError: Attempted to assign to readonly property.' >+ strict mode: 'TypeError: Attempted to assign to readonly property.' > test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js: > default: 'Test262Error: Array.prototype.indexOf.call(obj, targetObj) Expected SameValue(ë-1û, ë0û) to be true' > strict mode: 'Test262Error: Array.prototype.indexOf.call(obj, targetObj) Expected SameValue(ë-1û, ë0û) to be true' > test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js: > default: 'Test262Error: Array.prototype.indexOf.call(obj, 4294967297) Expected SameValue(ë-1û, ë1û) to be true' > strict mode: 'Test262Error: Array.prototype.indexOf.call(obj, 4294967297) Expected SameValue(ë-1û, ë1û) to be true' >+test/built-ins/Array/prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js: >+ default: 'Test262Error: [[GetPrototypeOf]] trap called' >+ strict mode: 'Test262Error: [[GetPrototypeOf]] trap called' > test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js: > default: 'Test262Error: verify length is 4294967296 finally Expected SameValue(ë-1û, ë4294967295û) to be true' > strict mode: 'Test262Error: verify length is 4294967296 finally Expected SameValue(ë-1û, ë4294967295û) to be true' >+test/built-ins/Array/prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js: >+ default: 'Test262Error: [[GetPrototypeOf]] trap called' >+ strict mode: 'Test262Error: [[GetPrototypeOf]] trap called' >+test/built-ins/Array/prototype/map/target-array-with-non-writable-property.js: >+ default: 'TypeError: Attempted to assign to readonly property.' >+ strict mode: 'TypeError: Attempted to assign to readonly property.' > test/built-ins/Array/prototype/pop/S15.4.4.6_A2_T2.js: > default: 'Test262Error: #4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 9007199254740990. Actual: 4294967294' > strict mode: 'Test262Error: #4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 9007199254740990. Actual: 4294967294' >@@ -707,6 +721,9 @@ test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-arra > test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js: > default: 'Test262Error: Expected [] and [9007199254740989, 9007199254740990] to have the same contents. slice(9007199254740989)' > strict mode: 'Test262Error: Expected [] and [9007199254740989, 9007199254740990] to have the same contents. slice(9007199254740989)' >+test/built-ins/Array/prototype/slice/target-array-with-non-writable-property.js: >+ default: 'TypeError: Attempted to assign to readonly property.' >+ strict mode: 'TypeError: Attempted to assign to readonly property.' > test/built-ins/Array/prototype/sort/S15.4.4.11_A4_T3.js: > default: 'Test262Error: #3: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[0] === "z". Actual: y' > strict mode: 'Test262Error: #3: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[0] === "z". Actual: y' >@@ -743,6 +760,12 @@ test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-arra > test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js: > default: 'Test262Error: New length is 2**53 - 1 Expected SameValue(ë4294967295û, ë9007199254740991û) to be true' > strict mode: 'Test262Error: New length is 2**53 - 1 Expected SameValue(ë4294967295û, ë9007199254740991û) to be true' >+test/built-ins/Array/prototype/splice/property-traps-order-with-species.js: >+ default: 'Test262Error: Expected [defineProperty, defineProperty, set, getOwnPropertyDescriptor, defineProperty] and [defineProperty, defineProperty] to have the same contents. undefined' >+ strict mode: 'Test262Error: Expected [defineProperty, defineProperty, set, getOwnPropertyDescriptor, defineProperty] and [defineProperty, defineProperty] to have the same contents. undefined' >+test/built-ins/Array/prototype/splice/target-array-with-non-writable-property.js: >+ default: 'TypeError: Attempted to assign to readonly property.' >+ strict mode: 'TypeError: Attempted to assign to readonly property.' > test/built-ins/Array/prototype/splice/throws-if-integer-limit-exceeded.js: > default: 'Test262Error: Length is 2**53 - 1 Expected a TypeError but got a Error' > strict mode: 'Test262Error: Length is 2**53 - 1 Expected a TypeError but got a Error' >@@ -979,6 +1002,9 @@ test/built-ins/Function/internals/Construct/derived-this-uninitialized-realm.js: > test/built-ins/Function/proto-from-ctor-realm.js: > default: 'Test262Error: Expected SameValue(ëfunction () {' > strict mode: 'Test262Error: Expected SameValue(ëfunction () {' >+test/built-ins/Function/prototype/bind/length-exceeds-int32.js: >+ default: 'Test262Error: Expected SameValue(ë0û, ë2147483648û) to be true' >+ strict mode: 'Test262Error: Expected SameValue(ë0û, ë2147483648û) to be true' > test/built-ins/Function/prototype/bind/proto-from-ctor-realm.js: > default: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Object]û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Object]û) to be true' >@@ -1001,83 +1027,83 @@ test/built-ins/Function/prototype/toString/GeneratorFunction.js: > default: "SyntaxError: Unexpected token '}'. Expected a ')' or a ',' after a parameter declaration." > strict mode: "SyntaxError: Unexpected token '}'. Expected a ')' or a ',' after a parameter declaration." > test/built-ins/Function/prototype/toString/async-arrow-function.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ }'.(async /* a */ ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ }'.(async /* a */ ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ })" > test/built-ins/Function/prototype/toString/async-function-declaration.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(async function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(async function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" > test/built-ins/Function/prototype/toString/async-function-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function F( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(async function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function F( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(async function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" > test/built-ins/Function/prototype/toString/async-generator-declaration.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }'.(async /* a */ function /* b */ * /* c */ f /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }'.(async /* a */ function /* b */ * /* c */ f /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ })" > test/built-ins/Function/prototype/toString/async-generator-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function F( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }'.(async /* a */ function /* b */ * /* c */ F /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function F( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }'.(async /* a */ function /* b */ * /* c */ F /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ })" > test/built-ins/Function/prototype/toString/async-generator-method-class-expression-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/async-generator-method-class-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/async-generator-method-class-statement-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/async-generator-method-class-statement.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/async-generator-method-object.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* d */ ) /* e */ { /* f */ }'.(async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/async-method-class-expression-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/async-method-class-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/async-method-class-statement-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/async-method-class-statement.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/async-method-object.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'async function f( /* b */ ) /* c */ { /* d */ }'.(async f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/function-declaration-non-simple-parameter-list.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* c */ a /* d */ = /* e */ 0 /* f */ , /* g */ { /* h */ b /* i */ = /* j */ 0 /* k */ } /* l */ ) /* m */ { /* n */ }'.(function /* a */ f /* b */ ( /* c */ a /* d */ = /* e */ 0 /* f */ , /* g */ { /* h */ b /* i */ = /* j */ 0 /* k */ } /* l */ ) /* m */ { /* n */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* c */ a /* d */ = /* e */ 0 /* f */ , /* g */ { /* h */ b /* i */ = /* j */ 0 /* k */ } /* l */ ) /* m */ { /* n */ }'.(function /* a */ f /* b */ ( /* c */ a /* d */ = /* e */ 0 /* f */ , /* g */ { /* h */ b /* i */ = /* j */ 0 /* k */ } /* l */ ) /* m */ { /* n */ })" > test/built-ins/Function/prototype/toString/function-declaration.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" > test/built-ins/Function/prototype/toString/function-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function F( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function F( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }'.(function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ })" > test/built-ins/Function/prototype/toString/generator-function-declaration.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function g( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }'.(function /* a */ * /* b */ g /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function g( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }'.(function /* a */ * /* b */ g /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ })" > test/built-ins/Function/prototype/toString/generator-function-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function F( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }'.(function /* a */ * /* b */ F /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function F( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }'.(function /* a */ * /* b */ F /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ })" > test/built-ins/Function/prototype/toString/generator-method.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* c */ ) /* d */ { /* e */ }'.(* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* c */ ) /* d */ { /* e */ }'.(* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" > test/built-ins/Function/prototype/toString/getter-class-expression-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" > test/built-ins/Function/prototype/toString/getter-class-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" > test/built-ins/Function/prototype/toString/getter-class-statement-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" > test/built-ins/Function/prototype/toString/getter-class-statement.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" > test/built-ins/Function/prototype/toString/getter-object.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ ) /* d */ { /* e */ }'.(get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ })" > test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js: > default: "ReferenceError: Can't find variable: assertToStringOrNativeFunction" > strict mode: "ReferenceError: Can't find variable: assertToStringOrNativeFunction" >@@ -1085,44 +1111,44 @@ test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js: > default: "ReferenceError: Can't find variable: assertToStringOrNativeFunction" > strict mode: "ReferenceError: Can't find variable: assertToStringOrNativeFunction" > test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f(" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f(" > test/built-ins/Function/prototype/toString/method-class-expression-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/method-class-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/method-class-statement-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/method-class-statement.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/method-computed-property-name.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* d */ ) /* e */ { /* f */ }'.([ /* a */ \"f\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* d */ ) /* e */ { /* f */ }'.([ /* a */ \"f\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/method-object.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function f( /* b */ ) /* c */ { /* d */ }'.(f /* a */ ( /* b */ ) /* c */ { /* d */ })" > test/built-ins/Function/prototype/toString/setter-class-expression-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/setter-class-expression.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/setter-class-statement-static.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/setter-class-statement.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/setter-object.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function ( /* c */ a /* d */ ) /* e */ { /* f */ }'.(set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ })" > test/built-ins/Function/prototype/toString/unicode.js: >- default: 'Test262Error: looks pretty much like a NativeFunction' >- strict mode: 'Test262Error: looks pretty much like a NativeFunction' >+ default: "Test262Error: Conforms to NativeFunction Syntax: 'function a(\\u{62}, \\u0063) { \\u0062 = \\u{00063}; return b; }'.(function \\u0061(\\u{62}, \\u0063) { \\u0062 = \\u{00063}; return b; })" >+ strict mode: "Test262Error: Conforms to NativeFunction Syntax: 'function a(\\u{62}, \\u0063) { \\u0062 = \\u{00063}; return b; }'.(function \\u0061(\\u{62}, \\u0063) { \\u0062 = \\u{00063}; return b; })" > test/built-ins/GeneratorFunction/proto-from-ctor-realm.js: > default: 'TypeError: Type error' > strict mode: 'TypeError: Type error' >@@ -1141,9 +1167,6 @@ test/built-ins/JSON/stringify/replacer-proxy-revoked.js: > test/built-ins/Map/proto-from-ctor-realm.js: > default: 'Test262Error: Expected SameValue(ë[object Map]û, ë[object Map]û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë[object Map]û, ë[object Map]û) to be true' >-test/built-ins/Math/cbrt/prop-desc.js: >- default: "ReferenceError: Can't find variable: verifyNotEnumerable" >- strict mode: "ReferenceError: Can't find variable: verifyNotEnumerable" > test/built-ins/Math/round/S15.8.2.15_A7.js: > default: "Test262Error: #4: '1 / Math.round(0.49999999999999994) !== 1 / 0'" > strict mode: "Test262Error: #4: '1 / Math.round(0.49999999999999994) !== 1 / 0'" >@@ -1184,6 +1207,12 @@ test/built-ins/Object/internals/DefineOwnProperty/consistent-value-function-argu > default: 'Test262Error: Expected SameValue(ënullû, ë[object Arguments]û) to be true' > test/built-ins/Object/internals/DefineOwnProperty/consistent-value-function-caller.js: > default: 'Test262Error: Expected SameValue(ënullû, ëfunction g() {' >+test/built-ins/Object/internals/DefineOwnProperty/consistent-value-regexp-$1.js: >+ default: 'Test262Error: Expected SameValue(ëû, ëxû) to be true' >+ strict mode: 'Test262Error: Expected SameValue(ëû, ëxû) to be true' >+test/built-ins/Object/keys/property-traps-order-with-proxied-array.js: >+ default: 'Test262Error: Expected [ownKeys, getOwnPropertyDescriptor] and [ownKeys] to have the same contents. undefined' >+ strict mode: 'Test262Error: Expected [ownKeys, getOwnPropertyDescriptor] and [ownKeys] to have the same contents. undefined' > test/built-ins/Object/proto-from-ctor.js: > default: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Object]û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Object]û) to be true' >@@ -1325,6 +1354,72 @@ test/built-ins/RegExp/proto-from-ctor-realm.js: > test/built-ins/RegExp/prototype/Symbol.match/builtin-infer-unicode.js: > default: 'Test262Error: Expected SameValue(ëüÂû, ënullû) to be true' > strict mode: 'Test262Error: Expected SameValue(ëüÂû, ënullû) to be true' >+test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/length.js: >+ default: "TypeError: undefined is not an object (evaluating 'RegExp.prototype[Symbol.matchAll].length')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'RegExp.prototype[Symbol.matchAll].length')" >+test/built-ins/RegExp/prototype/Symbol.matchAll/name.js: >+ default: "TypeError: undefined is not an object (evaluating 'RegExp.prototype[Symbol.matchAll].name')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'RegExp.prototype[Symbol.matchAll].name')" >+test/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js: >+ default: 'Test262Error: Expected SameValue(ëundefinedû, ëfunctionû) to be true' >+ strict mode: 'Test262Error: Expected SameValue(ëundefinedû, ëfunctionû) to be true' >+test/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](obj)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](obj)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" > test/built-ins/RegExp/prototype/Symbol.replace/result-coerce-capture.js: > default: 'Test262Error: Expected SameValue(ëû, ëfoo[toString value]barû) to be true' > strict mode: 'Test262Error: Expected SameValue(ëû, ëfoo[toString value]barû) to be true' >@@ -1388,15 +1483,108 @@ test/built-ins/RegExp/unicode_restricted_octal_escape.js: > test/built-ins/RegExp/unicode_restricted_quantifiable_assertion.js: > default: 'Test262Error: RegExp("(?=.)*", "u"): Expected a SyntaxError to be thrown but no exception was thrown at all' > strict mode: 'Test262Error: RegExp("(?=.)*", "u"): Expected a SyntaxError to be thrown but no exception was thrown at all' >+test/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/ancestry.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('a')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('a')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js: >+ default: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js: >+ default: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js: >+ default: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/length.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/name.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js: >+ default: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: regexp[Symbol.matchAll] is not a function. (In 'regexp[Symbol.matchAll](str)', 'regexp[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js: >+ default: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./g[Symbol.matchAll] is not a function. (In '/./g[Symbol.matchAll]('')', '/./g[Symbol.matchAll]' is undefined)" >+test/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js: >+ default: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" >+ strict mode: "TypeError: /./[Symbol.matchAll] is not a function. (In '/./[Symbol.matchAll]('')', '/./[Symbol.matchAll]' is undefined)" > test/built-ins/Set/proto-from-ctor-realm.js: > default: 'Test262Error: Expected SameValue(ë[object Set]û, ë[object Set]û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë[object Set]û, ë[object Set]û) to be true' > test/built-ins/String/proto-from-ctor-realm.js: > default: 'Test262Error: Expected SameValue(ëû, ëû) to be true' > strict mode: 'Test262Error: Expected SameValue(ëû, ëû) to be true' >+test/built-ins/String/prototype/matchAll/length.js: >+ default: "TypeError: undefined is not an object (evaluating 'String.prototype.matchAll.length')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'String.prototype.matchAll.length')" >+test/built-ins/String/prototype/matchAll/name.js: >+ default: "TypeError: undefined is not an object (evaluating 'String.prototype.matchAll.name')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'String.prototype.matchAll.name')" >+test/built-ins/String/prototype/matchAll/prop-desc.js: >+ default: 'Test262Error: Expected SameValue(ëundefinedû, ëfunctionû) to be true' >+ strict mode: 'Test262Error: Expected SameValue(ëundefinedû, ëfunctionû) to be true' >+test/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/String/prototype/matchAll/regexp-is-null.js: >+ default: "TypeError: str.matchAll is not a function. (In 'str.matchAll(null)', 'str.matchAll' is undefined)" >+ strict mode: "TypeError: str.matchAll is not a function. (In 'str.matchAll(null)', 'str.matchAll' is undefined)" >+test/built-ins/String/prototype/matchAll/regexp-is-undefined.js: >+ default: "TypeError: str.matchAll is not a function. (In 'str.matchAll(undefined)', 'str.matchAll' is undefined)" >+ strict mode: "TypeError: str.matchAll is not a function. (In 'str.matchAll(undefined)', 'str.matchAll' is undefined)" >+test/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js: >+ default: "TypeError: str.matchAll is not a function. (In 'str.matchAll(obj)', 'str.matchAll' is undefined)" >+ strict mode: "TypeError: str.matchAll is not a function. (In 'str.matchAll(obj)', 'str.matchAll' is undefined)" >+test/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js: >+ default: "TypeError: str.matchAll is not a function. (In 'str.matchAll(/\\w/g)', 'str.matchAll' is undefined)" >+ strict mode: "TypeError: str.matchAll is not a function. (In 'str.matchAll(/\\w/g)', 'str.matchAll' is undefined)" >+test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js: >+ default: "TypeError: str.matchAll is not a function. (In 'str.matchAll(regexp)', 'str.matchAll' is undefined)" >+ strict mode: "TypeError: str.matchAll is not a function. (In 'str.matchAll(regexp)', 'str.matchAll' is undefined)" >+test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js: >+ default: 'Test262Error: Expected a Test262Error but got a TypeError' >+ strict mode: 'Test262Error: Expected a Test262Error but got a TypeError' >+test/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js: >+ default: 'Test262Error: Expected SameValue(ëundefinedû, ëfunctionû) to be true' >+ strict mode: 'Test262Error: Expected SameValue(ëundefinedû, ëfunctionû) to be true' > test/built-ins/String/prototype/trim/u180e.js: > default: 'Test262Error: Expected SameValue(ë_û, ë_á Âû) to be true' > strict mode: 'Test262Error: Expected SameValue(ë_û, ë_á Âû) to be true' >+test/built-ins/Symbol/matchAll/prop-desc.js: >+ default: 'Test262Error: Expected SameValue(ëundefinedû, ësymbolû) to be true' >+ strict mode: 'Test262Error: Expected SameValue(ëundefinedû, ësymbolû) to be true' > test/built-ins/ThrowTypeError/extensible.js: > default: 'Test262Error: Expected SameValue(ëtrueû, ëfalseû) to be true' > strict mode: 'Test262Error: Expected SameValue(ëtrueû, ëfalseû) to be true' >@@ -1734,6 +1922,69 @@ test/intl402/Intl/getCanonicalLocales/preferred-grandfathered.js: > test/intl402/Intl/getCanonicalLocales/preferred-variant.js: > default: 'Test262Error: Expected SameValue(ëja-Latn-hepburn-heplocû, ëja-Latn-alalc97û) to be true' > strict mode: 'Test262Error: Expected SameValue(ëja-Latn-hepburn-heplocû, ëja-Latn-alalc97û) to be true' >+test/intl402/Locale/constructor-options-calendar-invalid.js: >+ default: 'Test262Error: is an invalid calendar option value Expected a RangeError but got a TypeError' >+ strict mode: 'Test262Error: is an invalid calendar option value Expected a RangeError but got a TypeError' >+test/intl402/Locale/constructor-options-calendar-valid.js: >+ default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en', options)')" >+ strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en', options)')" >+test/intl402/Locale/constructor-options-language-invalid.js: >+ default: 'Test262Error: is an invalid language option value Expected a RangeError but got a TypeError' >+ strict mode: 'Test262Error: is an invalid language option value Expected a RangeError but got a TypeError' >+test/intl402/Locale/constructor-options-language-valid.js: >+ default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en', options)')" >+ strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en', options)')" >+test/intl402/Locale/constructor-options-region-invalid.js: >+ default: 'Test262Error: is an invalid region option value Expected a RangeError but got a TypeError' >+ strict mode: 'Test262Error: is an invalid region option value Expected a RangeError but got a TypeError' >+test/intl402/Locale/constructor-options-region-valid.js: >+ default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en', options)')" >+ strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en', options)')" >+test/intl402/Locale/constructor-options-script-invalid.js: >+ default: 'Test262Error: is an invalid script option value Expected a RangeError but got a TypeError' >+ strict mode: 'Test262Error: is an invalid script option value Expected a RangeError but got a TypeError' >+test/intl402/Locale/constructor-options-script-valid.js: >+ default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(\"en\", options)')" >+ strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale(\"en\", options)')" >+test/intl402/Locale/function-prototype.js: >+ default: "TypeError: undefined is not an object (evaluating 'Object.getPrototypeOf(Intl.Locale)')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Object.getPrototypeOf(Intl.Locale)')" >+test/intl402/Locale/instance-extensibility.js: >+ default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en')')" >+ strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en')')" >+test/intl402/Locale/instance.js: >+ default: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en')')" >+ strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.Locale('en')')" >+test/intl402/Locale/invalid-tag-throws.js: >+ default: 'Test262Error: Test data "de-gregory-gregory" is a canonicalized and structurally valid language tag.' >+ strict mode: 'Test262Error: Test data "de-gregory-gregory" is a canonicalized and structurally valid language tag.' >+test/intl402/Locale/length.js: >+ default: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >+test/intl402/Locale/name.js: >+ default: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >+test/intl402/Locale/prop-desc.js: >+ default: 'Test262Error: typeof Intl.Locale is function Expected SameValue(ëundefinedû, ëfunctionû) to be true' >+ strict mode: 'Test262Error: typeof Intl.Locale is function Expected SameValue(ëundefinedû, ëfunctionû) to be true' >+test/intl402/Locale/prototype/constructor.js: >+ default: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+test/intl402/Locale/prototype/maximize/length.js: >+ default: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+test/intl402/Locale/prototype/maximize/name.js: >+ default: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+test/intl402/Locale/prototype/maximize/prop-desc.js: >+ default: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+test/intl402/Locale/prototype/prop-desc.js: >+ default: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >+test/intl402/Locale/prototype/toStringTag.js: >+ default: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" >+ strict mode: "TypeError: undefined is not an object (evaluating 'Intl.Locale.prototype')" > test/intl402/Number/prototype/toLocaleString/default-options-object-prototype.js: > default: 'Test262Error: Expected SameValue(ë1.2û, ë1.23û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë1.2û, ë1.23û) to be true' >@@ -1785,90 +2036,21 @@ test/intl402/NumberFormat/prototype/formatToParts/return-abrupt-tonumber.js: > test/intl402/NumberFormat/significant-digits-options-get-sequence.js: > default: 'Test262Error: minimumSignificantDigits getter already called Expected SameValue(ëtrueû, ëfalseû) to be true' > strict mode: 'Test262Error: minimumSignificantDigits getter already called Expected SameValue(ëtrueû, ëfalseû) to be true' >-test/intl402/PluralRules/builtin.js: >- default: 'Test262Error: The [[Class]] internal property of a built-in function must be "Function". Expected SameValue(ë[object Undefined]û, ë[object Function]û) to be true' >- strict mode: 'Test262Error: The [[Class]] internal property of a built-in function must be "Function". Expected SameValue(ë[object Undefined]û, ë[object Function]û) to be true' >-test/intl402/PluralRules/can-be-subclassed.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules(locales)')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules(locales)')" > test/intl402/PluralRules/default-options-object-prototype.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules(\"en\")')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules(\"en\")')" >-test/intl402/PluralRules/internals.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >+ default: 'Test262Error: Expected SameValue(ëordinalû, ëcardinalû) to be true' >+ strict mode: 'Test262Error: Expected SameValue(ëordinalû, ëcardinalû) to be true' > test/intl402/PluralRules/length.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.length')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.length')" >-test/intl402/PluralRules/name.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.name')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.name')" >-test/intl402/PluralRules/prototype/bind.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/builtins.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/constructor/main.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >+ default: 'Test262Error: Expected obj[length] to have configurable:true.' >+ strict mode: 'Test262Error: Expected obj[length] to have configurable:true.' > test/intl402/PluralRules/prototype/constructor/prop-desc.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/properties.js: >- default: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >-test/intl402/PluralRules/prototype/resolvedOptions/builtins.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/resolvedOptions/length.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/resolvedOptions/name.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/resolvedOptions/prop-desc.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/resolvedOptions/properties.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >-test/intl402/PluralRules/prototype/select/length.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/select/name.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/select/non-finite.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >-test/intl402/PluralRules/prototype/select/prop-desc.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.prototype')" >-test/intl402/PluralRules/prototype/select/tainting.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >-test/intl402/PluralRules/supportedLocalesOf/arguments.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules(\"und\")')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules(\"und\")')" >-test/intl402/PluralRules/supportedLocalesOf/length.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.supportedLocalesOf')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.supportedLocalesOf')" >-test/intl402/PluralRules/supportedLocalesOf/main.js: >- default: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >- strict mode: "TypeError: undefined is not a constructor (evaluating 'new Intl.PluralRules()')" >-test/intl402/PluralRules/supportedLocalesOf/name.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.supportedLocalesOf')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.supportedLocalesOf')" >-test/intl402/PluralRules/supportedLocalesOf/prop-desc.js: >- default: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, name)')" >-test/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js: >- default: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.supportedLocalesOf')" >- strict mode: "TypeError: undefined is not an object (evaluating 'Intl.PluralRules.supportedLocalesOf')" >+ default: 'Test262Error: Expected obj[constructor] to have configurable:true.' >+ strict mode: 'Test262Error: Expected obj[constructor] to have configurable:true.' > test/intl402/String/prototype/localeCompare/default-options-object-prototype.js: > default: 'Test262Error: Expected SameValue(ë0û, ë-1û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë0û, ë-1û) to be true' >+test/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js: >+ default: 'Test262Error: Expected SameValue(ë0û, Ã«à ¹Â.à ¹Âà ¹Âà ¹Âû) to be true (Testing with Float64Array.)' >+ strict mode: 'Test262Error: Expected SameValue(ë0û, Ã«à ¹Â.à ¹Âà ¹Âà ¹Âû) to be true (Testing with Float64Array.)' > test/intl402/fallback-locales-are-supported.js: > default: "Test262Error: Locale zh-Hans-CN is supported, but fallback zh-CN isn't. Expected SameValue(ë-1û, ë-1û) to be false (Testing with NumberFormat.)" > strict mode: "Test262Error: Locale zh-Hans-CN is supported, but fallback zh-CN isn't. Expected SameValue(ë-1û, ë-1û) to be false (Testing with NumberFormat.)" >@@ -1965,6 +2147,9 @@ test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-r > default: 'Test262: This statement should not be evaluated.' > test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js: > default: 'Test262: This statement should not be evaluated.' >+test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js: >+ default: 'Test262: This statement should not be evaluated.' >+ strict mode: 'Test262: This statement should not be evaluated.' > test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >@@ -2204,6 +2389,12 @@ test/language/expressions/assignment/target-number.js: > test/language/expressions/assignment/target-string.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >+test/language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js: >+ default: 'Test262: This statement should not be evaluated.' >+ strict mode: 'Test262: This statement should not be evaluated.' >+test/language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js: >+ default: 'Test262: This statement should not be evaluated.' >+ strict mode: 'Test262: This statement should not be evaluated.' > test/language/expressions/async-function/early-errors-expression-not-simple-assignment-target.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >@@ -2212,6 +2403,9 @@ test/language/expressions/async-generator/early-errors-expression-not-simple-ass > strict mode: 'Test262: This statement should not be evaluated.' > test/language/expressions/async-generator/early-errors-expression-yield-as-function-binding-identifier.js: > default: 'Test262: This statement should not be evaluated.' >+test/language/expressions/async-generator/generator-created-after-decl-inst.js: >+ default: 'Test262Error: Expected SameValue(ë[object AsyncGenerator]û, ë[object AsyncGenerator]û) to be false' >+ strict mode: 'Test262Error: Expected SameValue(ë[object AsyncGenerator]û, ë[object AsyncGenerator]û) to be false' > test/language/expressions/await/early-errors-await-not-simple-assignment-target.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >@@ -2246,6 +2440,19 @@ test/language/expressions/call/tco-non-eval-global.js: > default: 'RangeError: Maximum call stack size exceeded.' > test/language/expressions/call/tco-non-eval-with.js: > default: 'RangeError: Maximum call stack size exceeded.' >+test/language/expressions/class/class-name-ident-await-escaped.js: >+ default: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" >+ strict mode: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" >+test/language/expressions/class/class-name-ident-await.js: >+ default: "SyntaxError: Unexpected identifier 'await'. Expected opening '{' at the start of a class body." >+ strict mode: "SyntaxError: Unexpected identifier 'await'. Expected opening '{' at the start of a class body." >+test/language/expressions/class/class-name-ident-static-escaped.js: >+ default: 'Test262: This statement should not be evaluated.' >+test/language/expressions/class/class-name-ident-static.js: >+ default: 'Test262: This statement should not be evaluated.' >+test/language/expressions/class/constructor-this-tdz-during-initializers.js: >+ default: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." >+ strict mode: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." > test/language/expressions/class/fields-after-same-line-gen-computed-names.js: > default: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." > strict mode: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." >@@ -2519,6 +2726,9 @@ test/language/expressions/class/fields-regular-definitions-private-names.js: > test/language/expressions/class/fields-regular-definitions-string-literal-names.js: > default: "SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list." > strict mode: "SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list." >+test/language/expressions/class/fields-run-once-on-double-super.js: >+ default: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." >+ strict mode: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." > test/language/expressions/class/fields-same-line-async-gen-computed-names.js: > default: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." > strict mode: "SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list." >@@ -2804,6 +3014,9 @@ test/language/expressions/generators/default-proto.js: > test/language/expressions/generators/eval-body-proto-realm.js: > default: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Generator]û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Generator]û) to be true' >+test/language/expressions/generators/generator-created-after-decl-inst.js: >+ default: 'Test262Error: Expected SameValue(ë[object Generator]û, ë[object Generator]û) to be false' >+ strict mode: 'Test262Error: Expected SameValue(ë[object Generator]û, ë[object Generator]û) to be false' > test/language/expressions/generators/name.js: > default: 'Test262Error: Expected SameValue(ëtrueû, ëfalseû) to be true' > strict mode: 'Test262Error: Expected SameValue(ëtrueû, ëfalseû) to be true' >@@ -3035,12 +3248,6 @@ test/language/identifiers/vertical-tilde-start-escaped.js: > test/language/identifiers/vertical-tilde-start.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >-test/language/line-terminators/S7.3_A2.3.js: >- default: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' >- strict mode: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' >-test/language/line-terminators/S7.3_A2.4.js: >- default: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' >- strict mode: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' > test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js: > default: 'SyntaxError: No space between binary literal and identifier' > strict mode: 'SyntaxError: No space between binary literal and identifier' >@@ -3164,7 +3371,16 @@ test/language/literals/regexp/u-invalid-non-empty-class-ranges.js: > test/language/literals/regexp/u-invalid-oob-decimal-escape.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >-test/language/literals/regexp/u-invalid-quantifiable-assertion.js: >+test/language/literals/regexp/u-invalid-optional-lookahead.js: >+ default: 'Test262: This statement should not be evaluated.' >+ strict mode: 'Test262: This statement should not be evaluated.' >+test/language/literals/regexp/u-invalid-optional-negative-lookahead.js: >+ default: 'Test262: This statement should not be evaluated.' >+ strict mode: 'Test262: This statement should not be evaluated.' >+test/language/literals/regexp/u-invalid-range-lookahead.js: >+ default: 'Test262: This statement should not be evaluated.' >+ strict mode: 'Test262: This statement should not be evaluated.' >+test/language/literals/regexp/u-invalid-range-negative-lookahead.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' > test/language/module-code/instn-resolve-order-depth.js: >@@ -3185,6 +3401,19 @@ test/language/module-code/parse-err-reference.js: > module: 'Test262: This statement should not be evaluated.' > test/language/module-code/privatename-valid-no-earlyerr.js: > module: "SyntaxError: Invalid character: '#'" >+test/language/statements/async-generator/generator-created-after-decl-inst.js: >+ default: 'Test262Error: Expected SameValue(ë[object AsyncGenerator]û, ë[object AsyncGenerator]û) to be false' >+ strict mode: 'Test262Error: Expected SameValue(ë[object AsyncGenerator]û, ë[object AsyncGenerator]û) to be false' >+test/language/statements/class/class-name-ident-await-escaped.js: >+ default: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" >+ strict mode: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" >+test/language/statements/class/class-name-ident-await.js: >+ default: "SyntaxError: Unexpected identifier 'await'" >+ strict mode: "SyntaxError: Unexpected identifier 'await'" >+test/language/statements/class/class-name-ident-static-escaped.js: >+ default: 'Test262: This statement should not be evaluated.' >+test/language/statements/class/class-name-ident-static.js: >+ default: 'Test262: This statement should not be evaluated.' > test/language/statements/class/classelementname-abrupt-completion.js: > default: "SyntaxError: Unexpected token '}'. Expected an opening '(' before a method's parameter list." > strict mode: "SyntaxError: Unexpected token '}'. Expected an opening '(' before a method's parameter list." >@@ -3873,6 +4102,9 @@ test/language/statements/function/scope-param-rest-elem-var-close.js: > test/language/statements/generators/default-proto.js: > default: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Generator]û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Generator]û) to be true' >+test/language/statements/generators/generator-created-after-decl-inst.js: >+ default: 'Test262Error: Expected SameValue(ë[object Generator]û, ë[object Generator]û) to be false' >+ strict mode: 'Test262Error: Expected SameValue(ë[object Generator]û, ë[object Generator]û) to be false' > test/language/statements/generators/scope-body-lex-distinct.js: > default: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' > test/language/statements/generators/scope-param-elem-var-close.js: >@@ -4058,6 +4290,9 @@ test/language/statements/switch/syntax/redeclaration/var-declaration-attempt-to- > test/language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >+test/language/statements/try/early-catch-function.js: >+ default: 'Test262: This statement should not be evaluated.' >+ strict mode: 'Test262: This statement should not be evaluated.' > test/language/statements/try/early-catch-lex.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: 'Test262: This statement should not be evaluated.' >diff --git a/JSTests/test262/harness/compareIterator.js b/JSTests/test262/harness/compareIterator.js >new file mode 100644 >index 0000000000000000000000000000000000000000..69b9246e1b71685514b89f5542f28ee52f29029c >--- /dev/null >+++ b/JSTests/test262/harness/compareIterator.js >@@ -0,0 +1,34 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+description: Compare the values of an iterator with an array of expected values >+---*/ >+ >+// Example: >+// >+// function* numbers() { >+// yield 1; >+// yield 2; >+// yield 3; >+// } >+// >+// compareIterator(numbers(), [ >+// v => assert.sameValue(v, 1), >+// v => assert.sameValue(v, 2), >+// v => assert.sameValue(v, 3), >+// ]); >+// >+assert.compareIterator = function(iter, validators, message) { >+ message = message || ''; >+ >+ var i, result; >+ for (i = 0; i < validators.length; i++) { >+ result = iter.next(); >+ assert(!result.done, 'Expected ' + i + ' values(s). Instead iterator only produced ' + (i - 1) + ' value(s). ' + message); >+ validators[i](result.value); >+ } >+ >+ result = iter.next(); >+ assert(result.done, 'Expected only ' + i + ' values(s). Instead iterator produced more. ' + message); >+ assert.sameValue(result.value, undefined, 'Expected value of `undefined` when iterator completes. ' + message); >+} >diff --git a/JSTests/test262/harness/nativeFunctionMatcher.js b/JSTests/test262/harness/nativeFunctionMatcher.js >index 52120ea48e205eabab3564ae82c39e349d23563a..9b43d8f4d78b8dff9f7b970b5c12d13ebcb292c3 100644 >--- a/JSTests/test262/harness/nativeFunctionMatcher.js >+++ b/JSTests/test262/harness/nativeFunctionMatcher.js >@@ -1,9 +1,14 @@ > // Copyright (C) 2017 Ecma International. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > /*--- >-description: | >+description: Assert _NativeFunction_ Syntax >+info: | > This regex makes a best-effort determination that the tested string matches > the NativeFunction grammar production without requiring a correct tokeniser. >+ >+ NativeFunction : >+ function _IdentifierName_ opt ( _FormalParameters_ ) { [ native code ] } >+ > ---*/ > const NATIVE_FUNCTION_RE = /\bfunction\b[\s\S]*\([\s\S]*\)[\s\S]*\{[\s\S]*\[[\s\S]*\bnative\b[\s\S]+\bcode\b[\s\S]*\][\s\S]*\}/; > >@@ -12,11 +17,14 @@ const assertToStringOrNativeFunction = function(fn, expected) { > try { > assert.sameValue(actual, expected); > } catch (unused) { >- assertNativeFunction(fn); >+ assertNativeFunction(fn, expected); > } > }; > >-const assertNativeFunction = function(fn) { >+const assertNativeFunction = function(fn, special) { > const actual = "" + fn; >- assert(NATIVE_FUNCTION_RE.test(actual), "looks pretty much like a NativeFunction"); >+ assert( >+ NATIVE_FUNCTION_RE.test(actual), >+ "Conforms to NativeFunction Syntax: '" + actual + "'." + (special ? "(" + special + ")" : "") >+ ); > }; >diff --git a/JSTests/test262/harness/regExpUtils.js b/JSTests/test262/harness/regExpUtils.js >index bdb956427ac5b484487ee5330fe6827172491d42..4dd7ddf13b0c4523cbce947931b1f72d87b0504d 100644 >--- a/JSTests/test262/harness/regExpUtils.js >+++ b/JSTests/test262/harness/regExpUtils.js >@@ -37,3 +37,18 @@ function testPropertyEscapes(regex, string, expression) { > } > } > } >+ >+// Returns a function that will validate RegExp match result >+// >+// Example: >+// >+// var validate = matchValidator(['b'], 1, 'abc'); >+// validate(/b/.exec('abc')); >+// >+function matchValidator(expectedEntries, expectedIndex, expectedInput) { >+ return function(match) { >+ assert.compareArray(match, expectedEntries, 'Match entries'); >+ assert.sameValue(match.index, expectedIndex, 'Match index'); >+ assert.sameValue(match.input, expectedInput, 'Match input'); >+ } >+} >diff --git a/JSTests/test262/harness/testIntl.js b/JSTests/test262/harness/testIntl.js >index 690791d7d09bf1b7df64d0739675153d39fd0c19..3b9e62d7cee2adab2390dedc3e80119ccc9bfb61 100644 >--- a/JSTests/test262/harness/testIntl.js >+++ b/JSTests/test262/harness/testIntl.js >@@ -162,6 +162,66 @@ function getLocaleSupportInfo(Constructor) { > } > > >+/** >+ * Returns an array of strings for which IsStructurallyValidLanguageTag() returns false >+ */ >+function getInvalidLanguageTags() { >+ var invalidLanguageTags = [ >+ "", // empty tag >+ "i", // singleton alone >+ "x", // private use without subtag >+ "u", // extension singleton in first place >+ "419", // region code in first place >+ "u-nu-latn-cu-bob", // extension sequence without language >+ "hans-cmn-cn", // "hans" could theoretically be a 4-letter language code, >+ // but those can't be followed by extlang codes. >+ "cmn-hans-cn-u-u", // duplicate singleton >+ "cmn-hans-cn-t-u-ca-u", // duplicate singleton >+ "de-gregory-gregory", // duplicate variant >+ "*", // language range >+ "de-*", // language range >+ "䏿", // non-ASCII letters >+ "en-Ã", // non-ASCII letters >+ "ıd", // non-ASCII letters >+ >+ // underscores in different parts of the language tag >+ "de_DE", >+ "DE_de", >+ "cmn_Hans", >+ "cmn-hans_cn", >+ "es_419", >+ "es-419-u-nu-latn-cu_bob", >+ "i_klingon", >+ "cmn-hans-cn-t-ca-u-ca-x_t-u", >+ "enochian_enochian", >+ "de-gregory_u-ca-gregory", >+ >+ "en\u0000", // null-terminator sequence >+ " en", // leading whitespace >+ "en ", // trailing whitespace >+ "it-IT-Latn", // country before script tag >+ "de-u", // incomplete Unicode extension sequences >+ "de-u-", >+ "de-u-ca-", >+ "de-u-ca-gregory-", >+ "si-x", // incomplete private-use tags >+ "x-", >+ "x-y-", >+ ]; >+ >+ // make sure the data above is correct >+ for (var i = 0; i < invalidLanguageTags.length; ++i) { >+ var invalidTag = invalidLanguageTags[i]; >+ assert( >+ !isCanonicalizedStructurallyValidLanguageTag(invalidTag), >+ "Test data \"" + invalidTag + "\" is a canonicalized and structurally valid language tag." >+ ); >+ } >+ >+ return invalidLanguageTags; >+} >+ >+ > /** > * @description Tests whether locale is a String value representing a > * structurally valid and canonicalized BCP 47 language tag, as defined in >diff --git a/JSTests/test262/harness/testTypedArray.js b/JSTests/test262/harness/testTypedArray.js >index 2699214ca358f7eadab04d1085d57234d604d937..030c05e90b62433de6e0aa9029bf4d0c86268b73 100644 >--- a/JSTests/test262/harness/testTypedArray.js >+++ b/JSTests/test262/harness/testTypedArray.js >@@ -20,6 +20,9 @@ var typedArrayConstructors = [ > Uint8ClampedArray > ]; > >+var floatArrayConstructors = typedArrayConstructors.slice(0, 2); >+var intArrayConstructors = typedArrayConstructors.slice(2, 7); >+ > /** > * The %TypedArray% intrinsic constructor function. > */ >diff --git a/JSTests/test262/harness/wellKnownIntrinsicObjects.js b/JSTests/test262/harness/wellKnownIntrinsicObjects.js >new file mode 100644 >index 0000000000000000000000000000000000000000..2c1ce9df82deaf51aa887e9b7b2b9b2a9191b292 >--- /dev/null >+++ b/JSTests/test262/harness/wellKnownIntrinsicObjects.js >@@ -0,0 +1,458 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+description: | >+ An Array of all representable Well-Known Intrinsic Objects >+---*/ >+ >+const WellKnownIntrinsicObjects = [ >+ { >+ intrinsicName: "%Array%", >+ globalNameOrSource: "Array" >+ }, >+ { >+ intrinsicName: "%ArrayBuffer%", >+ globalNameOrSource: "ArrayBuffer" >+ }, >+ { >+ intrinsicName: "%ArrayBufferPrototype%", >+ globalNameOrSource: "ArrayBuffer.prototype" >+ }, >+ { >+ intrinsicName: "%ArrayIteratorPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf([][Symbol.iterator]())" >+ }, >+ { >+ intrinsicName: "%ArrayPrototype%", >+ globalNameOrSource: "Array.prototype" >+ }, >+ { >+ intrinsicName: "%ArrayProto_entries%", >+ globalNameOrSource: "Array.prototype.entries" >+ }, >+ { >+ intrinsicName: "%ArrayProto_forEach%", >+ globalNameOrSource: "Array.prototype.forEach" >+ }, >+ { >+ intrinsicName: "%ArrayProto_keys%", >+ globalNameOrSource: "Array.prototype.keys" >+ }, >+ { >+ intrinsicName: "%ArrayProto_values%", >+ globalNameOrSource: "Array.prototype.values" >+ }, >+ { >+ intrinsicName: "%AsyncFromSyncIteratorPrototype%", >+ globalNameOrSource: "undefined" >+ }, >+ { >+ intrinsicName: "%AsyncFunction%", >+ globalNameOrSource: "(async function() {}).constructor" >+ }, >+ { >+ intrinsicName: "%AsyncFunctionPrototype%", >+ globalNameOrSource: "(async function() {}).constructor.prototype" >+ }, >+ { >+ intrinsicName: "%AsyncGenerator%", >+ globalNameOrSource: "Object.getPrototypeOf((async function * () {})())" >+ }, >+ { >+ intrinsicName: "%AsyncGeneratorFunction%", >+ globalNameOrSource: "Object.getPrototypeOf(async function * () {})" >+ }, >+ { >+ intrinsicName: "%AsyncGeneratorPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf(async function * () {}).prototype" >+ }, >+ { >+ intrinsicName: "%AsyncIteratorPrototype%", >+ globalNameOrSource: "((async function * () {})())[Symbol.asyncIterator]()" >+ }, >+ { >+ intrinsicName: "%Atomics%", >+ globalNameOrSource: "Atomics" >+ }, >+ { >+ intrinsicName: "%Boolean%", >+ globalNameOrSource: "Boolean" >+ }, >+ { >+ intrinsicName: "%BooleanPrototype%", >+ globalNameOrSource: "Boolean.prototype" >+ }, >+ { >+ intrinsicName: "%DataView%", >+ globalNameOrSource: "DataView" >+ }, >+ { >+ intrinsicName: "%DataViewPrototype%", >+ globalNameOrSource: "DataView.prototype" >+ }, >+ { >+ intrinsicName: "%Date%", >+ globalNameOrSource: "Date" >+ }, >+ { >+ intrinsicName: "%DatePrototype%", >+ globalNameOrSource: "Date.prototype" >+ }, >+ { >+ intrinsicName: "%decodeURI%", >+ globalNameOrSource: "decodeURI" >+ }, >+ { >+ intrinsicName: "%decodeURIComponent%", >+ globalNameOrSource: "decodeURIComponent" >+ }, >+ { >+ intrinsicName: "%encodeURI%", >+ globalNameOrSource: "encodeURI" >+ }, >+ { >+ intrinsicName: "%encodeURIComponent%", >+ globalNameOrSource: "encodeURIComponent" >+ }, >+ { >+ intrinsicName: "%Error%", >+ globalNameOrSource: "Error" >+ }, >+ { >+ intrinsicName: "%ErrorPrototype%", >+ globalNameOrSource: "Error.prototype" >+ }, >+ { >+ intrinsicName: "%eval%", >+ globalNameOrSource: "eval" >+ }, >+ { >+ intrinsicName: "%EvalError%", >+ globalNameOrSource: "EvalError" >+ }, >+ { >+ intrinsicName: "%EvalErrorPrototype%", >+ globalNameOrSource: "EvalError.prototype" >+ }, >+ { >+ intrinsicName: "%Float32Array%", >+ globalNameOrSource: "Float32Array" >+ }, >+ { >+ intrinsicName: "%Float32ArrayPrototype%", >+ globalNameOrSource: "Float32Array.prototype" >+ }, >+ { >+ intrinsicName: "%Float64Array%", >+ globalNameOrSource: "Float64Array" >+ }, >+ { >+ intrinsicName: "%Float64ArrayPrototype%", >+ globalNameOrSource: "Float64Array.prototype" >+ }, >+ { >+ intrinsicName: "%Function%", >+ globalNameOrSource: "Function" >+ }, >+ { >+ intrinsicName: "%FunctionPrototype%", >+ globalNameOrSource: "Function.prototype" >+ }, >+ { >+ intrinsicName: "%Generator%", >+ globalNameOrSource: "Object.getPrototypeOf((function * () {})())" >+ }, >+ { >+ intrinsicName: "%GeneratorFunction%", >+ globalNameOrSource: "Object.getPrototypeOf(function * () {})" >+ }, >+ { >+ intrinsicName: "%GeneratorPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf(function * () {}).prototype" >+ }, >+ { >+ intrinsicName: "%Int8Array%", >+ globalNameOrSource: "Int8Array" >+ }, >+ { >+ intrinsicName: "%Int8ArrayPrototype%", >+ globalNameOrSource: "Int8Array.prototype" >+ }, >+ { >+ intrinsicName: "%Int16Array%", >+ globalNameOrSource: "Int16Array" >+ }, >+ { >+ intrinsicName: "%Int16ArrayPrototype%", >+ globalNameOrSource: "Int16Array.prototype" >+ }, >+ { >+ intrinsicName: "%Int32Array%", >+ globalNameOrSource: "Int32Array" >+ }, >+ { >+ intrinsicName: "%Int32ArrayPrototype%", >+ globalNameOrSource: "Int32Array.prototype" >+ }, >+ { >+ intrinsicName: "%isFinite%", >+ globalNameOrSource: "isFinite" >+ }, >+ { >+ intrinsicName: "%isNaN%", >+ globalNameOrSource: "isNaN" >+ }, >+ { >+ intrinsicName: "%IteratorPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))" >+ }, >+ { >+ intrinsicName: "%JSON%", >+ globalNameOrSource: "JSON" >+ }, >+ { >+ intrinsicName: "%JSONParse%", >+ globalNameOrSource: "JSON.parse" >+ }, >+ { >+ intrinsicName: "%Map%", >+ globalNameOrSource: "Map" >+ }, >+ { >+ intrinsicName: "%MapIteratorPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf(new Map()[Symbol.iterator]())" >+ }, >+ { >+ intrinsicName: "%MapPrototype%", >+ globalNameOrSource: "Map.prototype" >+ }, >+ { >+ intrinsicName: "%Math%", >+ globalNameOrSource: "Math" >+ }, >+ { >+ intrinsicName: "%Number%", >+ globalNameOrSource: "Number" >+ }, >+ { >+ intrinsicName: "%NumberPrototype%", >+ globalNameOrSource: "Number.prototype" >+ }, >+ { >+ intrinsicName: "%Object%", >+ globalNameOrSource: "Object" >+ }, >+ { >+ intrinsicName: "%ObjectPrototype%", >+ globalNameOrSource: "Object.prototype" >+ }, >+ { >+ intrinsicName: "%ObjProto_toString%", >+ globalNameOrSource: "Object.prototype.toString" >+ }, >+ { >+ intrinsicName: "%ObjProto_valueOf%", >+ globalNameOrSource: "Object.prototype.valueOf" >+ }, >+ { >+ intrinsicName: "%parseFloat%", >+ globalNameOrSource: "parseFloat" >+ }, >+ { >+ intrinsicName: "%parseInt%", >+ globalNameOrSource: "parseInt" >+ }, >+ { >+ intrinsicName: "%Promise%", >+ globalNameOrSource: "Promise" >+ }, >+ { >+ intrinsicName: "%PromisePrototype%", >+ globalNameOrSource: "Promise.prototype" >+ }, >+ { >+ intrinsicName: "%PromiseProto_then%", >+ globalNameOrSource: "Promise.prototype.then" >+ }, >+ { >+ intrinsicName: "%Promise_all%", >+ globalNameOrSource: "Promise.all" >+ }, >+ { >+ intrinsicName: "%Promise_reject%", >+ globalNameOrSource: "Promise.reject" >+ }, >+ { >+ intrinsicName: "%Promise_resolve%", >+ globalNameOrSource: "Promise.resolve" >+ }, >+ { >+ intrinsicName: "%Proxy%", >+ globalNameOrSource: "Proxy" >+ }, >+ { >+ intrinsicName: "%RangeError%", >+ globalNameOrSource: "RangeError" >+ }, >+ { >+ intrinsicName: "%RangeErrorPrototype%", >+ globalNameOrSource: "RangeError.prototype" >+ }, >+ { >+ intrinsicName: "%ReferenceError%", >+ globalNameOrSource: "ReferenceError" >+ }, >+ { >+ intrinsicName: "%ReferenceErrorPrototype%", >+ globalNameOrSource: "ReferenceError.prototype" >+ }, >+ { >+ intrinsicName: "%Reflect%", >+ globalNameOrSource: "Reflect" >+ }, >+ { >+ intrinsicName: "%RegExp%", >+ globalNameOrSource: "RegExp" >+ }, >+ { >+ intrinsicName: "%RegExpPrototype%", >+ globalNameOrSource: "RegExp.prototype" >+ }, >+ { >+ intrinsicName: "%Set%", >+ globalNameOrSource: "Set" >+ }, >+ { >+ intrinsicName: "%SetIteratorPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf(new Set()[Symbol.iterator]())" >+ }, >+ { >+ intrinsicName: "%SetPrototype%", >+ globalNameOrSource: "Set.prototype" >+ }, >+ { >+ intrinsicName: "%SharedArrayBuffer%", >+ globalNameOrSource: "SharedArrayBuffer" >+ }, >+ { >+ intrinsicName: "%SharedArrayBufferPrototype%", >+ globalNameOrSource: "SharedArrayBuffer.prototype" >+ }, >+ { >+ intrinsicName: "%String%", >+ globalNameOrSource: "String" >+ }, >+ { >+ intrinsicName: "%StringIteratorPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf(new String()[Symbol.iterator]())" >+ }, >+ { >+ intrinsicName: "%StringPrototype%", >+ globalNameOrSource: "String.prototype" >+ }, >+ { >+ intrinsicName: "%Symbol%", >+ globalNameOrSource: "Symbol" >+ }, >+ { >+ intrinsicName: "%SymbolPrototype%", >+ globalNameOrSource: "Symbol.prototype" >+ }, >+ { >+ intrinsicName: "%SyntaxError%", >+ globalNameOrSource: "SyntaxError" >+ }, >+ { >+ intrinsicName: "%SyntaxErrorPrototype%", >+ globalNameOrSource: "SyntaxError.prototype" >+ }, >+ { >+ intrinsicName: "%ThrowTypeError%", >+ globalNameOrSource: "(function() { 'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'callee').get })()" >+ }, >+ { >+ intrinsicName: "%TypedArray%", >+ globalNameOrSource: "Object.getPrototypeOf(Uint8Array)" >+ }, >+ { >+ intrinsicName: "%TypedArrayPrototype%", >+ globalNameOrSource: "Object.getPrototypeOf(Uint8Array).prototype" >+ }, >+ { >+ intrinsicName: "%TypeError%", >+ globalNameOrSource: "TypeError" >+ }, >+ { >+ intrinsicName: "%TypeErrorPrototype%", >+ globalNameOrSource: "TypeError.prototype" >+ }, >+ { >+ intrinsicName: "%Uint8Array%", >+ globalNameOrSource: "Uint8Array" >+ }, >+ { >+ intrinsicName: "%Uint8ArrayPrototype%", >+ globalNameOrSource: "Uint8Array.prototype" >+ }, >+ { >+ intrinsicName: "%Uint8ClampedArray%", >+ globalNameOrSource: "Uint8ClampedArray" >+ }, >+ { >+ intrinsicName: "%Uint8ClampedArrayPrototype%", >+ globalNameOrSource: "Uint8ClampedArray.prototype" >+ }, >+ { >+ intrinsicName: "%Uint16Array%", >+ globalNameOrSource: "Uint16Array" >+ }, >+ { >+ intrinsicName: "%Uint16ArrayPrototype%", >+ globalNameOrSource: "Uint16Array.prototype" >+ }, >+ { >+ intrinsicName: "%Uint32Array%", >+ globalNameOrSource: "Uint32Array" >+ }, >+ { >+ intrinsicName: "%Uint32ArrayPrototype%", >+ globalNameOrSource: "Uint32Array.prototype" >+ }, >+ { >+ intrinsicName: "%URIError%", >+ globalNameOrSource: "URIError" >+ }, >+ { >+ intrinsicName: "%URIErrorPrototype%", >+ globalNameOrSource: "URIError.prototype" >+ }, >+ { >+ intrinsicName: "%WeakMap%", >+ globalNameOrSource: "WeakMap" >+ }, >+ { >+ intrinsicName: "%WeakMapPrototype%", >+ globalNameOrSource: "WeakMap.prototype" >+ }, >+ { >+ intrinsicName: "%WeakSet%", >+ globalNameOrSource: "WeakSet" >+ }, >+ { >+ intrinsicName: "%WeakSetPrototype%", >+ globalNameOrSource: "WeakSet.prototype" >+ } >+]; >+ >+ >+WellKnownIntrinsicObjects.forEach(wkio => { >+ var actual; >+ >+ try { >+ actual = new Function("return " + wkio.globalNameOrSource)(); >+ } catch (exception) { >+ // Nothing to do here. >+ } >+ >+ wkio.reference = actual; >+}); >diff --git a/JSTests/test262/latest-changes-summary.txt b/JSTests/test262/latest-changes-summary.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..349b604210d2baf8c3c7a96cc298ce1ca9239693 >--- /dev/null >+++ b/JSTests/test262/latest-changes-summary.txt >@@ -0,0 +1,401 @@ >+A harness/compareIterator.js >+M harness/nativeFunctionMatcher.js >+M harness/regExpUtils.js >+M harness/testIntl.js >+M harness/testTypedArray.js >+A harness/wellKnownIntrinsicObjects.js >+A test/annexB/language/eval-code/direct/block-decl-nostrict.js >+A test/annexB/language/eval-code/direct/switch-case-decl-nostrict.js >+A test/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js >+A test/annexB/language/function-code/block-decl-nested-blocks-with-fun-decl.js >+A test/annexB/language/function-code/block-decl-nostrict.js >+A test/annexB/language/function-code/switch-case-decl-nostrict.js >+A test/annexB/language/function-code/switch-dflt-decl-nostrict.js >+A test/built-ins/Array/prototype/filter/target-array-with-non-writable-property.js >+A test/built-ins/Array/prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js >+A test/built-ins/Array/prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js >+A test/built-ins/Array/prototype/map/target-array-with-non-writable-property.js >+A test/built-ins/Array/prototype/slice/target-array-with-non-writable-property.js >+A test/built-ins/Array/prototype/splice/property-traps-order-with-species.js >+A test/built-ins/Array/prototype/splice/target-array-with-non-writable-property.js >+M test/built-ins/Atomics/Symbol.toStringTag.js >+M test/built-ins/Atomics/add/bad-range.js >+M test/built-ins/Atomics/add/good-views.js >+M test/built-ins/Atomics/add/non-views.js >+M test/built-ins/Atomics/add/nonshared-int-views.js >+M test/built-ins/Atomics/add/shared-nonint-views.js >+M test/built-ins/Atomics/and/bad-range.js >+M test/built-ins/Atomics/and/good-views.js >+M test/built-ins/Atomics/and/non-views.js >+M test/built-ins/Atomics/and/nonshared-int-views.js >+M test/built-ins/Atomics/and/shared-nonint-views.js >+M test/built-ins/Atomics/compareExchange/bad-range.js >+M test/built-ins/Atomics/compareExchange/good-views.js >+M test/built-ins/Atomics/compareExchange/non-views.js >+M test/built-ins/Atomics/compareExchange/nonshared-int-views.js >+M test/built-ins/Atomics/compareExchange/shared-nonint-views.js >+M test/built-ins/Atomics/exchange/bad-range.js >+M test/built-ins/Atomics/exchange/good-views.js >+M test/built-ins/Atomics/exchange/non-views.js >+M test/built-ins/Atomics/exchange/nonshared-int-views.js >+M test/built-ins/Atomics/exchange/shared-nonint-views.js >+M test/built-ins/Atomics/isLockFree/corner-cases.js >+M test/built-ins/Atomics/isLockFree/value.js >+M test/built-ins/Atomics/load/bad-range.js >+M test/built-ins/Atomics/load/good-views.js >+M test/built-ins/Atomics/load/non-views.js >+M test/built-ins/Atomics/load/nonshared-int-views.js >+M test/built-ins/Atomics/load/shared-nonint-views.js >+M test/built-ins/Atomics/or/bad-range.js >+M test/built-ins/Atomics/or/good-views.js >+M test/built-ins/Atomics/or/non-views.js >+M test/built-ins/Atomics/or/nonshared-int-views.js >+M test/built-ins/Atomics/or/shared-nonint-views.js >+M test/built-ins/Atomics/prop-desc.js >+M test/built-ins/Atomics/proto.js >+M test/built-ins/Atomics/store/bad-range.js >+M test/built-ins/Atomics/store/good-views.js >+M test/built-ins/Atomics/store/non-views.js >+M test/built-ins/Atomics/store/nonshared-int-views.js >+M test/built-ins/Atomics/store/shared-nonint-views.js >+M test/built-ins/Atomics/sub/bad-range.js >+M test/built-ins/Atomics/sub/good-views.js >+M test/built-ins/Atomics/sub/non-views.js >+M test/built-ins/Atomics/sub/nonshared-int-views.js >+M test/built-ins/Atomics/sub/shared-nonint-views.js >+A test/built-ins/Atomics/wait/bad-range.js >+M test/built-ins/Atomics/wait/cannot-suspend-throws.js >+M test/built-ins/Atomics/wait/did-timeout.js >+A test/built-ins/Atomics/wait/false-for-timeout-agent.js >+M test/built-ins/Atomics/wait/false-for-timeout.js >+M test/built-ins/Atomics/wait/good-views.js >+M test/built-ins/Atomics/wait/nan-for-timeout.js >+M test/built-ins/Atomics/wait/negative-index-throws.js >+A test/built-ins/Atomics/wait/negative-timeout-agent.js >+M test/built-ins/Atomics/wait/negative-timeout.js >+M test/built-ins/Atomics/wait/no-spurious-wakeup.js >+M test/built-ins/Atomics/wait/non-int32-typedarray-throws.js >+R069 test/built-ins/Atomics/wait/nonshared-bufferdata-throws.js test/built-ins/Atomics/wait/non-shared-bufferdata-throws.js >+M test/built-ins/Atomics/wait/not-a-typedarray-throws.js >+M test/built-ins/Atomics/wait/not-an-object-throws.js >+M test/built-ins/Atomics/wait/null-bufferdata-throws.js >+A test/built-ins/Atomics/wait/null-for-timeout-agent.js >+M test/built-ins/Atomics/wait/null-for-timeout.js >+A test/built-ins/Atomics/wait/object-for-timeout-agent.js >+M test/built-ins/Atomics/wait/object-for-timeout.js >+M test/built-ins/Atomics/wait/out-of-range-index-throws.js >+A test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js >+M test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js >+A test/built-ins/Atomics/wait/symbol-for-index-throws-agent.js >+M test/built-ins/Atomics/wait/symbol-for-index-throws.js >+A test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js >+M test/built-ins/Atomics/wait/symbol-for-timeout-throws.js >+A test/built-ins/Atomics/wait/symbol-for-value-throws-agent.js >+A test/built-ins/Atomics/wait/symbol-for-value-throws.js >+A test/built-ins/Atomics/wait/true-for-timeout-agent.js >+M test/built-ins/Atomics/wait/true-for-timeout.js >+M test/built-ins/Atomics/wait/undefined-for-timeout.js >+M test/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js >+A test/built-ins/Atomics/wait/value-not-equal.js >+M test/built-ins/Atomics/wait/wait-index-value-not-equal.js >+A test/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js >+A test/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js >+M test/built-ins/Atomics/wait/was-woken-before-timeout.js >+M test/built-ins/Atomics/wait/was-woken.js >+M test/built-ins/Atomics/wake/bad-range.js >+R051 test/built-ins/Atomics/wake/counts.js test/built-ins/Atomics/wake/count-boundary-cases.js >+A test/built-ins/Atomics/wake/count-defaults-to-infinity-missing.js >+A test/built-ins/Atomics/wake/count-defaults-to-infinity-undefined.js >+A test/built-ins/Atomics/wake/count-from-nans.js >+A test/built-ins/Atomics/wake/count-symbol-throws.js >+A test/built-ins/Atomics/wake/count-tointeger-throws-then-wake-throws.js >+M test/built-ins/Atomics/wake/good-views.js >+R094 test/built-ins/Atomics/wake/wake-negative.js test/built-ins/Atomics/wake/negative-count.js >+A test/built-ins/Atomics/wake/negative-index-throws.js >+A test/built-ins/Atomics/wake/non-int32-typedarray-throws.js >+A test/built-ins/Atomics/wake/non-shared-bufferdata-throws.js >+M test/built-ins/Atomics/wake/non-views.js >+M test/built-ins/Atomics/wake/nonshared-int-views.js >+A test/built-ins/Atomics/wake/not-a-typedarray-throws.js >+A test/built-ins/Atomics/wake/not-an-object-throws.js >+A test/built-ins/Atomics/wake/null-bufferdata-throws.js >+A test/built-ins/Atomics/wake/out-of-range-index-throws.js >+M test/built-ins/Atomics/wake/shared-nonint-views.js >+A test/built-ins/Atomics/wake/symbol-for-index-throws.js >+A test/built-ins/Atomics/wake/undefined-index-defaults-to-zero.js >+M test/built-ins/Atomics/wake/wake-all-on-loc.js >+M test/built-ins/Atomics/wake/wake-all.js >+M test/built-ins/Atomics/wake/wake-in-order.js >+M test/built-ins/Atomics/wake/wake-nan.js >+M test/built-ins/Atomics/wake/wake-one.js >+A test/built-ins/Atomics/wake/wake-rewake-noop.js >+M test/built-ins/Atomics/wake/wake-two.js >+A test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js >+A test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js >+M test/built-ins/Atomics/wake/wake-zero.js >+M test/built-ins/Atomics/xor/bad-range.js >+M test/built-ins/Atomics/xor/good-views.js >+M test/built-ins/Atomics/xor/non-views.js >+M test/built-ins/Atomics/xor/nonshared-int-views.js >+M test/built-ins/Atomics/xor/shared-nonint-views.js >+M test/built-ins/BigInt/asIntN/bigint-tobigint-errors.js >+M test/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js >+M test/built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js >+M test/built-ins/BigInt/asIntN/bits-toindex-errors.js >+M test/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js >+M test/built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js >+M test/built-ins/BigInt/asUintN/bigint-tobigint-errors.js >+M test/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js >+M test/built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js >+M test/built-ins/BigInt/asUintN/bits-toindex-errors.js >+M test/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js >+M test/built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js >+M test/built-ins/BigInt/constructor-empty-string.js >+M test/built-ins/BigInt/constructor-from-binary-string.js >+M test/built-ins/BigInt/constructor-from-decimal-string.js >+M test/built-ins/BigInt/constructor-from-hex-string.js >+M test/built-ins/BigInt/constructor-from-octal-string.js >+M test/built-ins/BigInt/constructor-from-string-syntax-errors.js >+A test/built-ins/BigInt/constructor-integer.js >+M test/built-ins/BigInt/constructor-trailing-leading-spaces.js >+D test/built-ins/BigInt/issafeinteger-true.js >+D test/built-ins/BigInt/out-of-bounds-integer-rangeerror.js >+M test/built-ins/BigInt/prototype/Symbol.toStringTag.js >+A test/built-ins/BigInt/prototype/toString/default-radix.js >+M test/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js >+A test/built-ins/BigInt/prototype/valueOf/cross-realm.js >+R072 test/built-ins/BigInt/value-of-throws.js test/built-ins/BigInt/tostring-throws.js >+A test/built-ins/BigInt/valueof-throws.js >+M test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js >+A test/built-ins/Function/prototype/bind/length-exceeds-int32.js >+D test/built-ins/Function/prototype/toString/anonymous-intrinsics.js >+M test/built-ins/Function/prototype/toString/bound-function.js >+A test/built-ins/Function/prototype/toString/built-in-function-object.js >+D test/built-ins/Function/prototype/toString/intrinsics.js >+A test/built-ins/Function/prototype/toString/proxy-arrow-function.js >+A test/built-ins/Function/prototype/toString/proxy-async-function.js >+A test/built-ins/Function/prototype/toString/proxy-async-generator-function.js >+A test/built-ins/Function/prototype/toString/proxy-async-generator-method-definition.js >+A test/built-ins/Function/prototype/toString/proxy-async-method-definition.js >+A test/built-ins/Function/prototype/toString/proxy-bound-function.js >+A test/built-ins/Function/prototype/toString/proxy-class.js >+A test/built-ins/Function/prototype/toString/proxy-function-expression.js >+A test/built-ins/Function/prototype/toString/proxy-generator-function.js >+A test/built-ins/Function/prototype/toString/proxy-method-definition.js >+A test/built-ins/Function/prototype/toString/proxy-non-callable-throws.js >+D test/built-ins/Function/prototype/toString/proxy.js >+A test/built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js >+A test/built-ins/JSON/prop-desc.js >+M test/built-ins/Math/acosh/nan-returns.js >+M test/built-ins/Math/asinh/asinh-specialVals.js >+M test/built-ins/Math/atanh/atanh-specialVals.js >+M test/built-ins/Math/cbrt/cbrt-specialValues.js >+M test/built-ins/Math/cbrt/prop-desc.js >+M test/built-ins/Math/cosh/cosh-specialVals.js >+M test/built-ins/Math/expm1/expm1-specialVals.js >+M test/built-ins/Math/log10/Log10-specialVals.js >+M test/built-ins/Math/log2/log2-basicTests.js >+M test/built-ins/Math/prop-desc.js >+M test/built-ins/Math/sign/sign-specialVals.js >+M test/built-ins/Math/sinh/sinh-specialVals.js >+M test/built-ins/Math/tanh/tanh-specialVals.js >+M test/built-ins/Math/trunc/trunc-sampleTests.js >+M test/built-ins/Math/trunc/trunc-specialVals.js >+A test/built-ins/Object/assign/strings-and-symbol-order.js >+A test/built-ins/Object/keys/property-traps-order-with-proxied-array.js >+D test/built-ins/Reflect/Reflect.js >+A test/built-ins/Reflect/prop-desc.js >+D test/built-ins/Reflect/properties.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/internal-regexp-lastindex-not-zero.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-is-false.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/length.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/name.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js >+A test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js >+A test/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js >+A test/built-ins/RegExpStringIteratorPrototype/ancestry.js >+A test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js >+A test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js >+A test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js >+A test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js >+A test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js >+A test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js >+A test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js >+A test/built-ins/RegExpStringIteratorPrototype/next/length.js >+A test/built-ins/RegExpStringIteratorPrototype/next/name.js >+A test/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js >+A test/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js >+A test/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js >+A test/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js >+A test/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js >+A test/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js >+A test/built-ins/String/prototype/matchAll/length.js >+A test/built-ins/String/prototype/matchAll/name.js >+A test/built-ins/String/prototype/matchAll/prop-desc.js >+A test/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js >+A test/built-ins/String/prototype/matchAll/regexp-is-null.js >+A test/built-ins/String/prototype/matchAll/regexp-is-undefined.js >+A test/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js >+A test/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js >+A test/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js >+A test/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js >+A test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js >+A test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js >+A test/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js >+A test/built-ins/Symbol/matchAll/cross-realm.js >+A test/built-ins/Symbol/matchAll/prop-desc.js >+M test/harness/testTypedArray.js >+A test/intl402/Array/prototype/toLocaleString/calls-toLocaleString-number-elements.js >+M test/intl402/Intl/getCanonicalLocales/invalid-tags.js >+A test/intl402/Locale/constructor-newtarget-undefined.js >+A test/intl402/Locale/constructor-options-calendar-invalid.js >+A test/intl402/Locale/constructor-options-calendar-valid.js >+A test/intl402/Locale/constructor-options-language-invalid.js >+A test/intl402/Locale/constructor-options-language-valid.js >+A test/intl402/Locale/constructor-options-region-invalid.js >+A test/intl402/Locale/constructor-options-region-valid.js >+A test/intl402/Locale/constructor-options-script-invalid.js >+A test/intl402/Locale/constructor-options-script-valid.js >+A test/intl402/Locale/function-prototype.js >+A test/intl402/Locale/instance-extensibility.js >+A test/intl402/Locale/instance.js >+A test/intl402/Locale/invalid-tag-throws-boolean.js >+A test/intl402/Locale/invalid-tag-throws-null.js >+A test/intl402/Locale/invalid-tag-throws-number.js >+A test/intl402/Locale/invalid-tag-throws-symbol.js >+A test/intl402/Locale/invalid-tag-throws-undefined.js >+A test/intl402/Locale/invalid-tag-throws.js >+A test/intl402/Locale/length.js >+A test/intl402/Locale/name.js >+A test/intl402/Locale/prop-desc.js >+A test/intl402/Locale/prototype/constructor.js >+A test/intl402/Locale/prototype/maximize/length.js >+A test/intl402/Locale/prototype/maximize/name.js >+A test/intl402/Locale/prototype/maximize/prop-desc.js >+A test/intl402/Locale/prototype/prop-desc.js >+A test/intl402/Locale/prototype/toStringTag.js >+A test/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js >+M test/language/asi/S7.9_A11_T8.js >+M test/language/asi/S7.9_A4.js >+M test/language/asi/S7.9_A5.1_T1.js >+M test/language/asi/S7.9_A5.3_T1.js >+A test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js >+M test/language/destructuring/binding/initialization-requires-object-coercible-null.js >+M test/language/destructuring/binding/initialization-requires-object-coercible-undefined.js >+M test/language/destructuring/binding/initialization-returns-normal-completion-for-empty-objects.js >+M test/language/destructuring/binding/syntax/array-elements-with-initializer.js >+M test/language/destructuring/binding/syntax/array-elements-with-object-patterns.js >+M test/language/destructuring/binding/syntax/array-elements-without-initializer.js >+M test/language/destructuring/binding/syntax/array-pattern-with-elisions.js >+M test/language/destructuring/binding/syntax/array-pattern-with-no-elements.js >+M test/language/destructuring/binding/syntax/array-rest-elements.js >+M test/language/destructuring/binding/syntax/object-pattern-with-no-property-list.js >+M test/language/destructuring/binding/syntax/property-list-bindings-elements.js >+M test/language/destructuring/binding/syntax/property-list-followed-by-a-single-comma.js >+M test/language/destructuring/binding/syntax/property-list-single-name-bindings.js >+M test/language/destructuring/binding/syntax/property-list-with-property-list.js >+M test/language/destructuring/binding/syntax/recursive-array-and-object-patterns.js >+R065 test/language/eval-code/direct/block-decl-strict-source.js test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js >+A test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js >+R068 test/language/eval-code/direct/block-decl-strict-caller.js test/language/eval-code/direct/block-decl-onlystrict.js >+R066 test/language/eval-code/direct/switch-case-decl-strict-source.js test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js >+A test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js >+R068 test/language/eval-code/direct/switch-case-decl-strict-caller.js test/language/eval-code/direct/switch-case-decl-onlystrict.js >+R066 test/language/eval-code/direct/switch-dflt-decl-strict-source.js test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js >+A test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js >+R068 test/language/eval-code/direct/switch-dflt-decl-strict-caller.js test/language/eval-code/direct/switch-dflt-decl-onlystrict.js >+A test/language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js >+A test/language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js >+A test/language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js >+A test/language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js >+A test/language/expressions/async-arrow-function/escaped-async-line-terminator.js >+A test/language/expressions/async-generator/generator-created-after-decl-inst.js >+A test/language/expressions/class/class-name-ident-await-escaped-module.js >+A test/language/expressions/class/class-name-ident-await-escaped.js >+A test/language/expressions/class/class-name-ident-await-module.js >+A test/language/expressions/class/class-name-ident-await.js >+A test/language/expressions/class/class-name-ident-let-escaped.js >+A test/language/expressions/class/class-name-ident-let.js >+A test/language/expressions/class/class-name-ident-static-escaped.js >+A test/language/expressions/class/class-name-ident-static.js >+A test/language/expressions/class/class-name-ident-yield-escaped.js >+A test/language/expressions/class/class-name-ident-yield.js >+A test/language/expressions/class/constructor-this-tdz-during-initializers.js >+A test/language/expressions/class/fields-run-once-on-double-super.js >+A test/language/expressions/generators/generator-created-after-decl-inst.js >+A test/language/expressions/greater-than/bigint-and-boolean.js >+A test/language/expressions/greater-than/bigint-and-incomparable-string.js >+A test/language/expressions/greater-than/bigint-and-string.js >+A test/language/expressions/greater-than/bigint-and-symbol.js >+A test/language/expressions/greater-than-or-equal/bigint-and-incomparable-string.js >+A test/language/expressions/greater-than-or-equal/bigint-and-string.js >+A test/language/expressions/less-than/bigint-and-boolean.js >+A test/language/expressions/less-than/bigint-and-incomparable-string.js >+A test/language/expressions/less-than/bigint-and-string.js >+A test/language/expressions/less-than/bigint-and-symbol.js >+A test/language/expressions/less-than-or-equal/bigint-and-incomparable-string.js >+A test/language/expressions/less-than-or-equal/bigint-and-string.js >+M test/language/expressions/object/method-definition/generator-super-prop-param.js >+R074 test/language/function-code/block-decl-strict.js test/language/function-code/block-decl-onlystrict.js >+R073 test/language/function-code/switch-case-decl-strict.js test/language/function-code/switch-case-decl-onlystrict.js >+R073 test/language/function-code/switch-dflt-decl-strict.js test/language/function-code/switch-dflt-decl-onlystrict.js >+D test/language/line-terminators/S7.3_A2.3.js >+D test/language/line-terminators/S7.3_A2.4.js >+A test/language/literals/regexp/invalid-optional-lookbehind.js >+A test/language/literals/regexp/invalid-optional-negative-lookbehind.js >+A test/language/literals/regexp/invalid-range-lookbehind.js >+A test/language/literals/regexp/invalid-range-negative-lookbehind.js >+R100 test/language/literals/regexp/u-invalid-quantifiable-assertion.js test/language/literals/regexp/u-invalid-optional-lookahead.js >+A test/language/literals/regexp/u-invalid-optional-lookbehind.js >+A test/language/literals/regexp/u-invalid-optional-negative-lookahead.js >+A test/language/literals/regexp/u-invalid-optional-negative-lookbehind.js >+A test/language/literals/regexp/u-invalid-range-lookahead.js >+A test/language/literals/regexp/u-invalid-range-lookbehind.js >+A test/language/literals/regexp/u-invalid-range-negative-lookahead.js >+A test/language/literals/regexp/u-invalid-range-negative-lookbehind.js >+A test/language/literals/string/line-separator-eval.js >+A test/language/literals/string/line-separator.js >+A test/language/literals/string/paragraph-separator-eval.js >+A test/language/literals/string/paragraph-separator.js >+M test/language/module-code/early-strict-mode.js >+A test/language/statements/async-generator/generator-created-after-decl-inst.js >+M test/language/statements/break/S12.8_A8_T1.js >+M test/language/statements/break/S12.8_A8_T2.js >+A test/language/statements/class/class-name-ident-await-escaped-module.js >+A test/language/statements/class/class-name-ident-await-escaped.js >+A test/language/statements/class/class-name-ident-await-module.js >+A test/language/statements/class/class-name-ident-await.js >+A test/language/statements/class/class-name-ident-let-escaped.js >+A test/language/statements/class/class-name-ident-let.js >+A test/language/statements/class/class-name-ident-static-escaped.js >+A test/language/statements/class/class-name-ident-static.js >+A test/language/statements/class/class-name-ident-yield-escaped.js >+A test/language/statements/class/class-name-ident-yield.js >+M test/language/statements/continue/S12.7_A8_T1.js >+M test/language/statements/continue/S12.7_A8_T2.js >+A test/language/statements/generators/generator-created-after-decl-inst.js >+M test/language/statements/try/early-catch-duplicates.js >+A test/language/statements/try/early-catch-function.js >+M test/language/statements/try/early-catch-lex.js >+M test/language/statements/try/early-catch-var.js >\ No newline at end of file >diff --git a/JSTests/test262/test/annexB/language/eval-code/direct/block-decl-nostrict.js b/JSTests/test262/test/annexB/language/eval-code/direct/block-decl-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..97e159c1191f7d3f0ab3a2f62b7fc2a43bb75488 >--- /dev/null >+++ b/JSTests/test262/test/annexB/language/eval-code/direct/block-decl-nostrict.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Block statement >+ in eval code containing a function declaration >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err; >+ >+eval('{ function f() {} }'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err, undefined); >diff --git a/JSTests/test262/test/annexB/language/eval-code/direct/switch-case-decl-nostrict.js b/JSTests/test262/test/annexB/language/eval-code/direct/switch-case-decl-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..808debf6077e41fea4fb2234a119e0a83ebbc77d >--- /dev/null >+++ b/JSTests/test262/test/annexB/language/eval-code/direct/switch-case-decl-nostrict.js >@@ -0,0 +1,32 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `case` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ switch (1) {\ >+ case 1:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err, undefined); >diff --git a/JSTests/test262/test/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js b/JSTests/test262/test/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..623e518457c19480f5af81b9ac00dc3609ac26bc >--- /dev/null >+++ b/JSTests/test262/test/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js >@@ -0,0 +1,32 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `default` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ switch (1) {\ >+ default:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err, undefined); >diff --git a/JSTests/test262/test/annexB/language/function-code/block-decl-nested-blocks-with-fun-decl.js b/JSTests/test262/test/annexB/language/function-code/block-decl-nested-blocks-with-fun-decl.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d3fc1274ba5ff8b14558cf0da706c88b5110a688 >--- /dev/null >+++ b/JSTests/test262/test/annexB/language/function-code/block-decl-nested-blocks-with-fun-decl.js >@@ -0,0 +1,40 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-web-compat-functiondeclarationinstantiation >+description: > >+ Nested function declarations, the second declaration is not Annex-B applicable. >+info: | >+ B.3.3.1 Changes to FunctionDeclarationInstantiation >+ >+ 1. If strict is false, then >+ a. For each FunctionDeclaration f that is directly contained in the >+ StatementList of a Block, CaseClause, or DefaultClause, do >+ i. Let F be StringValue of the BindingIdentifier of FunctionDeclaration f. >+ ii. If replacing the FunctionDeclaration f with a VariableStatement that >+ has F as a BindingIdentifier would not produce any Early Errors for >+ func and F is not an element of parameterNames, then >+ ... >+flags: [noStrict] >+---*/ >+ >+function g() { >+ // Create an outer block-statement. >+ { >+ // A lexically declared function declaration. >+ // This function is applicable for Annex-B semantics. >+ function f() { return 1; } >+ >+ // An inner block-statement with another function declaration. >+ // This function is not applicable for Annex-B semantics, because >+ // replacing it with |var f| would result in a SyntaxError. >+ { >+ function f() { return 2; } >+ } >+ } >+ >+ assert.sameValue(f(), 1); >+} >+ >+g(); >diff --git a/JSTests/test262/test/annexB/language/function-code/block-decl-nostrict.js b/JSTests/test262/test/annexB/language/function-code/block-decl-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..9ac8aad8239c82cc716b85f4f77cec01513c7130 >--- /dev/null >+++ b/JSTests/test262/test/annexB/language/function-code/block-decl-nostrict.js >@@ -0,0 +1,38 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-functiondeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Block statement >+ in function code containing a function declaration >+info: | >+ B.3.3.1 Changes to FunctionDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err1, err2; >+ >+(function() { >+ try { >+ f; >+ } catch (exception) { >+ err1 = exception; >+ } >+ >+ { >+ function f() { } >+ } >+ >+ try { >+ f; >+ } catch (exception) { >+ err2 = exception; >+ } >+}()); >+ >+assert.sameValue(err1, undefined); >+assert.sameValue(err2, undefined); >diff --git a/JSTests/test262/test/annexB/language/function-code/switch-case-decl-nostrict.js b/JSTests/test262/test/annexB/language/function-code/switch-case-decl-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6be9587e095017bcb85c0fc4eec949c51371a2c3 >--- /dev/null >+++ b/JSTests/test262/test/annexB/language/function-code/switch-case-decl-nostrict.js >@@ -0,0 +1,39 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-functiondeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `case` clause of a `switch` statement in function code >+info: | >+ B.3.3.1 Changes to FunctionDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err1, err2; >+ >+(function() { >+ try { >+ f; >+ } catch (exception) { >+ err1 = exception; >+ } >+ >+ switch (1) { >+ case 1: >+ function f() { } >+ } >+ >+ try { >+ f; >+ } catch (exception) { >+ err2 = exception; >+ } >+}()); >+ >+assert.sameValue(err1, undefined); >+assert.sameValue(err2, undefined); >diff --git a/JSTests/test262/test/annexB/language/function-code/switch-dflt-decl-nostrict.js b/JSTests/test262/test/annexB/language/function-code/switch-dflt-decl-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..9b66c97a8f89ff7d2e439fadfbda5e68bd7e876b >--- /dev/null >+++ b/JSTests/test262/test/annexB/language/function-code/switch-dflt-decl-nostrict.js >@@ -0,0 +1,39 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-functiondeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `default` clause of a `switch` statement in function code >+info: | >+ B.3.3.1 Changes to FunctionDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err1, err2; >+ >+(function() { >+ try { >+ f; >+ } catch (exception) { >+ err1 = exception; >+ } >+ >+ switch (1) { >+ default: >+ function f() { } >+ } >+ >+ try { >+ f; >+ } catch (exception) { >+ err2 = exception; >+ } >+}()); >+ >+assert.sameValue(err1, undefined); >+assert.sameValue(err2, undefined); >diff --git a/JSTests/test262/test/built-ins/Array/prototype/filter/target-array-with-non-writable-property.js b/JSTests/test262/test/built-ins/Array/prototype/filter/target-array-with-non-writable-property.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0197c1d9accf1d4b0784f870ac86212baed9bf91 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Array/prototype/filter/target-array-with-non-writable-property.js >@@ -0,0 +1,37 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-array.prototype.filter >+description: > >+ Non-writable properties are overwritten by CreateDataPropertyOrThrow. >+info: | >+ 22.1.3.7 Array.prototype.filter ( callbackfn [ , thisArg ] ) >+ >+ ... >+ 8. Repeat, while k < len >+ ... >+ c. If kPresent is true, then >+ ... >+ iii. If selected is true, then >+ 1. Perform ? CreateDataPropertyOrThrow(A, ! ToString(to), kValue). >+ ... >+features: [Symbol.species] >+includes: [propertyHelper.js] >+---*/ >+ >+var a = [1]; >+a.constructor = {}; >+a.constructor[Symbol.species] = function(len) { >+ var q = new Array(0); >+ Object.defineProperty(q, 0, { >+ value: 0, writable: false, configurable: true, enumerable: false, >+ }); >+ return q; >+}; >+ >+var r = a.filter(function(){ return true; }); >+ >+verifyProperty(r, 0, { >+ value: 1, writable: true, configurable: true, enumerable: true, >+}); >diff --git a/JSTests/test262/test/built-ins/Array/prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js b/JSTests/test262/test/built-ins/Array/prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js >new file mode 100644 >index 0000000000000000000000000000000000000000..436f32bf06bb1eaddf85c8dba407ac15119f6573 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Array/prototype/indexOf/calls-only-has-on-prototype-after-length-zeroed.js >@@ -0,0 +1,43 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-array.prototype.indexof >+description: > >+ Calls [[HasProperty]] on the prototype to check for existing elements. >+info: | >+ 22.1.3.12 Array.prototype.indexOf ( searchElement [ , fromIndex ] ) >+ >+ ... >+ 2. Let len be ? ToLength(? Get(O, "length")). >+ ... >+ 4. Let n be ? ToInteger(fromIndex). (If fromIndex is undefined, this step produces the value 0.) >+ ... >+ 8. Repeat, while k < len >+ a. Let kPresent be ? HasProperty(O, ! ToString(k)). >+ b. If kPresent is true, then >+ i. Let elementK be ? Get(O, ! ToString(k)). >+ ... >+includes: [proxyTrapsHelper.js] >+features: [Proxy] >+---*/ >+ >+var array = [1, null, 3]; >+ >+Object.setPrototypeOf(array, new Proxy(Array.prototype, allowProxyTraps({ >+ has: function(t, pk) { >+ return pk in t; >+ } >+}))); >+ >+var fromIndex = { >+ valueOf: function() { >+ // Zero the array's length. The loop in step 8 iterates over the original >+ // length value of 100, but the only prototype MOP method which should be >+ // called is [[HasProperty]]. >+ array.length = 0; >+ return 0; >+ } >+}; >+ >+Array.prototype.indexOf.call(array, 100, fromIndex); >diff --git a/JSTests/test262/test/built-ins/Array/prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js b/JSTests/test262/test/built-ins/Array/prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c9101a4e20e5e9f26594a4c6b9c037bdc2665ff5 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Array/prototype/lastIndexOf/calls-only-has-on-prototype-after-length-zeroed.js >@@ -0,0 +1,43 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-array.prototype.lastindexof >+description: > >+ Calls [[HasProperty]] on the prototype to check for existing elements. >+info: | >+ 22.1.3.15 Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] ) >+ >+ ... >+ 2. Let len be ? ToLength(? Get(O, "length")). >+ ... >+ 4. If fromIndex is present, let n be ? ToInteger(fromIndex); else let n be len-1. >+ ... >+ 7. Repeat, while k ⥠0 >+ a. Let kPresent be ? HasProperty(O, ! ToString(k)). >+ b. If kPresent is true, then >+ i. Let elementK be ? Get(O, ! ToString(k)). >+ ... >+includes: [proxyTrapsHelper.js] >+features: [Proxy] >+---*/ >+ >+var array = [5, undefined, 7]; >+ >+Object.setPrototypeOf(array, new Proxy(Array.prototype, allowProxyTraps({ >+ has: function(t, pk) { >+ return pk in t; >+ } >+}))); >+ >+var fromIndex = { >+ valueOf: function() { >+ // Zero the array's length. The loop in step 8 iterates over the original >+ // length value of 100, but the only prototype MOP method which should be >+ // called is [[HasProperty]]. >+ array.length = 0; >+ return 2; >+ } >+}; >+ >+Array.prototype.lastIndexOf.call(array, 100, fromIndex); >diff --git a/JSTests/test262/test/built-ins/Array/prototype/map/target-array-with-non-writable-property.js b/JSTests/test262/test/built-ins/Array/prototype/map/target-array-with-non-writable-property.js >new file mode 100644 >index 0000000000000000000000000000000000000000..842388af494f2f1d8d25794535d3fbdc6577147e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Array/prototype/map/target-array-with-non-writable-property.js >@@ -0,0 +1,36 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-array.prototype.map >+description: > >+ Non-writable properties are overwritten by CreateDataPropertyOrThrow. >+info: | >+ 22.1.3.16 Array.prototype.map ( callbackfn [ , thisArg ] ) >+ >+ ... >+ 7. Repeat, while k < len >+ ... >+ c. If kPresent is true, then >+ ... >+ iii. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue). >+ ... >+features: [Symbol.species] >+includes: [propertyHelper.js] >+---*/ >+ >+var a = [1]; >+a.constructor = {}; >+a.constructor[Symbol.species] = function(len) { >+ var q = new Array(0); >+ Object.defineProperty(q, 0, { >+ value: 0, writable: false, configurable: true, enumerable: false, >+ }); >+ return q; >+}; >+ >+var r = a.map(function(){ return 2; }); >+ >+verifyProperty(r, 0, { >+ value: 2, writable: true, configurable: true, enumerable: true, >+}); >diff --git a/JSTests/test262/test/built-ins/Array/prototype/slice/target-array-with-non-writable-property.js b/JSTests/test262/test/built-ins/Array/prototype/slice/target-array-with-non-writable-property.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ec7d1f05f7d40e957752a38662384b316f99e45e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Array/prototype/slice/target-array-with-non-writable-property.js >@@ -0,0 +1,36 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-array.prototype.slice >+description: > >+ Non-writable properties are overwritten by CreateDataPropertyOrThrow. >+info: | >+ 22.1.3.23 Array.prototype.slice ( start, end ) >+ >+ ... >+ 10. Repeat, while k < final >+ ... >+ c. If kPresent is true, then >+ ... >+ ii. Perform ? CreateDataPropertyOrThrow(A, ! ToString(n), kValue). >+ ... >+features: [Symbol.species] >+includes: [propertyHelper.js] >+---*/ >+ >+var a = [1]; >+a.constructor = {}; >+a.constructor[Symbol.species] = function(len) { >+ var q = new Array(0); >+ Object.defineProperty(q, 0, { >+ value: 0, writable: false, configurable: true, enumerable: false, >+ }); >+ return q; >+}; >+ >+var r = a.slice(0); >+ >+verifyProperty(r, 0, { >+ value: 1, writable: true, configurable: true, enumerable: true, >+}); >diff --git a/JSTests/test262/test/built-ins/Array/prototype/splice/property-traps-order-with-species.js b/JSTests/test262/test/built-ins/Array/prototype/splice/property-traps-order-with-species.js >new file mode 100644 >index 0000000000000000000000000000000000000000..4c8211b56df3f7d4ef88e71c87f4ffcea6993f6e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Array/prototype/splice/property-traps-order-with-species.js >@@ -0,0 +1,38 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-array.prototype.splice >+description: > >+ Ensure the correct property traps are called on the new array. >+features: [Proxy, Symbol.species] >+includes: [compareArray.js] >+---*/ >+ >+var log = []; >+ >+var a = [0, 1]; >+a.constructor = {}; >+ >+a.constructor[Symbol.species] = function(len) { >+ return new Proxy(new Array(len), new Proxy({}, { >+ get(t, pk, r) { >+ log.push(pk); >+ } >+ })); >+}; >+ >+var r = a.splice(0); >+ >+assert.compareArray([ >+ // Step 11.c.ii: CreateDataPropertyOrThrow(A, ! ToString(k), fromValue). >+ "defineProperty", >+ >+ // Step 11.c.ii: CreateDataPropertyOrThrow(A, ! ToString(k), fromValue). >+ "defineProperty", >+ >+ // Step 12: Perform ? Set(A, "length", actualDeleteCount, true). >+ "set", >+ "getOwnPropertyDescriptor", >+ "defineProperty", >+], log); >diff --git a/JSTests/test262/test/built-ins/Array/prototype/splice/target-array-with-non-writable-property.js b/JSTests/test262/test/built-ins/Array/prototype/splice/target-array-with-non-writable-property.js >new file mode 100644 >index 0000000000000000000000000000000000000000..dfb03318a2aab978fece918dfdd5dab342372747 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Array/prototype/splice/target-array-with-non-writable-property.js >@@ -0,0 +1,36 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-array.prototype.splice >+description: > >+ Non-writable properties are overwritten by CreateDataPropertyOrThrow. >+info: | >+ 22.1.3.26 Array.prototype.splice ( start, deleteCount, ...items ) >+ >+ ... >+ 11. Repeat, while k < actualDeleteCount >+ ... >+ c. If fromPresent is true, then >+ ... >+ ii. Perform ? CreateDataPropertyOrThrow(A, ! ToString(k), fromValue). >+ ... >+features: [Symbol.species] >+includes: [propertyHelper.js] >+---*/ >+ >+var a = [1]; >+a.constructor = {}; >+a.constructor[Symbol.species] = function(len) { >+ var q = new Array(0); >+ Object.defineProperty(q, 0, { >+ value: 0, writable: false, configurable: true, enumerable: false, >+ }); >+ return q; >+}; >+ >+var r = a.splice(0); >+ >+verifyProperty(r, 0, { >+ value: 1, writable: true, configurable: true, enumerable: true, >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/Symbol.toStringTag.js b/JSTests/test262/test/built-ins/Atomics/Symbol.toStringTag.js >index d3d1ba2d7df5c5333da33b944bb95b1a6e7f8533..83d8c5695cfc741583f018e00eddee82dc1cfe0a 100644 >--- a/JSTests/test262/test/built-ins/Atomics/Symbol.toStringTag.js >+++ b/JSTests/test262/test/built-ins/Atomics/Symbol.toStringTag.js >@@ -11,7 +11,7 @@ info: | > This property has the attributes { [[Writable]]: false, [[Enumerable]]: > false, [[Configurable]]: true }. > includes: [propertyHelper.js] >-features: [Atomics, Symbol.toStringTag] >+features: [Atomics, Symbol, Symbol.toStringTag] > ---*/ > > assert.sameValue(Atomics[Symbol.toStringTag], 'Atomics'); >diff --git a/JSTests/test262/test/built-ins/Atomics/add/bad-range.js b/JSTests/test262/test/built-ins/Atomics/add/bad-range.js >index b7aa9cd5abb1d1452ca555a17aadf40b902b0d3e..59efe923db42249910ea573ea691ee08d2b0bf38 100644 >--- a/JSTests/test262/test/built-ins/Atomics/add/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/add/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.add > description: > > Test range checking of Atomics.add on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.add(view, Idx, 10)); >+ assert.throws(RangeError, () => Atomics.add(view, IdxGen(view), 10)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/add/good-views.js b/JSTests/test262/test/built-ins/Atomics/add/good-views.js >index ff1805808e1ffd9e815108e1c5362fb8c83b11e6..64235a5be82f88f59612cee262b27d4f18502e5a 100644 >--- a/JSTests/test262/test/built-ins/Atomics/add/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/add/good-views.js >@@ -5,19 +5,18 @@ > esid: sec-atomics.add > description: Test Atomics.add on arrays that allow atomic operations. > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >- >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > // Add positive number > view[8] = 0; >@@ -52,4 +51,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.add(view, Idx, 0), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/add/non-views.js b/JSTests/test262/test/built-ins/Atomics/add/non-views.js >index e0923889a494a135105f9aeff3945d4a4f4cca34..f0eecdafb2eadc962677fc4acb00edbf79bee240 100644 >--- a/JSTests/test262/test/built-ins/Atomics/add/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/add/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.add > description: > > Test Atomics.add on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/add/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/add/nonshared-int-views.js >index e1a44542a8fe2f1a0093a7643cccb283387ceadb..92b75d32e381973aa30e485d06fc2fd14c810a16 100644 >--- a/JSTests/test262/test/built-ins/Atomics/add/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/add/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.add > description: > > Test Atomics.add on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > > var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.add(view, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.add(new TA(ab), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/add/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/add/shared-nonint-views.js >index ca2ad7bfa2ae41c1c32094af029115d2e405b15e..b8eb2ce0bf1588fa29b72d9f2a8141f7b7a43b6c 100644 >--- a/JSTests/test262/test/built-ins/Atomics/add/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/add/shared-nonint-views.js >@@ -6,15 +6,11 @@ esid: sec-atomics.add > description: > > Test Atomics.add on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; >- >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); >- >- assert.throws(TypeError, (() => Atomics.add(view, 0, 0))); >-}, other_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.add(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); >diff --git a/JSTests/test262/test/built-ins/Atomics/and/bad-range.js b/JSTests/test262/test/built-ins/Atomics/and/bad-range.js >index 1451092a2d8155ae7b3bab108cc4bed5c891c2e5..19fc35235b7343b1debad26414835ff7a4d5d2e8 100644 >--- a/JSTests/test262/test/built-ins/Atomics/and/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/and/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.and > description: > > Test range checking of Atomics.and on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.and(view, Idx, 10)); >+ assert.throws(RangeError, () => Atomics.and(view, IdxGen(view), 10)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/and/good-views.js b/JSTests/test262/test/built-ins/Atomics/and/good-views.js >index e8435ff2e750c8916d6a018645ae6946ba1049fc..e69420d530b973ffb272e8cfb25dfb4d462fa1de 100644 >--- a/JSTests/test262/test/built-ins/Atomics/and/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/and/good-views.js >@@ -5,19 +5,18 @@ > esid: sec-atomics.and > description: Test Atomics.and on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >- >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > view[8] = 0x33333333; > control[0] = 0x33333333; >@@ -59,4 +58,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.and(view, Idx, 0), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/and/non-views.js b/JSTests/test262/test/built-ins/Atomics/and/non-views.js >index bdcfbac7443e1836904c5971ddd138a8a7af5d37..5d77bb208f9517caf258197adceb4434ebf1fed3 100644 >--- a/JSTests/test262/test/built-ins/Atomics/and/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/and/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.and > description: > > Test Atomics.and on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/and/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/and/nonshared-int-views.js >index 4a5a90efa2750859b3ff77a3e376e3812089ea0f..0ac99ee7189d270dfd41814b6a191e1db9601f04 100644 >--- a/JSTests/test262/test/built-ins/Atomics/and/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/and/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.and > description: > > Test Atomics.and on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.and(view, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.and(new TA(buffer), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/and/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/and/shared-nonint-views.js >index 9c34faf82162938267425404790fb23956b1ed61..42b669359e0099c062aeaa2825788c7bda142401 100644 >--- a/JSTests/test262/test/built-ins/Atomics/and/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/and/shared-nonint-views.js >@@ -6,15 +6,11 @@ esid: sec-atomics.and > description: > > Test Atomics.and on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; >- >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); >- >- assert.throws(TypeError, (() => Atomics.and(view, 0, 0))); >-}, other_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.and(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); >diff --git a/JSTests/test262/test/built-ins/Atomics/compareExchange/bad-range.js b/JSTests/test262/test/built-ins/Atomics/compareExchange/bad-range.js >index b7964e361014e544ba86f5c5f14a9aceb588b78b..ea8ab1b31cd5900455fab46c1f6e6996467c5867 100644 >--- a/JSTests/test262/test/built-ins/Atomics/compareExchange/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/compareExchange/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.compareexchange > description: > > Test range checking of Atomics.compareExchange on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.compareExchange(view, Idx, 10, 0)); >+ assert.throws(RangeError, () => Atomics.compareExchange(view, IdxGen(view), 10, 0)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/compareExchange/good-views.js b/JSTests/test262/test/built-ins/Atomics/compareExchange/good-views.js >index f21d7a12da22e2208c36f88e000e64986f0158ed..9d39d9a4ae47b273dc926c2333388b2d4292b61a 100644 >--- a/JSTests/test262/test/built-ins/Atomics/compareExchange/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/compareExchange/good-views.js >@@ -5,26 +5,18 @@ > esid: sec-atomics.compareexchange > description: Test Atomics.compareExchange on arrays that allow atomic operations. > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >- >-var good_indices = [ (view) => 0/-1, // -0 >- (view) => '-0', >- (view) => view.length - 1, >- (view) => ({ valueOf: () => 0 }), >- (view) => ({ toString: () => '0', valueOf: false }) // non-callable valueOf triggers invocation of toString >- ]; >- >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > // Performs the exchange > view[8] = 0; >@@ -71,4 +63,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.compareExchange(view, Idx, 37, 0), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/compareExchange/non-views.js b/JSTests/test262/test/built-ins/Atomics/compareExchange/non-views.js >index fc51c91ecade1ab42dfcb263faccc999985009f0..e297384cf77184bae2ba5f9a954fa1cf8980a896 100644 >--- a/JSTests/test262/test/built-ins/Atomics/compareExchange/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/compareExchange/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.compareexchange > description: > > Test Atomics.compareExchange on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/compareExchange/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/compareExchange/nonshared-int-views.js >index aaaa95d4ea118d22df76242afd80e13a0f3529fc..2f196f896e2b132cede9f6b02341928be6782600 100644 >--- a/JSTests/test262/test/built-ins/Atomics/compareExchange/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/compareExchange/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.compareexchange > description: > > Test Atomics.compareExchange on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.compareExchange(view, 0, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.compareExchange(new TA(buffer), 0, 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/compareExchange/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/compareExchange/shared-nonint-views.js >index 06d66b0aeb494fd3a2280972c7d80711c97d6d5b..58815cb1e5580b5a51d44e8301011b0d22be6c54 100644 >--- a/JSTests/test262/test/built-ins/Atomics/compareExchange/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/compareExchange/shared-nonint-views.js >@@ -6,15 +6,11 @@ esid: sec-atomics.compareexchange > description: > > Test Atomics.compareExchange on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; >- >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); >- >- assert.throws(TypeError, (() => Atomics.compareExchange(view, 0, 0, 0))); >-}, other_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.compareExchange(new TA(buffer), 0, 0, 0))); >+}, floatArrayConstructors); >diff --git a/JSTests/test262/test/built-ins/Atomics/exchange/bad-range.js b/JSTests/test262/test/built-ins/Atomics/exchange/bad-range.js >index 15957b2002b4e82cf7391d6fd901255195564893..ddc763ecd283f1b068651d73797e466df6d4ceb7 100644 >--- a/JSTests/test262/test/built-ins/Atomics/exchange/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/exchange/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.exchange > description: > > Test range checking of Atomics.exchange on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.exchange(view, Idx, 10, 0)); >+ assert.throws(RangeError, () => Atomics.exchange(view, IdxGen(view), 10, 0)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/exchange/good-views.js b/JSTests/test262/test/built-ins/Atomics/exchange/good-views.js >index d8fd39ee9f6d26c62b90e5a70d5e45e523a8a9ca..a7b5c763307522128f6b83ea74e941a0a9416ee5 100644 >--- a/JSTests/test262/test/built-ins/Atomics/exchange/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/exchange/good-views.js >@@ -5,19 +5,18 @@ > esid: sec-atomics.exchange > description: Test Atomics.exchange on arrays that allow atomic operations. > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >- >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > view[8] = 0; > assert.sameValue(Atomics.exchange(view, 8, 10), 0, >@@ -53,4 +52,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.exchange(view, Idx, 0), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/exchange/non-views.js b/JSTests/test262/test/built-ins/Atomics/exchange/non-views.js >index c4d28a2fa160765837a6e164595582aad3c5bdbe..1b9348ca695e4f3c12f4cc44d8e85a534b589ca2 100644 >--- a/JSTests/test262/test/built-ins/Atomics/exchange/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/exchange/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.exchange > description: > > Test Atomics.exchange on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/exchange/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/exchange/nonshared-int-views.js >index c6684d46357574a34c6935758718f4dd4c5f7ee0..47a736fc9aaf9591327baa98c295c95d5f24bb4a 100644 >--- a/JSTests/test262/test/built-ins/Atomics/exchange/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/exchange/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.exchange > description: > > Test Atomics.exchange on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.exchange(view, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.exchange(new TA(buffer), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/exchange/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/exchange/shared-nonint-views.js >index f0c041df1cdb9ea5f1bfb7accd97dac233fdf748..16a10234a46d116504d117535dbde5879d108474 100644 >--- a/JSTests/test262/test/built-ins/Atomics/exchange/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/exchange/shared-nonint-views.js >@@ -6,15 +6,11 @@ esid: sec-atomics.exchange > description: > > Test Atomics.exchange on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; >- >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); >- >- assert.throws(TypeError, (() => Atomics.exchange(view, 0, 0))); >-}, other_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.exchange(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); >diff --git a/JSTests/test262/test/built-ins/Atomics/isLockFree/corner-cases.js b/JSTests/test262/test/built-ins/Atomics/isLockFree/corner-cases.js >index 1c5e686f4e84891b972bac8b0f41866d3de9352c..9901e553a9d72c69a6d9bb7b13b8a8fa54029847 100644 >--- a/JSTests/test262/test/built-ins/Atomics/isLockFree/corner-cases.js >+++ b/JSTests/test262/test/built-ins/Atomics/isLockFree/corner-cases.js >@@ -8,10 +8,10 @@ description: > > features: [Atomics] > ---*/ > >-assert.sameValue(false, Atomics.isLockFree(hide(3, Number.NaN))); >-assert.sameValue(false, Atomics.isLockFree(hide(3, -1))); >-assert.sameValue(false, Atomics.isLockFree(hide(3, 3.14))); >-assert.sameValue(false, Atomics.isLockFree(hide(3, 0))); >+assert.sameValue(Atomics.isLockFree(hide(3, Number.NaN)), false); >+assert.sameValue(Atomics.isLockFree(hide(3, -1)), false); >+assert.sameValue(Atomics.isLockFree(hide(3, 3.14)), false); >+assert.sameValue(Atomics.isLockFree(hide(3, 0)), false); > > assert.sameValue(Atomics.isLockFree('1'), Atomics.isLockFree(1)); > assert.sameValue(Atomics.isLockFree('3'), Atomics.isLockFree(3)); >@@ -24,7 +24,8 @@ assert.sameValue(Atomics.isLockFree(1), Atomics.isLockFree({toString: () => '1'} > assert.sameValue(Atomics.isLockFree(3), Atomics.isLockFree({toString: () => '3'})); > > function hide(k, x) { >- if (k) >+ if (k) { > return hide(k - 3, x) + x; >+ } > return 0; > } >diff --git a/JSTests/test262/test/built-ins/Atomics/isLockFree/value.js b/JSTests/test262/test/built-ins/Atomics/isLockFree/value.js >index cfeafe0bbb4aaba56238bc2f09bc2a22f0897a78..737043dad30725b0289e5508a06b7c92adc77e43 100644 >--- a/JSTests/test262/test/built-ins/Atomics/isLockFree/value.js >+++ b/JSTests/test262/test/built-ins/Atomics/isLockFree/value.js >@@ -13,36 +13,33 @@ var sizes = [ 1, 2, 3, 4, 5, 6, 7, 8, > var answers = [ {}, {}, false, true, false, false, false, false, > false, false, false, false]; > >-function testIsLockFree() { >- var saved = {}; >- >- // This should defeat most optimizations. >- >- for (var i = 0; i < sizes.length; i++) { >- var v = Atomics.isLockFree(sizes[i]); >- var a = answers[i]; >- assert.sameValue(typeof v, 'boolean'); >- if (typeof a == 'boolean') >- assert.sameValue(v, a); >- else >- saved[sizes[i]] = v; >+var saved = {}; >+ >+// This should defeat most optimizations. >+ >+for (var i = 0; i < sizes.length; i++) { >+ var v = Atomics.isLockFree(sizes[i]); >+ var a = answers[i]; >+ assert.sameValue(typeof v, 'boolean'); >+ if (typeof a == 'boolean') { >+ assert.sameValue(v, a); >+ } else { >+ saved[sizes[i]] = v; > } >- >- // This ought to be optimizable. Make sure the answers are the same >- // as for the unoptimized case. >- >- assert.sameValue(Atomics.isLockFree(1), saved[1]); >- assert.sameValue(Atomics.isLockFree(2), saved[2]); >- assert.sameValue(Atomics.isLockFree(3), false); >- assert.sameValue(Atomics.isLockFree(4), true); >- assert.sameValue(Atomics.isLockFree(5), false); >- assert.sameValue(Atomics.isLockFree(6), false); >- assert.sameValue(Atomics.isLockFree(7), false); >- assert.sameValue(Atomics.isLockFree(8), false); >- assert.sameValue(Atomics.isLockFree(9), false); >- assert.sameValue(Atomics.isLockFree(10), false); >- assert.sameValue(Atomics.isLockFree(11), false); >- assert.sameValue(Atomics.isLockFree(12), false); > } > >-testIsLockFree(); >+// This ought to be optimizable. Make sure the answers are the same >+// as for the unoptimized case. >+ >+assert.sameValue(Atomics.isLockFree(1), saved[1]); >+assert.sameValue(Atomics.isLockFree(2), saved[2]); >+assert.sameValue(Atomics.isLockFree(3), false); >+assert.sameValue(Atomics.isLockFree(4), true); >+assert.sameValue(Atomics.isLockFree(5), false); >+assert.sameValue(Atomics.isLockFree(6), false); >+assert.sameValue(Atomics.isLockFree(7), false); >+assert.sameValue(Atomics.isLockFree(8), false); >+assert.sameValue(Atomics.isLockFree(9), false); >+assert.sameValue(Atomics.isLockFree(10), false); >+assert.sameValue(Atomics.isLockFree(11), false); >+assert.sameValue(Atomics.isLockFree(12), false); >diff --git a/JSTests/test262/test/built-ins/Atomics/load/bad-range.js b/JSTests/test262/test/built-ins/Atomics/load/bad-range.js >index 7f1c7afc736f3214d206ffe0a7f92faab559a7b9..c2a2cdcc212598953911151e0c99f5e1c6e379a1 100644 >--- a/JSTests/test262/test/built-ins/Atomics/load/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/load/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.load > description: > > Test range checking of Atomics.load on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.load(view, Idx)); >+ assert.throws(RangeError, () => Atomics.load(view, IdxGen(view))); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/load/good-views.js b/JSTests/test262/test/built-ins/Atomics/load/good-views.js >index a4e2ad88060486e932c53337c51686e1c2d222bf..b36b892513dab876ddc2581d042d512ca034933b 100644 >--- a/JSTests/test262/test/built-ins/Atomics/load/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/load/good-views.js >@@ -5,19 +5,19 @@ > esid: sec-atomics.load > description: Test Atomics.load on arrays that allow atomic operations. > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var views = intArrayConstructors.slice(); > >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > view[3] = -5; > control[0] = -5; >@@ -43,4 +43,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.load(view, Idx), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/load/non-views.js b/JSTests/test262/test/built-ins/Atomics/load/non-views.js >index 1c4442dbfb7515c30ef45d20f2627ad50f9e23cd..11187136fe5d8cf9db89015a8dfffa09222041c7 100644 >--- a/JSTests/test262/test/built-ins/Atomics/load/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/load/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.load > description: > > Test Atomics.load on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/load/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/load/nonshared-int-views.js >index 0c8e6bccc650e3ac11f29d1bfb296cbb78991e6f..eb914784956e54d75173ff35b6684d6b0df009f9 100644 >--- a/JSTests/test262/test/built-ins/Atomics/load/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/load/nonshared-int-views.js >@@ -6,20 +6,20 @@ esid: sec-atomics.load > description: > > Test Atomics.load on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > > var ab = new ArrayBuffer(16); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >+testWithTypedArrayConstructors(function(TA) { >+ var view = new TA(ab); > > assert.throws(TypeError, (() => Atomics.load(view, 0))); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/load/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/load/shared-nonint-views.js >index 170c727f06c4e5bfb7b56683853053b9347a6eaf..f50b2746422976d5eb715163e8a68b98cee93292 100644 >--- a/JSTests/test262/test/built-ins/Atomics/load/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/load/shared-nonint-views.js >@@ -6,15 +6,10 @@ esid: sec-atomics.load > description: > > Test Atomics.load on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >- >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; >- >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); >- >- assert.throws(TypeError, (() => Atomics.load(view, 0))); >-}, other_views); >+var buffer = new SharedArrayBuffer(1024); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.load(new TA(buffer), 0))); >+}, floatArrayConstructors); >diff --git a/JSTests/test262/test/built-ins/Atomics/or/bad-range.js b/JSTests/test262/test/built-ins/Atomics/or/bad-range.js >index 5c3ff9b1b599abe7bbab1427698aab3c58feb8a5..42ee5a30c3e639ef180c7f7bbf823271d4b28dbf 100644 >--- a/JSTests/test262/test/built-ins/Atomics/or/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/or/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.or > description: > > Test range checking of Atomics.or on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.or(view, Idx, 10)); >+ assert.throws(RangeError, () => Atomics.or(view, IdxGen(view), 10)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/or/good-views.js b/JSTests/test262/test/built-ins/Atomics/or/good-views.js >index 6fab1d565e41b99aa3053760bedee9e8bc737a9d..228500d69ac44fbf67704bc5f09c97f46fa2ecb3 100644 >--- a/JSTests/test262/test/built-ins/Atomics/or/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/or/good-views.js >@@ -5,18 +5,18 @@ > esid: sec-atomics.or > description: Test Atomics.or on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var views = intArrayConstructors.slice(); > >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > view[8] = 0x33333333; > control[0] = 0x33333333; >@@ -58,4 +58,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.or(view, Idx, 0), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/or/non-views.js b/JSTests/test262/test/built-ins/Atomics/or/non-views.js >index 1135faa8e9e24b77aded1b863803bd00e2894047..feb25c906eae5aff4633054d798e11eca0ab9058 100644 >--- a/JSTests/test262/test/built-ins/Atomics/or/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/or/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.or > description: > > Test Atomics.or on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/or/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/or/nonshared-int-views.js >index 1a75c23448c77ebdcb04679ea7eab33bc34e800a..b88c793133c49a91a867a5fefa446325e494508a 100644 >--- a/JSTests/test262/test/built-ins/Atomics/or/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/or/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.or > description: > > Test Atomics.or on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.or(view, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.or(new TA(buffer), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/or/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/or/shared-nonint-views.js >index 0116afea5336e5532a377ca97201866cfb3f2938..5217318e8d2856578c8062446a44236d72495a65 100644 >--- a/JSTests/test262/test/built-ins/Atomics/or/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/or/shared-nonint-views.js >@@ -6,15 +6,13 @@ esid: sec-atomics.or > description: > > Test Atomics.or on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.or(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); > >- assert.throws(TypeError, (() => Atomics.or(view, 0, 0))); >-}, other_views); >diff --git a/JSTests/test262/test/built-ins/Atomics/prop-desc.js b/JSTests/test262/test/built-ins/Atomics/prop-desc.js >index 946bab41c084d77b7fb37852e2d7f07d8ee5adfa..57cfb2ecba4cd1faacb4c70834f2c3f14bd8ae08 100644 >--- a/JSTests/test262/test/built-ins/Atomics/prop-desc.js >+++ b/JSTests/test262/test/built-ins/Atomics/prop-desc.js >@@ -8,11 +8,12 @@ description: > > info: | > The Atomics Object > >- [...] >- The Atomics object is not a function object. It does not have a [[Construct]] >- internal method; it is not possible to use the Atomics object as a constructor >- with the new operator. The Atomics object also does not have a [[Call]] internal >- method; it is not possible to invoke the Atomics object as a function. >+ ... >+ The Atomics object does not have a [[Construct]] internal method; >+ it is not possible to use the Atomics object as a constructor with the new operator. >+ >+ The Atomics object does not have a [[Call]] internal method; >+ it is not possible to invoke the Atomics object as a function. > > 17 ECMAScript Standard Built-in Objects: > >@@ -23,11 +24,18 @@ includes: [propertyHelper.js] > features: [Atomics] > ---*/ > >-assert.sameValue(typeof Atomics, "object", "no [[Call]]"); >+assert.sameValue(typeof Atomics, "object"); >+ >+assert.throws(TypeError, function() { >+ Atomics(); >+}, "no [[Call]]"); >+ > assert.throws(TypeError, function() { > new Atomics(); > }, "no [[Construct]]"); > >-verifyNotEnumerable(this, "Atomics"); >-verifyWritable(this, "Atomics"); >-verifyConfigurable(this, "Atomics"); >+verifyProperty(this, "Atomics", { >+ enumerable: false, >+ writable: true, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/proto.js b/JSTests/test262/test/built-ins/Atomics/proto.js >index 1e7183f6d7b2e6746b3474a6eb145157fd6509cb..8072c47494f389ec8853f9297ba6da3470c3589c 100644 >--- a/JSTests/test262/test/built-ins/Atomics/proto.js >+++ b/JSTests/test262/test/built-ins/Atomics/proto.js >@@ -13,6 +13,4 @@ info: | > features: [Atomics] > ---*/ > >-var proto = Object.getPrototypeOf(Atomics); >- >-assert.sameValue(proto, Object.prototype); >+assert.sameValue(Object.getPrototypeOf(Atomics), Object.prototype); >diff --git a/JSTests/test262/test/built-ins/Atomics/store/bad-range.js b/JSTests/test262/test/built-ins/Atomics/store/bad-range.js >index a13f1f177ab7da945d2c440ee9e47b9b95f0a1ff..2b03ecbbadfb15dc8803a7d773f285a8cfb70051 100644 >--- a/JSTests/test262/test/built-ins/Atomics/store/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/store/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.store > description: > > Test range checking of Atomics.store on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.store(view, Idx, 10)); >+ assert.throws(RangeError, () => Atomics.store(view, IdxGen(view), 10)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/store/good-views.js b/JSTests/test262/test/built-ins/Atomics/store/good-views.js >index c39de60aa872b7347403fb247f0accdd9ac7ceb6..4e665a76392ac79c2e9eb53619fa79ba49fecd11 100644 >--- a/JSTests/test262/test/built-ins/Atomics/store/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/store/good-views.js >@@ -5,19 +5,18 @@ > esid: sec-atomics.store > description: Test Atomics.store on arrays that allow atomic operations. > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >- >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > for (let val of [10, -5, > 12345, >@@ -44,15 +43,18 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.load(view, Idx), 37); > }); >-}, int_views); >+}, views); > > function ToInteger(v) { > v = +v; >- if (isNaN(v)) >+ if (isNaN(v)) { > return 0; >- if (v == 0 || !isFinite(v)) >+ } >+ if (v == 0 || !isFinite(v)) { > return v; >- if (v < 0) >+ } >+ if (v < 0) { > return -Math.floor(Math.abs(v)); >+ } > return Math.floor(v); > } >diff --git a/JSTests/test262/test/built-ins/Atomics/store/non-views.js b/JSTests/test262/test/built-ins/Atomics/store/non-views.js >index 365a7fbba79301d0b2550a8ed28139ad7242845f..e34616f9930a34b81df9136d1cb028b45b1d5c0e 100644 >--- a/JSTests/test262/test/built-ins/Atomics/store/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/store/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.store > description: > > Test Atomics.store on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/store/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/store/nonshared-int-views.js >index 06029384cc6e9a7c013a34614ebc89cd174e0fde..2f0d698bb4174272aef921156cc8a56c7a616951 100644 >--- a/JSTests/test262/test/built-ins/Atomics/store/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/store/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.store > description: > > Test Atomics.store on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.store(view, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.store(new TA(buffer), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/store/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/store/shared-nonint-views.js >index f2dfb40916c6937e9aa5cef39e74cfca4474226a..4e363d409a708b5f8b0db875e7cd675962aea18b 100644 >--- a/JSTests/test262/test/built-ins/Atomics/store/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/store/shared-nonint-views.js >@@ -6,15 +6,14 @@ esid: sec-atomics.store > description: > > Test Atomics.store on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); >+ >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.store(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); > >- assert.throws(TypeError, (() => Atomics.store(view, 0, 0))); >-}, other_views); >diff --git a/JSTests/test262/test/built-ins/Atomics/sub/bad-range.js b/JSTests/test262/test/built-ins/Atomics/sub/bad-range.js >index 700309fffc7ddbca5c13574c9ab5f9b659596079..395bc920610562e0c527fd6ab4a9b8c0d9a1d539 100644 >--- a/JSTests/test262/test/built-ins/Atomics/sub/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/sub/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.sub > description: > > Test range checking of Atomics.sub on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new SharedArrayBuffer(8); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(buffer); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.sub(view, Idx, 10)); >+ assert.throws(RangeError, () => Atomics.sub(view, IdxGen(view), 10)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/sub/good-views.js b/JSTests/test262/test/built-ins/Atomics/sub/good-views.js >index 18b6982d7312d66d48e07223db32fd41240145cf..411e1ad1852ab1cf8a927bd435503417b08f917f 100644 >--- a/JSTests/test262/test/built-ins/Atomics/sub/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/sub/good-views.js >@@ -5,19 +5,18 @@ > esid: sec-atomics.sub > description: Test Atomics.sub on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >- >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > view[8] = 100; > assert.sameValue(Atomics.sub(view, 8, 10), 100, >@@ -52,4 +51,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.sub(view, Idx, 0), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/sub/non-views.js b/JSTests/test262/test/built-ins/Atomics/sub/non-views.js >index 985b95c00beb89cfc533c9b350854459db820cb1..d4b12d5b2d8796206871bb283e524f5a83cb1b08 100644 >--- a/JSTests/test262/test/built-ins/Atomics/sub/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/sub/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.sub > description: > > Test Atomics.sub on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/sub/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/sub/nonshared-int-views.js >index 90a605b7c75205cdae34c4f3c5ff87c04116a722..3352ad9453134d9d7f3eb6efa3e21b1ddd027580 100644 >--- a/JSTests/test262/test/built-ins/Atomics/sub/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/sub/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.sub > description: > > Test Atomics.sub on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.sub(view, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.sub(new TA(buffer), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/sub/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/sub/shared-nonint-views.js >index 3563f7e37d5a659631beff967f63e947e9197b2f..89159d5879217827b90756ac1a5dcc574245773c 100644 >--- a/JSTests/test262/test/built-ins/Atomics/sub/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/sub/shared-nonint-views.js >@@ -6,15 +6,14 @@ esid: sec-atomics.sub > description: > > Test Atomics.sub on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); >+ >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.sub(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); > >- assert.throws(TypeError, (() => Atomics.sub(view, 0, 0))); >-}, other_views); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/bad-range.js b/JSTests/test262/test/built-ins/Atomics/wait/bad-range.js >new file mode 100644 >index 0000000000000000000000000000000000000000..87203dcc29af2aa8b5b019d690b14dc7824ef3c0 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/bad-range.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2017 Mozilla Corporation. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Test range checking of Atomics.wake on arrays that allow atomic operations >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ ... >+ >+includes: [testAtomics.js, testTypedArray.js] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var sab = new SharedArrayBuffer(8); >+var views = [Int32Array]; >+ >+if (typeof BigInt !== "undefined") { >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); >+} >+ >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(sab); >+ testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >+ assert.throws(RangeError, () => Atomics.wake(view, IdxGen(view), 0)); // Even with waking zero >+ }); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/cannot-suspend-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/cannot-suspend-throws.js >index 56fb3c5125b1dc58dbe89294301a80d49f0ec388..30fc2d1f063e61a3d7d2b42282208ab92989d769 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/cannot-suspend-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/cannot-suspend-throws.js >@@ -14,12 +14,13 @@ info: | > 6. Let B be AgentCanSuspend(). > 7. If B is false, throw a TypeError exception. > ... >-features: [Atomics, SharedArrayBuffer, TypedArray, CannotSuspendMainAgent] >+features: [Atomics, SharedArrayBuffer, TypedArray] >+flags: [CanBlockIsFalse] > ---*/ > >-var sab = new SharedArrayBuffer(4); >-var int32Array = new Int32Array(sab); >- >+var buffer = new SharedArrayBuffer(4); >+var int32Array = new Int32Array(buffer); >+ > assert.throws(TypeError, function() { > Atomics.wait(int32Array, 0, 0, 0); > }); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/did-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/did-timeout.js >index 337a45bbc90f04686eba89164376f2833010dbdc..a647bb648621708f546fb1a59e619671a9788ec4 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/did-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/did-timeout.js >@@ -6,10 +6,24 @@ esid: sec-atomics.wait > description: > > Test that Atomics.wait returns the right result when it timed out and that > the time to time out is reasonable. >+ info: | >+ 17. Let awoken be Suspend(WL, W, t). >+ 18. If awoken is true, then >+ a. Assert: W is not on the list of waiters in WL. >+ 19. Else, >+ a.Perform RemoveWaiter(WL, W). > includes: [atomicsHelper.js] >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ > $262.agent.start( > ` > $262.agent.receiveBroadcast(function (sab, id) { >@@ -27,10 +41,3 @@ $262.agent.broadcast(ia.buffer); > assert.sameValue(getReport(), "timed-out"); > assert.sameValue((getReport() | 0) >= 500 - $ATOMICS_MAX_TIME_EPSILON, true); > >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >- return r; >-} >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c88b4900d045997772325599400aa1c2ad993863 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout-agent.js >@@ -0,0 +1,68 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ False timeout arg should result in an +0 timeout >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 4. Let q be ? ToNumber(timeout). >+ >+ Boolean -> If argument is true, return 1. If argument is false, return +0. >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+ ` >+var valueOf = { >+ valueOf: function() { >+ return false; >+ } >+}; >+ >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return false; >+ } >+}; >+ >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, false)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, valueOf)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, toPrimitive)); >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}) >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, 'timeout should be a min of 0ms'); >+ >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, 'timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON'); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout.js >index cc96fd567c55361bb674f82ecfa4f45686fc6fd0..72f234baab8bfab626d8a1386be4953f69e25e48 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/false-for-timeout.js >@@ -1,4 +1,4 @@ >-// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// Copyright (C) 2018 Amal Hussein. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > > /*--- >@@ -8,45 +8,30 @@ description: > > info: | > Atomics.wait( typedArray, index, value, timeout ) > >- 4.Let q be ? ToNumber(timeout). >- ... >- Null Return +0. >- Boolean If argument is true, return 1. If argument is false, return +0. >-features: [ Atomics, SharedArrayBuffer, TypedArray ] >-includes: [ atomicsHelper.js ] >----*/ >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >- return r; >-} >- >-$262.agent.start( >- ` >-$262.agent.receiveBroadcast(function (sab) { >- var int32Array = new Int32Array(sab); >- var start = Date.now(); >- $262.agent.report(Atomics.wait(int32Array, 0, 0, false)); // false => +0 >- $262.agent.report(Date.now() - start); >- $262.agent.leaving(); >-}) >-`); >+ 4. Let q be ? ToNumber(timeout). > >-var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ Boolean -> If argument is true, return 1. If argument is false, return +0. > >-$262.agent.broadcast(int32Array.buffer); >- >-$262.agent.sleep(150); >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+flags: [CanBlockIsFalse] >+---*/ > >-var atomicsReport = getReport(); >-var timeDiffReport = getReport(); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); > >-assert.sameValue(atomicsReport, 'timed-out'); >+var valueOf = { >+ valueOf: function() { >+ return false; >+ } >+}; > >-assert(timeDiffReport >= 0, 'timeout should be a min of 0ms'); >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return false; >+ } >+}; > >-assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, 'timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON'); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, false), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, valueOf), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, toPrimitive), "timed-out"); > >-assert.sameValue(Atomics.wake(int32Array, 0), 0); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/good-views.js b/JSTests/test262/test/built-ins/Atomics/wait/good-views.js >index 1745841592f938e225fadaa9f545f4369cf2a0e1..bf9fd6b5087e8faf2c9cfde2616e69a1136fe537 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/good-views.js >@@ -42,17 +42,19 @@ for ( let IdxGen of good_indices ) { > > $262.agent.report("done"); > $262.agent.leaving(); >-`) >+`); > > assert.sameValue(getReport(), "A timed-out"); > assert.sameValue(getReport(), "B not-equal"); // Even with zero timeout > var r; >-while ((r = getReport()) != "done") >+while ((r = getReport()) != "done") { > assert.sameValue(r, "C not-equal"); >+} > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >+ while ((r = $262.agent.getReport()) == null) { > $262.agent.sleep(100); >+ } > return r; > } >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/nan-for-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/nan-for-timeout.js >index f1356221f69a10f36c3c488db07d599656bc1e69..a9026163bc31333f413ec344da79feefb67331d0 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/nan-for-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/nan-for-timeout.js >@@ -12,13 +12,15 @@ info: | > ... > Undefined Return NaN. > 5.If q is NaN, let t be +â, else let t be max(q, 0) >-features: [ Atomics, SharedArrayBuffer, TypedArray ] >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >+ while ((r = $262.agent.getReport()) == null) { > $262.agent.sleep(100); >+ } > return r; > } > >@@ -34,11 +36,7 @@ $262.agent.receiveBroadcast(function (sab) { > var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); > > $262.agent.broadcast(int32Array.buffer); >- > $262.agent.sleep(500); // Ample time > >-assert.sameValue($262.agent.getReport(), null); >- > assert.sameValue(Atomics.wake(int32Array, 0), 1); >- > assert.sameValue(getReport(), "ok"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/negative-index-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/negative-index-throws.js >index 2d08dc40c10a16e259ef8afc991b882b2232134e..baba9e03941bffbaf2130c4966ac806c33795957 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/negative-index-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/negative-index-throws.js >@@ -13,7 +13,7 @@ info: | > 2.Let accessIndex be ? ToIndex(requestIndex). > ... > 2.b If integerIndex < 0, throw a RangeError exception >-features: [ Atomics , SharedArrayBuffer, TypedArray ] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); >@@ -24,7 +24,15 @@ var poisoned = { > } > }; > >-assert.throws(RangeError, () => Atomics.wait(int32Array, -Infinity, poisoned, poisoned)); >-assert.throws(RangeError, () => Atomics.wait(int32Array, -7.999, poisoned, poisoned)); >-assert.throws(RangeError, () => Atomics.wait(int32Array, -1, poisoned, poisoned)); >-assert.throws(RangeError, () => Atomics.wait(int32Array, -300, poisoned, poisoned)); >+assert.throws(RangeError, function() { >+ Atomics.wait(int32Array, -Infinity, poisoned, poisoned); >+}); >+assert.throws(RangeError, function() { >+ Atomics.wait(int32Array, -7.999, poisoned, poisoned); >+}); >+assert.throws(RangeError, function() { >+ Atomics.wait(int32Array, -1, poisoned, poisoned); >+}); >+assert.throws(RangeError, function() { >+ Atomics.wait(int32Array, -300, poisoned, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/negative-timeout-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/negative-timeout-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a5dd78668086423328c7db76525d68a57facd1a1 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/negative-timeout-agent.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2017 Mozilla Corporation. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ Test that Atomics.wait times out with a negative timeout >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function(sab, id) { >+ var ia = new Int32Array(sab); >+ $262.agent.report(Atomics.wait(ia, 0, 0, -5)); // -5 => 0 >+ $262.agent.leaving(); >+}) >+`); >+ >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); >+ >+$262.agent.broadcast(int32Array.buffer); >+assert.sameValue(getReport(), "timed-out"); >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/negative-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/negative-timeout.js >index 84ce5ce1901acb0457deb0cff68a982bb9f359ec..46961c5be21fcfd535cc6d3472ab755888ec63ac 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/negative-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/negative-timeout.js >@@ -5,26 +5,11 @@ > esid: sec-atomics.wait > description: > > Test that Atomics.wait times out with a negative timeout >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] >+flags: [CanBlockIsFalse] > ---*/ > >-$262.agent.start( >-` >-$262.agent.receiveBroadcast(function (sab, id) { >- var ia = new Int32Array(sab); >- $262.agent.report(Atomics.wait(ia, 0, 0, -5)); // -5 => 0 >- $262.agent.leaving(); >-}) >-`); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); > >-var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >- >-$262.agent.broadcast(ia.buffer); >-assert.sameValue(getReport(), "timed-out"); >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >- return r; >-} >+assert.sameValue(Atomics.wait(int32Array, 0, 0, -1), "timed-out"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/no-spurious-wakeup.js b/JSTests/test262/test/built-ins/Atomics/wait/no-spurious-wakeup.js >index 1da152c7a0386a09976acd476537e884e3b235fd..a504fd5bde8be09fb720b256c33304a9dcc823c3 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/no-spurious-wakeup.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/no-spurious-wakeup.js >@@ -7,7 +7,7 @@ description: > > Test that Atomics.wait actually waits and does not spuriously wake > up when the memory value is changed. > includes: [atomicsHelper.js] >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > $262.agent.start( >@@ -33,7 +33,8 @@ assert.sameValue((getReport() | 0) >= 1000 - $ATOMICS_MAX_TIME_EPSILON, true); > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >+ while ((r = $262.agent.getReport()) == null) { > $262.agent.sleep(100); >+ } > return r; > } >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/non-int32-typedarray-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/non-int32-typedarray-throws.js >index dc5932fb1dacc21d1f3513dde9042897153d62e8..ea2ce1f1bf34711ffe8eb25ec56fed4ab650d105 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/non-int32-typedarray-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/non-int32-typedarray-throws.js >@@ -12,7 +12,7 @@ info: | > ... > 5.If onlyInt32 is true, then > If typeName is not "Int32Array", throw a TypeError exception. >-features: [ Atomics, TypedArray ] >+features: [Atomics, Float32Array, Float64Array, Int8Array, TypedArray, Uint16Array, Uint8Array, Uint8ClampedArray] > ---*/ > > var poisoned = { >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/non-shared-bufferdata-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/non-shared-bufferdata-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d14ae2cf7b6cc415817ab389f7c13ff7f5e8c208 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/non-shared-bufferdata-throws.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-atomics.wait >+description: > >+ Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ ... >+ 9.If IsSharedArrayBuffer(buffer) is false, throw a TypeError exception. >+ ... >+ 4.If bufferData is a Data Block, return false. >+features: [ArrayBuffer, Atomics, TypedArray] >+---*/ >+ >+var int32Array = new Int32Array(new ArrayBuffer(4)); >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, 0, 0, 0); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, poisoned, poisoned, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/nonshared-bufferdata-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/nonshared-bufferdata-throws.js >deleted file mode 100644 >index 640550c0b20827951daf9370cd24a196684d8987..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Atomics/wait/nonshared-bufferdata-throws.js >+++ /dev/null >@@ -1,26 +0,0 @@ >-// Copyright (C) 2018 Amal Hussein. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-esid: sec-atomics.wait >-description: > >- Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer >-info: | >- Atomics.wait( typedArray, index, value, timeout ) >- >- 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >- ... >- 9.If IsSharedArrayBuffer(buffer) is false, throw a TypeError exception. >- ... >- 4.If bufferData is a Data Block, return false. >-features: [ Atomics, ArrayBuffer, TypedArray ] >----*/ >- >-var int32Array = new Int32Array(new ArrayBuffer(1024)); >-var poisoned = { >- valueOf: function() { >- throw new Test262Error("should not evaluate this code"); >- } >-}; >- >-assert.throws(TypeError, () => Atomics.wait(int32Array, 0, 0, 0)); >-assert.throws(TypeError, () => Atomics.wait(int32Array, poisoned, poisoned, poisoned)); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/not-a-typedarray-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/not-a-typedarray-throws.js >index 7c1fbae1bc9072249e0357b1a4914b2a16516b4c..0fc66993aa8652fb589064a46b735022b672285d 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/not-a-typedarray-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/not-a-typedarray-throws.js >@@ -11,7 +11,7 @@ info: | > ... > 3.If typedArray does not have a [[TypedArrayName]] internal slot, throw a TypeError exception. > >-features: [ Atomics ] >+features: [Atomics] > ---*/ > > var poisoned = { >@@ -20,5 +20,10 @@ var poisoned = { > } > }; > >-assert.throws(TypeError, () => Atomics.wait({}, 0, 0, 0)); >-assert.throws(TypeError, () => Atomics.wait({}, poisoned, poisoned, poisoned)); >+assert.throws(TypeError, function() { >+ Atomics.wait({}, 0, 0, 0); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wait({}, poisoned, poisoned, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/not-an-object-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/not-an-object-throws.js >index 39d564586ccc5844d4f40de79cfe38d27e780c8d..e60165ffed168dc4c61cfe5f4866552298486766 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/not-an-object-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/not-an-object-throws.js >@@ -10,7 +10,7 @@ info: | > 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). > ... > 2. if Type(typedArray) is not Object, throw a TypeError exception >-features: [ Atomics, Symbol ] >+features: [Atomics, Symbol] > ---*/ > > var poisoned = { >@@ -19,16 +19,30 @@ var poisoned = { > } > }; > >-assert.throws(TypeError, function() { Atomics.wait(null,poisoned,poisoned,poisoned) }, 'null'); >+assert.throws(TypeError, function() { >+ Atomics.wait(null, poisoned, poisoned, poisoned); >+}, 'null'); > >-assert.throws(TypeError, function() { Atomics.wait(undefined,poisoned,poisoned,poisoned) }, 'undefined'); >+assert.throws(TypeError, function() { >+ Atomics.wait(undefined, poisoned, poisoned, poisoned); >+}, 'undefined'); > >-assert.throws(TypeError, function() { Atomics.wait(true,poisoned,poisoned,poisoned) }, 'true'); >+assert.throws(TypeError, function() { >+ Atomics.wait(true, poisoned, poisoned, poisoned); >+}, 'true'); > >-assert.throws(TypeError, function() { Atomics.wait(false,poisoned,poisoned,poisoned) }, 'false'); >+assert.throws(TypeError, function() { >+ Atomics.wait(false, poisoned, poisoned, poisoned); >+}, 'false'); > >-assert.throws(TypeError, function() { Atomics.wait('***string***',poisoned,poisoned,poisoned) }, 'String'); >+assert.throws(TypeError, function() { >+ Atomics.wait('***string***', poisoned, poisoned, poisoned); >+}, 'String'); > >-assert.throws(TypeError, function() { Atomics.wait(Number.NEGATIVE_INFINITY,poisoned,poisoned,poisoned) }, '-Infinity'); >+assert.throws(TypeError, function() { >+ Atomics.wait(Number.NEGATIVE_INFINITY, poisoned, poisoned, poisoned); >+}, '-Infinity'); > >-assert.throws(TypeError, function() { Atomics.wait(Symbol('***symbol***'),poisoned,poisoned,poisoned) }, 'Symbol'); >+assert.throws(TypeError, function() { >+ Atomics.wait(Symbol('***symbol***'), poisoned, poisoned, poisoned); >+}, 'Symbol'); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/null-bufferdata-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/null-bufferdata-throws.js >index 9dc142b0c27f7ab6826636422e27293c4429a39d..04c613397fdece0fb5e8938209fc0b4bdf234823 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/null-bufferdata-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/null-bufferdata-throws.js >@@ -13,7 +13,7 @@ info: | > ... > 3.If bufferData is null, return false. > includes: [detachArrayBuffer.js] >-features: [ Atomics, ArrayBuffer, TypedArray ] >+features: [ArrayBuffer, Atomics, TypedArray] > ---*/ > > var int32Array = new Int32Array(new ArrayBuffer(1024)); >@@ -25,4 +25,6 @@ var poisoned = { > > $DETACHBUFFER(int32Array.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null > >-assert.throws(TypeError, () => Atomics.wait(int32Array, poisoned, poisoned, poisoned)); >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, poisoned, poisoned, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..fd106e807e94fb1219f8df43ed937a3bb22da960 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout-agent.js >@@ -0,0 +1,68 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ False timeout arg should result in an +0 timeout >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 4. Let q be ? ToNumber(timeout). >+ >+ Null -> Return +0. >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+ ` >+var valueOf = { >+ valueOf: function() { >+ return null; >+ } >+}; >+ >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return null; >+ } >+}; >+ >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, null)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, valueOf)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, toPrimitive)); >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}) >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, 'timeout should be a min of 0ms'); >+ >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, 'timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON'); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout.js >index 436b34fe3edaaf3bac505dc79a09da2ba6896ccc..70de069ae1f4ac561c8c91d0a976253597b0ca5c 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/null-for-timeout.js >@@ -1,52 +1,37 @@ >-// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// Copyright (C) 2018 Amal Hussein. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > > /*--- > esid: sec-atomics.wait > description: > >- Null timeout arg should result in an +0 timeout >+ Throws a TypeError if index arg can not be converted to an Integer > info: | > Atomics.wait( typedArray, index, value, timeout ) > >- 4.Let q be ? ToNumber(timeout). >- ... >- Null Return +0. >- Boolean If argument is true, return 1. If argument is false, return +0. >-features: [ Atomics ] >-includes: [ atomicsHelper.js ] >----*/ >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >- return r; >-} >- >-$262.agent.start( >- ` >-$262.agent.receiveBroadcast(function (sab) { >- var int32Array = new Int32Array(sab); >- var start = Date.now(); >- $262.agent.report(Atomics.wait(int32Array, 0, 0, null)); // null => +0 >- $262.agent.report(Date.now() - start); >- $262.agent.leaving(); >-}) >-`); >+ 4. Let q be ? ToNumber(timeout). > >-var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ Null -> Return +0. > >-$262.agent.broadcast(int32Array.buffer); >- >-$262.agent.sleep(150); >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+flags: [CanBlockIsFalse] >+---*/ > >-var atomicsReport = getReport(); >-var timeDiffReport = getReport(); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); > >-assert.sameValue(atomicsReport, 'timed-out'); >+var valueOf = { >+ valueOf: function() { >+ return null; >+ } >+}; > >-assert(timeDiffReport >= 0, 'timeout should be a min of 0ms'); >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return null; >+ } >+}; > >-assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, 'timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON'); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, null), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, valueOf), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, toPrimitive), "timed-out"); > >-assert.sameValue(Atomics.wake(int32Array, 0), 0); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/object-for-timeout-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/object-for-timeout-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7db064617a47bfbee2134af20aadb431adf7bd9f >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/object-for-timeout-agent.js >@@ -0,0 +1,75 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ False timeout arg should result in an +0 timeout >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 4. Let q be ? ToNumber(timeout). >+ >+ Null -> Return +0. >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+ ` >+var valueOf = { >+ valueOf: function() { >+ return 0; >+ } >+}; >+ >+var toString = { >+ toString: function() { >+ return "0"; >+ } >+}; >+ >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return 0; >+ } >+}; >+ >+ >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, valueOf)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, toString)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, toPrimitive)); >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}) >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, 'timeout should be a min of 0ms'); >+ >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, 'timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON'); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/object-for-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/object-for-timeout.js >index ab2c809178fcfab7e985f6132fd3b08bd72a5a8b..3fc07cc11b2acd8c6805f6dfded0ccad6db0abea 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/object-for-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/object-for-timeout.js >@@ -1,47 +1,45 @@ >-// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// Copyright (C) 2018 Amal Hussein. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > > /*--- > esid: sec-atomics.wait > description: > >- False timeout arg should result in a timeout value of 1 >+ Throws a TypeError if index arg can not be converted to an Integer > info: | > Atomics.wait( typedArray, index, value, timeout ) > >- 4.Let q be ? ToNumber(timeout). >- ... >- Object >- Apply the following steps: >+ 4. Let q be ? ToNumber(timeout). >+ >+ Object -> Apply the following steps: > > Let primValue be ? ToPrimitive(argument, hint Number). > Return ? ToNumber(primValue). >-features: [ Atomics ] >-includes: [atomicsHelper.js] >----*/ >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >- return r; >-} >- >- >-$262.agent.start( >- ` >-$262.agent.receiveBroadcast(function (sab) { >- var int32Array = new Int32Array(sab); >- $262.agent.report("A " + Atomics.wait(int32Array, 0, 0, {})); // {} => NaN => Infinity >- $262.agent.leaving(); >-}) >-`); > >-var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >- >-$262.agent.broadcast(int32Array.buffer); >- >-$262.agent.sleep(500); // Ample time >- >-assert.sameValue(Atomics.wake(int32Array, 0), 1); >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+flags: [CanBlockIsFalse] >+---*/ > >-assert.sameValue(getReport(), "A ok"); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); >+ >+var valueOf = { >+ valueOf: function() { >+ return 0; >+ } >+}; >+ >+var toString = { >+ toString: function() { >+ return "0"; >+ } >+}; >+ >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return 0; >+ } >+}; >+ >+assert.sameValue(Atomics.wait(int32Array, 0, 0, valueOf), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, toString), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, toPrimitive), "timed-out"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/out-of-range-index-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/out-of-range-index-throws.js >index d14262605f1432700e75364c1aeeb4bf1c9c33e8..d9925b800602d04ad5536adceba0ab6729fd9284 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/out-of-range-index-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/out-of-range-index-throws.js >@@ -13,16 +13,23 @@ info: | > 2.Let accessIndex be ? ToIndex(requestIndex). > ... > 5. If accessIndex ⥠length, throw a RangeError exception. >-features: [ Atomics, SharedArrayBuffer, TypedArray ] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > var int32Array = new Int32Array(new SharedArrayBuffer(4)); >+ > var poisoned = { > valueOf: function() { > throw new Test262Error("should not evaluate this code"); > } > }; > >-assert.throws(RangeError, () => Atomics.wait(int32Array, Infinity, poisoned, poisoned)); >-assert.throws(RangeError, () => Atomics.wait(int32Array, 2, poisoned, poisoned)); >-assert.throws(RangeError, () => Atomics.wait(int32Array, 200, poisoned, poisoned)); >+assert.throws(RangeError, function() { >+ Atomics.wait(int32Array, Infinity, poisoned, poisoned); >+}); >+assert.throws(RangeError, function() { >+ Atomics.wait(int32Array, 2, poisoned, poisoned); >+}); >+assert.throws(RangeError, function() { >+ Atomics.wait(int32Array, 200, poisoned, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..4708214512258772ddae13543feb46668cd4ba46 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js >@@ -0,0 +1,74 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ False timeout arg should result in an +0 timeout >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 4. Let q be ? ToNumber(timeout). >+ >+ Null -> Return +0. >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+ ` >+var poisonedValueOf = { >+ valueOf: function() { >+ throw new Error("should not evaluate this code"); >+ } >+}; >+ >+var poisonedToPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ throw new Error("passing a poisoned object using @@ToPrimitive"); >+ } >+}; >+ >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ try { >+ Atomics.wait(int32Array, 0, 0, poisonedValueOf); >+ } catch (error) { >+ $262.agent.report("poisonedValueOf"); >+ } >+ try { >+ Atomics.wait(int32Array, 0, 0, poisonedToPrimitive); >+ } catch (error) { >+ $262.agent.report("poisonedToPrimitive"); >+ } >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}); >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), "poisonedValueOf"); >+assert.sameValue(getReport(), "poisonedToPrimitive"); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, "timeout should be a min of 0ms"); >+ >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, "timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON"); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js >index 0ca369b12a882b49a1fef92fc6322e4ddc3d73f6..f157f07b115b9b8563a21a8db3d5d95262a2831f 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js >@@ -1,60 +1,42 @@ >-// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// Copyright (C) 2018 Amal Hussein. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > > /*--- > esid: sec-atomics.wait > description: > >- Passing an object with no callable methods for the timeout param throws >+ Throws a TypeError if index arg can not be converted to an Integer > info: | > Atomics.wait( typedArray, index, value, timeout ) > >- 4.Let q be ? ToNumber(timeout). >- ... >- Object >- Apply the following steps: >+ 4. Let q be ? ToNumber(timeout). >+ >+ Object -> Apply the following steps: >+ > Let primValue be ? ToPrimitive(argument, hint Number). >- ... >- g. Return ? OrdinaryToPrimitive(input, hint). >- ... >- 6.Throw a TypeError exception. >-features: [ Atomics ] >+ Return ? ToNumber(primValue). >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] > ---*/ > >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) { >- $262.agent.sleep(100); >- } >- return r; >-} >- >-$262.agent.start( >- ` >-$262.agent.receiveBroadcast(function (sab) { >- >- var int32Array = new Int32Array(sab); >- var poisoned = { >- valueOf: false, >- toString: false >- }; >- var err; >- >- try { >- Atomics.wait(int32Array, 0, 0, poisoned); >- } catch(e) { >- err = e.name; >- } >- >- $262.agent.report(err); >- $262.agent.leaving(); >-}) >-`); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); > >-var sab = new SharedArrayBuffer(4); >-var int32Array = new Int32Array(sab); >+var poisonedValueOf = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; > >-$262.agent.broadcast(int32Array.buffer); >+var poisonedToPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ throw new Test262Error("passing a poisoned object using @@ToPrimitive"); >+ } >+}; > >-assert.sameValue(getReport(), 'TypeError'); >+assert.throws(Test262Error, function() { >+ Atomics.wait(int32Array, 0, 0, poisonedValueOf); >+}); > >-assert.sameValue(Atomics.wake(int32Array, 0), 0); >+assert.throws(Test262Error, function() { >+ Atomics.wait(int32Array, 0, 0, poisonedToPrimitive); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-index-throws-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-index-throws-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0873f64eb99c4c6a6b48497198a36b723134bc64 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-index-throws-agent.js >@@ -0,0 +1,86 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ Throws a TypeError if index arg can not be converted to an Integer >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 2. Let i be ? ValidateAtomicAccess(typedArray, index). >+ >+ ValidateAtomicAccess( typedArray, requestIndex ) >+ >+ 2. Let accessIndex be ? ToIndex(requestIndex). >+ >+ ToIndex ( value ) >+ >+ 2. Else, >+ a. Let integerIndex be ? ToInteger(value). >+ >+ ToInteger(value) >+ >+ 1. Let number be ? ToNumber(argument). >+ >+ Symbol --> Throw a TypeError exception. >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+ ` >+var poisonedValueOf = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+var poisonedToPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ throw new Test262Error("passing a poisoned object using @@ToPrimitive"); >+ } >+}; >+ >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ try { >+ Atomics.wait(int32Array, Symbol("1"), poisonedValueOf, poisonedValueOf); >+ } catch (error) { >+ $262.agent.report('Symbol("1")'); >+ } >+ try { >+ Atomics.wait(int32Array, Symbol("2"), poisonedToPrimitive, poisonedToPrimitive); >+ } catch (error) { >+ $262.agent.report('Symbol("2")'); >+ } >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}); >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), 'Symbol("1")'); >+assert.sameValue(getReport(), 'Symbol("2")'); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, "timeout should be a min of 0ms"); >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, "timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON"); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-index-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-index-throws.js >index e9b1ae75699672d582ea9e1913c5edc9d844f1f3..fc8e8d55a15077020e26a11830f1da9c7b297497 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-index-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-index-throws.js >@@ -8,40 +8,53 @@ description: > > info: | > Atomics.wait( typedArray, index, value, timeout ) > >- 3.Let v be ? ToInt32(value). >- ... >- 1.Let number be ? ToNumber(argument). >- Symbol --> Throw a TypeError exception. >-features: [ Atomics, SharedArrayBuffer, TypedArray, Symbol, Symbol.toPrimitive] >+ 2. Let i be ? ValidateAtomicAccess(typedArray, index). >+ >+ ValidateAtomicAccess( typedArray, requestIndex ) >+ >+ 2. Let accessIndex be ? ToIndex(requestIndex). >+ >+ ToIndex ( value ) >+ >+ 2. Else, >+ a. Let integerIndex be ? ToInteger(value). >+ >+ ToInteger(value) >+ >+ 1. Let number be ? ToNumber(argument). >+ >+ Symbol --> Throw a TypeError exception. >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >-var int32Array = new Int32Array(sab); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); > >-var poisoned = { >+var poisonedValueOf = { > valueOf: function() { > throw new Test262Error("should not evaluate this code"); > } > }; > >-var poisonedWithString = { >- get valueOf() { throw "should not evaluate this code"; } >-}; >- > var poisonedToPrimitive = { >- get [Symbol.ToPrimitive]() { >- throw new Test262Error('passing a poisoned object using @@ToPrimitive'); >+ [Symbol.toPrimitive]: function() { >+ throw new Test262Error("passing a poisoned object using @@ToPrimitive"); > } > }; > >-assert.throws(TypeError, function() { >- Atomics.wait(int32Array, Symbol('foo'), poisonedWithString, poisonedWithString) >-}, 'Symbol'); >- > assert.throws(Test262Error, function() { >- Atomics.wait(int32Array, poisoned, poisonedWithString, poisonedWithString) >-}, 'passing a poisoned object using valueOf'); >+ Atomics.wait(int32Array, poisonedValueOf, poisonedValueOf, poisonedValueOf); >+}); > > assert.throws(Test262Error, function() { >- Atomics.wait(int32Array, poisoned, poisonedToPrimitive, poisonedToPrimitive); >-}, 'passing a poisoned object using @@ToPrimitive'); >+ Atomics.wait(int32Array, poisonedToPrimitive, poisonedToPrimitive, poisonedToPrimitive); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, Symbol("foo"), poisonedValueOf, poisonedValueOf); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, Symbol("foo"), poisonedToPrimitive, poisonedToPrimitive); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a6734c6ad15c290c0a167846681c603fe4b04305 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js >@@ -0,0 +1,59 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ Throws a TypeError if index arg can not be converted to an Integer >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 4. Let q be ? ToNumber(timeout). >+ >+ Symbol --> Throw a TypeError exception. >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ try { >+ Atomics.wait(int32Array, 0, 0, Symbol("1")); >+ } catch (error) { >+ $262.agent.report('Symbol("1")'); >+ } >+ try { >+ Atomics.wait(int32Array, 0, 0, Symbol("2")); >+ } catch (error) { >+ $262.agent.report('Symbol("2")'); >+ } >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}); >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), 'Symbol("1")'); >+assert.sameValue(getReport(), 'Symbol("2")'); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, "timeout should be a min of 0ms"); >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, "timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON"); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws.js >index dd003bf5e7da749404a078ed8750c49f8f8fc74e..c133032348062fc7c3a8fd7ca5a9524ec4ba3255 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-timeout-throws.js >@@ -1,48 +1,47 @@ >-// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// Copyright (C) 2018 Amal Hussein. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > > /*--- > esid: sec-atomics.wait > description: > >- Throws a TypeError if timeout arg is a Symbol >+ Throws a TypeError if index arg can not be converted to an Integer > info: | > Atomics.wait( typedArray, index, value, timeout ) > >- 4.Let q be ? ToNumber(timeout). >- ... >- Symbol Throw a TypeError exception. >-features: [Atomics, SharedArrayBuffer, TypedArray, Symbol] >+ 4. Let q be ? ToNumber(timeout). >+ >+ Symbol --> Throw a TypeError exception. >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] > ---*/ > >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) { >- $262.agent.sleep(100); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); >+ >+var poisonedValueOf = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); > } >- return r; >-} >- >-$262.agent.start( >- ` >-$262.agent.receiveBroadcast(function (sab) { >- >- var int32Array = new Int32Array(sab); >- var err; >- >- try { >- Atomics.wait(int32Array, 0, 0, Symbol('foo')); >- } catch(e) { >- err = e.name; >+}; >+ >+var poisonedToPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ throw new Test262Error("passing a poisoned object using @@ToPrimitive"); > } >- >- $262.agent.report(err); >- $262.agent.leaving(); >-}) >-`); >+}; >+ >+assert.throws(Test262Error, function() { >+ Atomics.wait(int32Array, 0, 0, poisonedValueOf); >+}); > >-var sab = new SharedArrayBuffer(4); >-var int32Array = new Int32Array(sab); >+assert.throws(Test262Error, function() { >+ Atomics.wait(int32Array, 0, 0, poisonedToPrimitive); >+}); > >-$262.agent.broadcast(int32Array.buffer); >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, 0, 0, Symbol("foo")); >+}); > >-assert.sameValue(getReport(), 'TypeError'); >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, 0, 0, Symbol("foo")); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-value-throws-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-value-throws-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..701c551f589dd8a3bd51d7e82522b6bae9f89496 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-value-throws-agent.js >@@ -0,0 +1,76 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ Throws a TypeError if value arg is a Symbol >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 3. Let v be ? ToInt32(value). >+ >+ ToInt32(value) >+ >+ 1.Let number be ? ToNumber(argument). >+ >+ Symbol --> Throw a TypeError exception. >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+` >+var poisonedValueOf = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+var poisonedToPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ throw new Test262Error("passing a poisoned object using @@ToPrimitive"); >+ } >+}; >+ >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ try { >+ Atomics.wait(int32Array, 0, Symbol("1"), poisonedValueOf); >+ } catch (error) { >+ $262.agent.report('Symbol("1")'); >+ } >+ try { >+ Atomics.wait(int32Array, 0, Symbol("2"), poisonedToPrimitive); >+ } catch (error) { >+ $262.agent.report('Symbol("2")'); >+ } >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}); >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), 'Symbol("1")'); >+assert.sameValue(getReport(), 'Symbol("2")'); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, "timeout should be a min of 0ms"); >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, "timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON"); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-value-throws.js b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-value-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e4d230da89c2702e3e0f08a1f827c784d79602f6 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/symbol-for-value-throws.js >@@ -0,0 +1,52 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ Throws a TypeError if value arg is a Symbol >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 3. Let v be ? ToInt32(value). >+ >+ ToInt32(value) >+ >+ 1.Let number be ? ToNumber(argument). >+ >+ Symbol --> Throw a TypeError exception. >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+---*/ >+ >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); >+ >+var poisonedValueOf = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+var poisonedToPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ throw new Test262Error("passing a poisoned object using @@ToPrimitive"); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ Atomics.wait(int32Array, 0, poisonedValueOf, poisonedValueOf); >+}); >+ >+assert.throws(Test262Error, function() { >+ Atomics.wait(int32Array, 0, poisonedToPrimitive, poisonedToPrimitive); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, 0, Symbol("foo"), poisonedValueOf); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wait(int32Array, 0, Symbol("foo"), poisonedToPrimitive); >+}); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/true-for-timeout-agent.js b/JSTests/test262/test/built-ins/Atomics/wait/true-for-timeout-agent.js >new file mode 100644 >index 0000000000000000000000000000000000000000..08e712a7d6f0741af57456184d1b62e4ce31e4da >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/true-for-timeout-agent.js >@@ -0,0 +1,68 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ True timeout arg should result in an +0 timeout >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 4. Let q be ? ToNumber(timeout). >+ >+ Boolean -> If argument is true, return 1. If argument is false, return +0. >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+includes: [ atomicsHelper.js ] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+$262.agent.start( >+ ` >+var valueOf = { >+ valueOf: function() { >+ return true; >+ } >+}; >+ >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return true; >+ } >+}; >+ >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ var start = Date.now(); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, true)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, valueOf)); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, toPrimitive)); >+ $262.agent.report(Date.now() - start); >+ $262.agent.leaving(); >+}) >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(150); >+ >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+assert.sameValue(getReport(), 'timed-out'); >+ >+var timeDiffReport = getReport(); >+ >+assert(timeDiffReport >= 0, 'timeout should be a min of 0ms'); >+ >+assert(timeDiffReport <= $ATOMICS_MAX_TIME_EPSILON, 'timeout should be a max of $$ATOMICS_MAX_TIME_EPSILON'); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 0); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/true-for-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/true-for-timeout.js >index fd4f4e62ce724731e2d745ebef781fd9e43c35ac..c099e9d058a2dbc2713e2ac8122788f7f134e6b6 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/true-for-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/true-for-timeout.js >@@ -1,48 +1,37 @@ >-// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// Copyright (C) 2018 Amal Hussein. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > > /*--- > esid: sec-atomics.wait > description: > >- True timeout arg should result in a timeout value of 1 >+ Throws a TypeError if index arg can not be converted to an Integer > info: | > Atomics.wait( typedArray, index, value, timeout ) > >- 4.Let q be ? ToNumber(timeout). >- ... >- Boolean If argument is true, return 1. If argument is false, return +0. >-features: [ Atomics, SharedArrayBuffer, TypedArray ] >-includes: [atomicsHelper.js] >----*/ >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >- return r; >-} >+ 4. Let q be ? ToNumber(timeout). > >+ Boolean -> If argument is true, return 1. If argument is false, return +0. > >-$262.agent.start( >- ` >-$262.agent.receiveBroadcast(function (sab) { >- var int32Array = new Int32Array(sab); >- var start = Date.now(); >- $262.agent.report(Atomics.wait(int32Array, 0, 0, true)); // true => 1 >- $262.agent.report(Date.now() - start); >- $262.agent.leaving(); >-}) >-`); >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+flags: [CanBlockIsFalse] >+---*/ > >-var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); > >-$262.agent.broadcast(int32Array.buffer); >+var valueOf = { >+ valueOf: function() { >+ return true; >+ } >+}; > >-$262.agent.sleep(2); >+var toPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ return true; >+ } >+}; > >-var r1 = getReport(); >-var r2 = getReport(); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, true), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, valueOf), "timed-out"); >+assert.sameValue(Atomics.wait(int32Array, 0, 0, toPrimitive), "timed-out"); > >-assert.sameValue(r1, "timed-out"); >-assert(r2 >= 1, "timeout should be a min of 1ms"); >-assert(r2 <= $ATOMICS_MAX_TIME_EPSILON + 1, "timeout should be a max of $ATOMICS_MAX_TIME_EPSILON + 1ms"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/undefined-for-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/undefined-for-timeout.js >index 1d63d309625ac65cab5cc2031ed4b19912944ee1..4d9ff9054bf118110ed916107d376b4c9bfa2f56 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/undefined-for-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/undefined-for-timeout.js >@@ -12,7 +12,7 @@ info: | > ... > Undefined Return NaN. > 5.If q is NaN, let t be +â, else let t be max(q, 0) >-features: [ Atomics, SharedArrayBuffer, TypedArray ] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > var NUMAGENT = 2; // Total number of agents started >@@ -21,8 +21,9 @@ var WAKECOUNT = 2; // Total number of agents to wake up > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >+ while ((r = $262.agent.getReport()) == null) { > $262.agent.sleep(100); >+ } > return r; > } > >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js b/JSTests/test262/test/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js >index 11604f758ae2120f7b51ed5b04cbe9b818819c98..8e5ecffe33121eb1a0b97b2fc69b1cc1e0ea1a73 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js >@@ -17,19 +17,19 @@ info: | > > If value is undefined, then > Let index be 0. >-features: [ Atomics, SharedArrayBuffer, TypedArray ] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > $262.agent.start( >- ` >-$262.agent.receiveBroadcast(function (sab) { >+` >+$262.agent.receiveBroadcast(function (sab) { > var int32Array = new Int32Array(sab); > $262.agent.report(Atomics.wait(int32Array, undefined, 0, 1000)); // undefined index => 0 > $262.agent.leaving(); > }) > `); > >-var sab = new SharedArrayBuffer(1024); >+var sab = new SharedArrayBuffer(4); > var int32Array = new Int32Array(sab); > > $262.agent.broadcast(int32Array.buffer); >@@ -43,7 +43,8 @@ assert.sameValue(getReport(), "ok"); > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >+ while ((r = $262.agent.getReport()) == null) { > $262.agent.sleep(100); >+ } > return r; > } >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/value-not-equal.js b/JSTests/test262/test/built-ins/Atomics/wait/value-not-equal.js >new file mode 100644 >index 0000000000000000000000000000000000000000..33f25df260c460b28bd81cd886828c6215da29d2 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/value-not-equal.js >@@ -0,0 +1,50 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ Returns "not-equal" when value arg does not match an index in the typedArray >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 3.Let v be ? ToInt32(value). >+ ... >+ 14.If v is not equal to w, then >+ a.Perform LeaveCriticalSection(WL). >+ b. Return the String "not-equal". >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+includes: [atomicsHelper.js] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+var value = 42; >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ >+ $262.agent.report(Atomics.store(int32Array, 0, ${value})); >+ >+ $262.agent.report(Atomics.wait(int32Array, 0, 0)); >+ >+ $262.agent.leaving(); >+}) >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+ >+assert.sameValue(getReport(), value.toString()); >+assert.sameValue(getReport(), "not-equal"); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/wait-index-value-not-equal.js b/JSTests/test262/test/built-ins/Atomics/wait/wait-index-value-not-equal.js >index b40986abc99fa6ec18cd76f75b95564101f237b9..db0ac699f66219698e6e840eac59fc4da02ca448 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/wait-index-value-not-equal.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/wait-index-value-not-equal.js >@@ -12,7 +12,7 @@ info: | > a.Perform LeaveCriticalSection(WL). > b. Return the String "not-equal". > >-features: [ Atomics, SharedArrayBuffer, TypedArray ] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > function getReport() { >@@ -24,12 +24,12 @@ function getReport() { > } > > $262.agent.start( >- ` >+` > $262.agent.receiveBroadcast(function (sab) { > var int32Array = new Int32Array(sab); >- >+ > $262.agent.report(Atomics.wait(int32Array, 0, 44, 1000)); >- >+ > $262.agent.report(Atomics.wait(int32Array, 0, 251.4, 1000)); > > $262.agent.leaving(); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js b/JSTests/test262/test/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8f9c1cfade339e3ddbef3216153885f25470708c >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js >@@ -0,0 +1,62 @@ >+// Copyright (C) 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ Get the correct WaiterList >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ ... >+ 11. Let WL be GetWaiterList(block, indexedPosition). >+ ... >+ >+ >+ GetWaiterList( block, i ) >+ >+ ... >+ 4. Return the WaiterList that is referenced by the pair (block, i). >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(10); >+ } >+ return r; >+} >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function(sab) { >+ var i32 = new Int32Array(sab); >+ >+ // Wait on index 0 >+ Atomics.wait(i32, 0, 0, 200); >+ $262.agent.report("fail"); >+ $262.agent.leaving(); >+}); >+`); >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function(sab) { >+ var i32 = new Int32Array(sab); >+ >+ // Wait on index 2 >+ Atomics.wait(i32, 2, 0, 200); >+ $262.agent.report("pass"); >+ $262.agent.leaving(); >+}); >+`); >+ >+var length = 4 * Int32Array.BYTES_PER_ELEMENT; >+var i32 = new Int32Array(new SharedArrayBuffer(length)); >+ >+$262.agent.broadcast(i32.buffer); >+$262.agent.sleep(10); >+ >+// Wake index 2 >+Atomics.wake(i32, 2, 1); >+ >+assert.sameValue(getReport(), "pass"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js b/JSTests/test262/test/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js >new file mode 100644 >index 0000000000000000000000000000000000000000..161c40e20d7af7f99205e7f345ff78c2c23c680c >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js >@@ -0,0 +1,90 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wait >+description: > >+ New waiters should be applied to the end of the list and woken by order they entered the list (FIFO) >+info: | >+ Atomics.wait( typedArray, index, value, timeout ) >+ >+ 16.Perform AddWaiter(WL, W). >+ ... >+ 3.Add W to the end of the list of waiters in WL. >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ >+var agent1 = '1'; >+var agent2 = '2'; >+var agent3 = '3'; >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ >+ $262.agent.report(${agent1}); >+ Atomics.wait(int32Array, 0, 0); >+ $262.agent.report(${agent1}); >+ >+ $262.agent.leaving(); >+}) >+`); >+ >+$262.agent.start( >+ ` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ >+ $262.agent.report(${agent2}); >+ >+ Atomics.wait(int32Array, 0, 0); >+ $262.agent.report(${agent2}); >+ >+ $262.agent.leaving(); >+}) >+`); >+ >+$262.agent.start( >+ ` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ >+ $262.agent.report(${agent3}); >+ >+ Atomics.wait(int32Array, 0, 0); >+ $262.agent.report(${agent3}); >+ >+ $262.agent.leaving(); >+}) >+`); >+ >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(4)); >+ >+$262.agent.broadcast(int32Array.buffer); >+ >+var orderWhichAgentsWereStarted = getReport() + getReport() + getReport(); // can be started in any order >+ >+assert.sameValue(Atomics.wake(int32Array, 0, 1), 1); >+ >+var orderAgentsWereWoken = getReport(); >+ >+assert.sameValue(Atomics.wake(int32Array, 0, 1), 1); >+ >+orderAgentsWereWoken += getReport(); >+ >+assert.sameValue(Atomics.wake(int32Array, 0, 1), 1); >+ >+orderAgentsWereWoken += getReport(); >+ >+assert.sameValue(orderWhichAgentsWereStarted, orderAgentsWereWoken); // agents should wake in the same order as they were started FIFO >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/was-woken-before-timeout.js b/JSTests/test262/test/built-ins/Atomics/wait/was-woken-before-timeout.js >index 0bf1800ba4b0397456139551055bab32f0693212..0839fbb10cf149b90c67759b1d6d6ea484684562 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/was-woken-before-timeout.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/was-woken-before-timeout.js >@@ -21,34 +21,36 @@ info: | > features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >+var sleeping = 100; > var timeout = 20000; >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ sleeping += 100; >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ > $262.agent.start( >- ` >- $262.agent.receiveBroadcast(function (sab) { >- var int32Array = new Int32Array(sab); >- $262.agent.report(Atomics.wait(int32Array, 0, 0, ${timeout})); >- $262.agent.leaving(); >- }) >- `); >- >- var sab = new SharedArrayBuffer(4); >+` >+$262.agent.receiveBroadcast(function(sab) { > var int32Array = new Int32Array(sab); >- >- var sleeping = 100; >- >- $262.agent.broadcast(int32Array.buffer); >- $262.agent.sleep(sleeping); >- >- assert.sameValue(Atomics.wake(int32Array, 0), 1); >- >- assert.sameValue(getReport(), "ok"); >- assert(sleeping < timeout, "this test assumes it won't last for more than 20 seconds"); >- >- function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) { >- sleeping += 100; >- $262.agent.sleep(100); >- } >- return r; >- } >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, ${timeout})); >+ $262.agent.leaving(); >+}); >+`); >+ >+var sab = new SharedArrayBuffer(4); >+var int32Array = new Int32Array(sab); >+ >+ >+$262.agent.broadcast(int32Array.buffer); >+$262.agent.sleep(sleeping); >+ >+assert.sameValue(Atomics.wake(int32Array, 0), 1); >+ >+assert.sameValue(getReport(), "ok"); >+assert(sleeping < timeout, "this test assumes it won't last for more than 20 seconds"); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wait/was-woken.js b/JSTests/test262/test/built-ins/Atomics/wait/was-woken.js >index 18916a934565c2863332a28e7c92ec275589734a..ccb180f5aebccd6c3ca378b5796fbe0cbedc3e9b 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wait/was-woken.js >+++ b/JSTests/test262/test/built-ins/Atomics/wait/was-woken.js >@@ -5,16 +5,24 @@ > esid: sec-atomics.wait > description: > > Test that Atomics.wait returns the right result when it was awoken. >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >+ > $262.agent.start( > ` > $262.agent.receiveBroadcast(function (sab, id) { > var ia = new Int32Array(sab); > $262.agent.report(Atomics.wait(ia, 0, 0)); // No timeout => Infinity > $262.agent.leaving(); >-}) >+}); > `); > > var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >@@ -23,11 +31,3 @@ $262.agent.broadcast(ia.buffer); > $262.agent.sleep(500); // Give the agent a chance to wait > Atomics.wake(ia, 0); > assert.sameValue(getReport(), "ok"); >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) { >- $262.agent.sleep(100); >- } >- return r; >-} >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/bad-range.js b/JSTests/test262/test/built-ins/Atomics/wake/bad-range.js >index 248501b53e01629831f5dfc6ac08b5490f3abc1b..5e8bd9c1652c4ce4409f63f1ba774de15fd6d773 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/bad-range.js >@@ -5,8 +5,14 @@ > esid: sec-atomics.wake > description: > > Test range checking of Atomics.wake on arrays that allow atomic operations >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ .. >+ > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(8); >@@ -14,12 +20,12 @@ var views = [Int32Array]; > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(sab); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.wake(view, Idx, 0)); // Even with waking zero >+ assert.throws(RangeError, () => Atomics.wake(view, IdxGen(view), 0)); // Even with waking zero > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/count-boundary-cases.js b/JSTests/test262/test/built-ins/Atomics/wake/count-boundary-cases.js >new file mode 100644 >index 0000000000000000000000000000000000000000..23c32180d3c32b593595b56058788a2ed22abfe2 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/count-boundary-cases.js >@@ -0,0 +1,36 @@ >+// Copyright (C) 2017 Mozilla Corporation. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Allowed boundary cases for 'count' argument to Atomics.wake >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ ... >+ 3. If count is undefined, let c be +â. >+ 4. Else, >+ a. Let intCount be ? ToInteger(count). >+ ... >+ >+ ToInteger ( argument ) >+ >+ 1. Let number be ? ToNumber(argument). >+ 2. If number is NaN, return +0. >+ 3. If number is +0, -0, +â, or -â, return number. >+ 4. Return the number value that is the same sign as number >+ and whose magnitude is floor(abs(number)). >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var sab = new SharedArrayBuffer(4); >+var view = new Int32Array(sab); >+ >+assert.sameValue(Atomics.wake(view, 0, -3), 0); >+assert.sameValue(Atomics.wake(view, 0, Number.POSITIVE_INFINITY), 0); >+assert.sameValue(Atomics.wake(view, 0, undefined), 0); >+assert.sameValue(Atomics.wake(view, 0, "33"), 0); >+assert.sameValue(Atomics.wake(view, 0, { valueOf: 8 }), 0); >+assert.sameValue(Atomics.wake(view, 0), 0); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-missing.js b/JSTests/test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-missing.js >new file mode 100644 >index 0000000000000000000000000000000000000000..5f3bd8da7414d19a53808759961bfb524753786d >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-missing.js >@@ -0,0 +1,78 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Default to +Infinity when missing 'count' argument to Atomics.wake >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ ... >+ 3. If count is undefined, let c be +â. >+ ... >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var NUMAGENT = 4; // Total number of agents started >+var WAKEUP = 0; // Index all agents are waiting on >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(10); >+ } >+ return r; >+} >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("A " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("B " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("C " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("D " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+ >+$262.agent.sleep(20); >+ >+assert.sameValue(Atomics.wake(int32Array, WAKEUP /*, count missing */), NUMAGENT); >+ >+var sortedReports = []; >+for (var i = 0; i < NUMAGENT; i++) { >+ sortedReports.push(getReport()); >+} >+sortedReports.sort(); >+ >+assert.sameValue(sortedReports[0], "A ok"); >+assert.sameValue(sortedReports[1], "B ok"); >+assert.sameValue(sortedReports[2], "C ok"); >+assert.sameValue(sortedReports[3], "D ok"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-undefined.js b/JSTests/test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-undefined.js >new file mode 100644 >index 0000000000000000000000000000000000000000..45cf76435118b30c3e416c9ef32f48181c8fb21a >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/count-defaults-to-infinity-undefined.js >@@ -0,0 +1,77 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Undefined count arg should result in an infinite count >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 3.If count is undefined, let c be +â. >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var NUMAGENT = 4; // Total number of agents started >+var WAKEUP = 0; // Index all agents are waiting on >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) >+ $262.agent.sleep(10); >+ return r; >+} >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("A " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("B " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("C " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+ >+$262.agent.start(` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report("D " + Atomics.wait(int32Array, ${WAKEUP}, 0, 50)); >+ $262.agent.leaving(); >+}); >+`); >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(int32Array.buffer); >+ >+$262.agent.sleep(20); // half of timeout >+ >+assert.sameValue(Atomics.wake(int32Array, WAKEUP, undefined), NUMAGENT); >+ >+var sortedReports = []; >+for (var i = 0; i < NUMAGENT; i++) { >+ sortedReports.push(getReport()); >+} >+sortedReports.sort(); >+ >+assert.sameValue(sortedReports[0], "A ok"); >+assert.sameValue(sortedReports[1], "B ok"); >+assert.sameValue(sortedReports[2], "C ok"); >+assert.sameValue(sortedReports[3], "D ok"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/count-from-nans.js b/JSTests/test262/test/built-ins/Atomics/wake/count-from-nans.js >new file mode 100644 >index 0000000000000000000000000000000000000000..21e234bf943898a01457a4204f983442fbb4a5ba >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/count-from-nans.js >@@ -0,0 +1,32 @@ >+// Copyright (C) 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ NaNs are converted to 0 for 'count' argument to Atomics.wake >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ ... >+ 3. If count is undefined, let c be +â. >+ 4. Else, >+ a. Let intCount be ? ToInteger(count). >+ ... >+ >+ ToInteger ( argument ) >+ >+ ... >+ 2. If number is NaN, return +0. >+ ... >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+includes: [nans.js] >+---*/ >+ >+var sab = new SharedArrayBuffer(4); >+var view = new Int32Array(sab); >+ >+NaNs.forEach(nan => { >+ assert.sameValue(Atomics.wake(view, 0, nan), 0); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/count-symbol-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/count-symbol-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..4edad8c342b65c633bf1d73d42eb9ec06717b428 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/count-symbol-throws.js >@@ -0,0 +1,25 @@ >+// Copyright (C) 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Return abrupt when symbol passed for 'count' argument to Atomics.wake >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ ... >+ 3. If count is undefined, let c be +â. >+ 4. Else, >+ a. Let intCount be ? ToInteger(count). >+ ... >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var sab = new SharedArrayBuffer(4); >+var view = new Int32Array(sab); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(view, 0, Symbol()); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/count-tointeger-throws-then-wake-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/count-tointeger-throws-then-wake-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..83ed31f958927596aacd309ebb9717c6b5fd3337 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/count-tointeger-throws-then-wake-throws.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Return abrupt when ToInteger throws an exception on 'count' argument to Atomics.wake >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ ... >+ 3. If count is undefined, let c be +â. >+ 4. Else, >+ a. Let intCount be ? ToInteger(count). >+ ... >+ >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var sab = new SharedArrayBuffer(4); >+var view = new Int32Array(sab); >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ Atomics.wake(view, 0, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/counts.js b/JSTests/test262/test/built-ins/Atomics/wake/counts.js >deleted file mode 100644 >index c361763f47de97d1aa14f6fd751f72497886584a..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Atomics/wake/counts.js >+++ /dev/null >@@ -1,19 +0,0 @@ >-// Copyright (C) 2017 Mozilla Corporation. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-esid: sec-atomics.wake >-description: > >- Allowed boundary cases of the third 'count' argument to Atomics.wake >-features: [Atomics] >----*/ >- >-var sab = new SharedArrayBuffer(4); >-var view = new Int32Array(sab); >- >-assert.sameValue(Atomics.wake(view, 0, -3), 0); >-assert.sameValue(Atomics.wake(view, 0, Number.POSITIVE_INFINITY), 0); >-assert.sameValue(Atomics.wake(view, 0, undefined), 0); >-assert.sameValue(Atomics.wake(view, 0, "33"), 0); >-assert.sameValue(Atomics.wake(view, 0, { valueOf: 8 }), 0); >-assert.sameValue(Atomics.wake(view, 0), 0); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/good-views.js b/JSTests/test262/test/built-ins/Atomics/wake/good-views.js >index 19ad2f2b3760e74cb30da21dfe5e234c93c8fdff..72ace0788aedcacc8bfe85a7328c95cdd75e6ed1 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/good-views.js >@@ -7,12 +7,10 @@ description: > > Test Atomics.wait on arrays that allow atomic operations, > in an Agent that is allowed to wait. There is only the one Agent. > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); >-var ab = new ArrayBuffer(16); >-var int_views = [Int32Array]; > var view = new Int32Array(sab, 32, 20); > > view[0] = 0; >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/negative-count.js b/JSTests/test262/test/built-ins/Atomics/wake/negative-count.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e1790d81c02bbdaf3926b571996c657715eb90bf >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/negative-count.js >@@ -0,0 +1,32 @@ >+// Copyright (C) 2017 Mozilla Corporation. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Test that Atomics.wake wakes zero waiters if the count is negative >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function (sab) { >+ var ia = new Int32Array(sab); >+ $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually >+ $262.agent.leaving(); >+}) >+`); >+ >+var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >+ >+$262.agent.broadcast(ia.buffer); >+$262.agent.sleep(500); // Give the agent a chance to wait >+assert.sameValue(Atomics.wake(ia, 0, -1), 0); // Don't actually wake it >+assert.sameValue(getReport(), "timed-out"); >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) >+ $262.agent.sleep(100); >+ return r; >+} >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/negative-index-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/negative-index-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..52b875561afae36b39b7287c0c51c5b7a1ac7fd5 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/negative-index-throws.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Throws a RangeError is index < 0 >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 2.Let i be ? ValidateAtomicAccess(typedArray, index). >+ ... >+ 2.Let accessIndex be ? ToIndex(requestIndex). >+ ... >+ 2.b If integerIndex < 0, throw a RangeError exception >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var sab = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(sab); >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(RangeError, () => Atomics.wake(int32Array, -Infinity, poisoned)); >+assert.throws(RangeError, () => Atomics.wake(int32Array, -7.999, poisoned)); >+assert.throws(RangeError, () => Atomics.wake(int32Array, -1, poisoned)); >+assert.throws(RangeError, () => Atomics.wake(int32Array, -300, poisoned)); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/non-int32-typedarray-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/non-int32-typedarray-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d7b9e547aed6953e809e1e50332ce702604ebeb5 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/non-int32-typedarray-throws.js >@@ -0,0 +1,54 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Throws a TypeError if typedArray arg is not an Int32Array >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ ... >+ 5.If onlyInt32 is true, then >+ If typeName is not "Int32Array", throw a TypeError exception. >+features: [Atomics, Float32Array, Float64Array, Int8Array, TypedArray, Uint16Array, Uint8Array, Uint8ClampedArray] >+---*/ >+ >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(new Float64Array(), poisoned, poisoned); >+}, 'Float64Array'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(new Float32Array(), poisoned, poisoned); >+}, 'Float32Array'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(new Int16Array(), poisoned, poisoned); >+}, 'Int16Array'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(new Int8Array(), poisoned, poisoned); >+}, 'Int8Array'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(new Uint32Array(), poisoned, poisoned); >+}, 'Uint32Array'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(new Uint16Array(), poisoned, poisoned); >+}, 'Uint16Array'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wait(new Uint8Array(), poisoned, poisoned); >+}, 'Uint8Array'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(new Uint8ClampedArray(), poisoned, poisoned); >+}, 'Uint8ClampedArray'); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/non-shared-bufferdata-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/non-shared-bufferdata-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..aec2cdb08ba048af541b1942d2212881b1279ff6 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/non-shared-bufferdata-throws.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-atomics.wake >+description: > >+ Throws a TypeError if typedArray.buffer is not a SharedArrayBuffer >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ ... >+ 9.If IsSharedArrayBuffer(buffer) is false, throw a TypeError exception. >+ ... >+ 4.If bufferData is a Data Block, return false. >+features: [ArrayBuffer, Atomics, TypedArray] >+---*/ >+ >+var int32Array = new Int32Array(new ArrayBuffer(4)); >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(int32Array, 0, 0) >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(int32Array, poisoned, poisoned) >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/non-views.js b/JSTests/test262/test/built-ins/Atomics/wake/non-views.js >index 91461303b1e81761b6b39aa1f9c2304ebfffe471..aaffd003094eac80ca2850ced1f8ea635b777cf7 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.wake > description: > > Test Atomics.wake on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/wake/nonshared-int-views.js >index 87a337f8d6f944c7f7d84bc962bd743a2cd07412..b49611e58cfa7d8fcd3bcef456346f5a8a51e6cf 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/nonshared-int-views.js >@@ -6,20 +6,18 @@ esid: sec-atomics.wake > description: > > Test Atomics.wake on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.wake(view, 0, 0))); // Should fail even if waking zero waiters >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ // Should fail even if waking zero waiters >+ assert.throws(TypeError, (() => Atomics.wake(new TA(buffer), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/not-a-typedarray-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/not-a-typedarray-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7acf27e8c02c790a7e04bcc71caeae0d7ae2ecbe >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/not-a-typedarray-throws.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-atomics.wake >+description: > >+ Throws a TypeError if the typedArray arg is not a TypedArray object >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ ... >+ 3.If typedArray does not have a [[TypedArrayName]] internal slot, throw a TypeError exception. >+ >+features: [Atomics] >+---*/ >+ >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(TypeError, function() { >+ Atomics.wait({}, 0, 0, 0); >+}); >+ >+assert.throws(TypeError, function () { >+ Atomics.wait({}, poisoned, poisoned, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/not-an-object-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/not-an-object-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b8ca158b4fad03d57bf5424552e94dfbfccce6a6 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/not-an-object-throws.js >@@ -0,0 +1,48 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-atomics.wake >+description: > >+ Throws a TypeError if typedArray arg is not an Object >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ ... >+ 2. if Type(typedArray) is not Object, throw a TypeError exception >+features: [Atomics, Symbol] >+---*/ >+ >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(null, poisoned, poisoned); >+}, 'null'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(undefined, poisoned, poisoned); >+}, 'undefined'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(true, poisoned, poisoned); >+}, 'true'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(false, poisoned, poisoned); >+}, 'false'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake('***string***', poisoned, poisoned); >+}, 'String'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(Number.NEGATIVE_INFINITY, poisoned, poisoned); >+}, '-Infinity'); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(Symbol('***symbol***'), poisoned, poisoned); >+}, 'Symbol'); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/null-bufferdata-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/null-bufferdata-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ad38f7432e8830c233b2b7beb9bcd4f56b2fb987 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/null-bufferdata-throws.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-atomics.wake >+description: > >+ A null value for bufferData throws a TypeError >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). >+ ... >+ 9.If IsSharedArrayBuffer(buffer) is false, throw a TypeError exception. >+ ... >+ 3.If bufferData is null, return false. >+includes: [detachArrayBuffer.js] >+features: [ArrayBuffer, Atomics, TypedArray] >+---*/ >+ >+var int32Array = new Int32Array(new ArrayBuffer(1024)); >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+$DETACHBUFFER(int32Array.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(int32Array, poisoned, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/out-of-range-index-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/out-of-range-index-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b48b090dc650235193aaa8b8bb580a7f60315a20 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/out-of-range-index-throws.js >@@ -0,0 +1,34 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Throws a RangeError if value of index arg is out of range >+ info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 2.Let i be ? ValidateAtomicAccess(typedArray, index). >+ ... >+ 2.Let accessIndex be ? ToIndex(requestIndex). >+ ... >+ 5. If accessIndex ⥠length, throw a RangeError exception. >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+var int32Array = new Int32Array(new SharedArrayBuffer(4)); >+var poisoned = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+assert.throws(RangeError, function() { >+ Atomics.wake(int32Array, Infinity, poisoned); >+}); >+assert.throws(RangeError, function() { >+ Atomics.wake(int32Array, 2, poisoned); >+}); >+assert.throws(RangeError, function() { >+ Atomics.wake(int32Array, 200, poisoned); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/wake/shared-nonint-views.js >index 353ffedd50fed75474faf34ec8e25bfb5931b3b2..727e2e5eaa100cf7614ce77fc292145c2f3ea550 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/shared-nonint-views.js >@@ -6,17 +6,14 @@ esid: sec-atomics.wake > description: > > Test Atomics.wake on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); >+ >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.wake(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); > >-var other_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Uint32Array, >- Uint8ClampedArray, Float32Array, Float64Array]; > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); > >- // Even with timout zero this should fail >- assert.throws(TypeError, (() => Atomics.wake(view, 0, 0))); // Even with 0 to wake this should fail >-}, other_views); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/symbol-for-index-throws.js b/JSTests/test262/test/built-ins/Atomics/wake/symbol-for-index-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..cdd0a1145fbec98348430e2eb6ee76c421931ac4 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/symbol-for-index-throws.js >@@ -0,0 +1,60 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Return abrupt when ToInteger throws for 'index' argument to Atomics.wake >+info: | >+ Atomics.wake( typedArray, index, value, timeout ) >+ >+ 2. Let i be ? ValidateAtomicAccess(typedArray, index). >+ >+ ValidateAtomicAccess( typedArray, requestIndex ) >+ >+ 2. Let accessIndex be ? ToIndex(requestIndex). >+ >+ ToIndex ( value ) >+ >+ 2. Else, >+ a. Let integerIndex be ? ToInteger(value). >+ >+ ToInteger(value) >+ >+ 1. Let number be ? ToNumber(argument). >+ >+ Symbol --> Throw a TypeError exception. >+ >+features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray] >+---*/ >+ >+var buffer = new SharedArrayBuffer(1024); >+var int32Array = new Int32Array(buffer); >+ >+var poisonedValueOf = { >+ valueOf: function() { >+ throw new Test262Error("should not evaluate this code"); >+ } >+}; >+ >+var poisonedToPrimitive = { >+ [Symbol.toPrimitive]: function() { >+ throw new Test262Error("passing a poisoned object using @@ToPrimitive"); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ Atomics.wake(int32Array, poisonedValueOf, poisonedValueOf); >+}); >+ >+assert.throws(Test262Error, function() { >+ Atomics.wake(int32Array, poisonedToPrimitive, poisonedToPrimitive); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(int32Array, Symbol("foo"), poisonedValueOf); >+}); >+ >+assert.throws(TypeError, function() { >+ Atomics.wake(int32Array, Symbol("foo"), poisonedToPrimitive); >+}); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/undefined-index-defaults-to-zero.js b/JSTests/test262/test/built-ins/Atomics/wake/undefined-index-defaults-to-zero.js >new file mode 100644 >index 0000000000000000000000000000000000000000..aeb452720d0d9f5323a607b31b2be82969113eae >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/undefined-index-defaults-to-zero.js >@@ -0,0 +1,63 @@ >+// Copyright (C) 2018 Amal Hussein. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ An undefined index arg should translate to 0 >+info: | >+ Atomics.wake( typedArray, index, count ) >+ >+ 2.Let i be ? ValidateAtomicAccess(typedArray, index). >+ ... >+ 2.Let accessIndex be ? ToIndex(requestIndex). >+ >+ 9.If IsSharedArrayBuffer(buffer) is false, throw a TypeError exception. >+ ... >+ 3.If bufferData is a Data Block, return false >+ >+ If value is undefined, then >+ Let index be 0. >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+$262.agent.start( >+ ` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, 200)); >+ $262.agent.leaving(); >+}) >+ >+ >+`) >+ >+;$262.agent.start( >+ ` >+$262.agent.receiveBroadcast(function (sab) { >+ var int32Array = new Int32Array(sab); >+ $262.agent.report(Atomics.wait(int32Array, 0, 0, 200)); >+ $262.agent.leaving(); >+}) >+`); >+ >+var sab = new SharedArrayBuffer(4); >+var int32Array = new Int32Array(sab); >+ >+$262.agent.broadcast(int32Array.buffer); >+ >+$262.agent.sleep(100); // halfway through timeout >+ >+assert.sameValue(Atomics.wake(int32Array, undefined, 1), 1); // wake at index 0 >+assert.sameValue(getReport(), "ok"); >+ >+assert.sameValue(Atomics.wake(int32Array), 1); // wake again at index 0 >+assert.sameValue(getReport(), "ok"); >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(100); >+ } >+ return r; >+} >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-all-on-loc.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-all-on-loc.js >index 52b878ecbeb4ffa9ab2c765757d403473c43abaa..ee404925c64d409bdc0aac229538910f96ce8901 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-all-on-loc.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-all-on-loc.js >@@ -6,7 +6,7 @@ esid: sec-atomics.wake > description: > > Test that Atomics.wake wakes all waiters on a location, but does not > wake waiters on other locations. >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > var WAKEUP = 0; // Waiters on this will be woken >@@ -34,7 +34,7 @@ $262.agent.receiveBroadcast(function (sab) { > var ia = new Int32Array(sab); > Atomics.add(ia, ${RUNNING}, 1); > // This will always time out. >- $262.agent.report("B " + Atomics.wait(ia, ${DUMMY}, 0, 1000)); >+ $262.agent.report("B " + Atomics.wait(ia, ${DUMMY}, 0, 10)); > $262.agent.leaving(); > }) > `); >@@ -47,31 +47,34 @@ waitUntil(ia, RUNNING, NUMAGENT + 1); > > // Then wait some more to give the agents a fair chance to wait. If we don't, > // we risk sending the wakeup before agents are sleeping, and we hang. >-$262.agent.sleep(500); >+$262.agent.sleep(50); > > // Wake all waiting on WAKEUP, should be 3 always, they won't time out. > assert.sameValue(Atomics.wake(ia, WAKEUP), NUMAGENT); > > var rs = []; >-for (var i = 0; i < NUMAGENT + 1; i++) >+for (var i = 0; i < NUMAGENT + 1; i++) { > rs.push(getReport()); >+} > rs.sort(); > >-for (var i = 0; i < NUMAGENT; i++) >+for (var i = 0; i < NUMAGENT; i++) { > assert.sameValue(rs[i], "A ok"); >+} > assert.sameValue(rs[NUMAGENT], "B timed-out"); > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(10); >+ } > return r; > } > > function waitUntil(ia, k, value) { > var i = 0; > while (Atomics.load(ia, k) !== value && i < 15) { >- $262.agent.sleep(100); >+ $262.agent.sleep(10); > i++; > } > assert.sameValue(Atomics.load(ia, k), value, "All agents are running"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-all.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-all.js >index 969733f85374d9a1f223d708058d272842d42fa3..2ea493456d7533802c3c7ed46233c718d6dd8d45 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-all.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-all.js >@@ -5,7 +5,7 @@ > esid: sec-atomics.wake > description: > > Test that Atomics.wake wakes all waiters if that's what the count is. >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > var WAKEUP = 0; // Waiters on this will be woken >@@ -33,7 +33,7 @@ $262.agent.receiveBroadcast(function (sab) { > var ia = new Int32Array(sab); > Atomics.add(ia, ${RUNNING}, 1); > // This will always time out. >- $262.agent.report("B " + Atomics.wait(ia, ${DUMMY}, 0, 1000)); >+ $262.agent.report("B " + Atomics.wait(ia, ${DUMMY}, 0, 10)); > $262.agent.leaving(); > }) > `); >@@ -46,31 +46,34 @@ waitUntil(ia, RUNNING, NUMAGENT + 1); > > // Then wait some more to give the agents a fair chance to wait. If we don't, > // we risk sending the wakeup before agents are sleeping, and we hang. >-$262.agent.sleep(500); >+$262.agent.sleep(50); > > // Wake all waiting on WAKEUP, should be 3 always, they won't time out. > assert.sameValue(Atomics.wake(ia, WAKEUP), NUMAGENT); > > var rs = []; >-for (var i = 0; i < NUMAGENT + 1; i++) >+for (var i = 0; i < NUMAGENT + 1; i++) { > rs.push(getReport()); >+} > rs.sort(); > >-for (var i = 0; i < NUMAGENT; i++) >+for (var i = 0; i < NUMAGENT; i++) { > assert.sameValue(rs[i], "A ok"); >+} > assert.sameValue(rs[NUMAGENT], "B timed-out"); > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(10); >+ } > return r; > } > > function waitUntil(ia, k, value) { > var i = 0; > while (Atomics.load(ia, k) !== value && i < 15) { >- $262.agent.sleep(100); >+ $262.agent.sleep(10); > i++; > } > assert.sameValue(Atomics.load(ia, k), value, "All agents are running"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-in-order.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-in-order.js >index caaedb63d113c09130041ae49c5472ad4bee0b83..5e09afdc9c5516f0561b4f23829e45687d4a5e24 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-in-order.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-in-order.js >@@ -5,7 +5,7 @@ > esid: sec-atomics.wake > description: > > Test that Atomics.wake wakes agents in the order they are waiting. >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > var NUMAGENT = 3; >@@ -41,12 +41,12 @@ waitUntil(ia, RUNNING, NUMAGENT); > > // Then wait some more to give the agents a fair chance to wait. If we don't, > // we risk sending the wakeup before agents are sleeping, and we hang. >-$262.agent.sleep(500); >+$262.agent.sleep(50); > > // Make them sleep in order 0 1 2 on ia[0] > for (var i = 0; i < NUMAGENT; i++) { > Atomics.store(ia, SPIN + i, 1); >- $262.agent.sleep(500); >+ $262.agent.sleep(50); > } > > // Wake them up one at a time and check the order is 0 1 2 >@@ -57,15 +57,16 @@ for (var i = 0; i < NUMAGENT; i++) { > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(10); >+ } > return r; > } > > function waitUntil(ia, k, value) { > var i = 0; > while (Atomics.load(ia, k) !== value && i < 15) { >- $262.agent.sleep(100); >+ $262.agent.sleep(10); > i++; > } > assert.sameValue(Atomics.load(ia, k), value, "All agents are running"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-nan.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-nan.js >index 9ef59d474de0c264e2aad572c44adbf83079be07..9c7f93537da32a3128525f68ddc198b92d5bab20 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-nan.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-nan.js >@@ -5,7 +5,7 @@ > esid: sec-atomics.wake > description: > > Test that Atomics.wake wakes zero waiters if the count is NaN >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > $262.agent.start( >@@ -26,7 +26,8 @@ assert.sameValue(getReport(), "timed-out"); > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >+ while ((r = $262.agent.getReport()) == null) { > $262.agent.sleep(100); >+ } > return r; > } >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-negative.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-negative.js >deleted file mode 100644 >index 038fe7ed37a761c3322e0b6940a384edde375dd6..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-negative.js >+++ /dev/null >@@ -1,32 +0,0 @@ >-// Copyright (C) 2017 Mozilla Corporation. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-esid: sec-atomics.wake >-description: > >- Test that Atomics.wake wakes zero waiters if the count is negative >-features: [Atomics] >----*/ >- >-$262.agent.start( >-` >-$262.agent.receiveBroadcast(function (sab) { >- var ia = new Int32Array(sab); >- $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually >- $262.agent.leaving(); >-}) >-`); >- >-var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); >- >-$262.agent.broadcast(ia.buffer); >-$262.agent.sleep(500); // Give the agent a chance to wait >-assert.sameValue(Atomics.wake(ia, 0, -1), 0); // Don't actually wake it >-assert.sameValue(getReport(), "timed-out"); >- >-function getReport() { >- var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >- return r; >-} >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-one.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-one.js >index 44a8279540296e0f1db25a3efd2127a6251d2338..b19a44fce1b8e6d0f21ded123edb074399379485 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-one.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-one.js >@@ -5,7 +5,7 @@ > esid: sec-atomics.wake > description: > > Test that Atomics.wake wakes one waiter if that's what the count is. >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > var NUMAGENT = 3; >@@ -37,7 +37,7 @@ waitUntil(ia, RUNNING, NUMAGENT); > > // Then wait some more to give the agents a fair chance to wait. If we don't, > // we risk sending the wakeup before agents are sleeping, and we hang. >-$262.agent.sleep(500); >+$262.agent.sleep(50); > > // There's a slight risk we'll fail to wake the desired count, if the preceding > // sleep() took much longer than anticipated and workers have started timing >@@ -46,26 +46,30 @@ assert.sameValue(Atomics.wake(ia, 0, WAKECOUNT), WAKECOUNT); > > // Collect and check results > var rs = []; >-for (var i = 0; i < NUMAGENT; i++) >+for (var i = 0; i < NUMAGENT; i++) { > rs.push(getReport()); >+} > rs.sort(); > >-for (var i = 0; i < WAKECOUNT; i++) >+for (var i = 0; i < WAKECOUNT; i++) { > assert.sameValue(rs[i], "ok"); >-for (var i = WAKECOUNT; i < NUMAGENT; i++) >+} >+for (var i = WAKECOUNT; i < NUMAGENT; i++) { > assert.sameValue(rs[i], "timed-out"); >+} > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(10); >+ } > return r; > } > > function waitUntil(ia, k, value) { > var i = 0; > while (Atomics.load(ia, k) !== value && i < 15) { >- $262.agent.sleep(100); >+ $262.agent.sleep(10); > i++; > } > assert.sameValue(Atomics.load(ia, k), value, "All agents are running"); >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-rewake-noop.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-rewake-noop.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0dfeb3b95b082b49deeda576bf82a520b11c800e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-rewake-noop.js >@@ -0,0 +1,54 @@ >+// Copyright (C) 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Test that Atomics.wake on awoken waiter is a noop. >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+function getReport() { >+ var r; >+ while ((r = $262.agent.getReport()) == null) { >+ $262.agent.sleep(10); >+ } >+ return r; >+} >+ >+function waitUntil(ia, k, value) { >+ var i = 0; >+ while (Atomics.load(ia, k) !== value && i < 15) { >+ $262.agent.sleep(10); >+ i++; >+ } >+ assert.sameValue(Atomics.load(ia, k), value, "All agents are running"); >+} >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function(sab) { >+ var ia = new Int32Array(sab); >+ Atomics.add(ia, 1, 1); >+ $262.agent.report(Atomics.wait(ia, 0, 0, 2000)); >+ $262.agent.leaving(); >+}) >+`); >+ >+var ia = new Int32Array(new SharedArrayBuffer(2 * Int32Array.BYTES_PER_ELEMENT)); >+$262.agent.broadcast(ia.buffer); >+ >+waitUntil(ia, 1, 1); >+ >+assert.sameValue(Atomics.wake(ia, 0, 1), 1); >+ >+$262.agent.sleep(10); >+ >+// Collect and check results >+var report = getReport(); >+ >+assert.sameValue(report, "ok"); >+ >+// Already awake, this should be a noop >+assert.sameValue(Atomics.wake(ia, 0, 1), 0); >+ >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-two.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-two.js >index 8c3b0643232718c93bd079eb66926ea499875203..6ca7c52e73de1385c292571238e82c33753383bf 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-two.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-two.js >@@ -5,7 +5,7 @@ > esid: sec-atomics.wake > description: > > Test that Atomics.wake wakes two waiters if that's what the count is. >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > > >@@ -47,19 +47,23 @@ assert.sameValue(Atomics.wake(ia, 0, WAKECOUNT), WAKECOUNT); > > // Collect and check results > var rs = []; >-for (var i = 0; i < NUMAGENT; i++) >+for (var i = 0; i < NUMAGENT; i++) { > rs.push(getReport()); >+} > rs.sort(); > >-for (var i = 0; i < WAKECOUNT; i++) >+for (var i = 0; i < WAKECOUNT; i++) { > assert.sameValue(rs[i], "ok"); >-for (var i = WAKECOUNT; i < NUMAGENT; i++) >+} >+for (var i = WAKECOUNT; i < NUMAGENT; i++) { > assert.sameValue(rs[i], "timed-out"); >+} > > function getReport() { > var r; >- while ((r = $262.agent.getReport()) == null) >+ while ((r = $262.agent.getReport()) == null) { > $262.agent.sleep(100); >+ } > return r; > } > >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a5fabee90ec4b313a25c989083fd5074ca3c4da5 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-with-no-agents-waiting.js >@@ -0,0 +1,36 @@ >+// Copyright (C) 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Test that Atomics.wake wakes zero waiters if there are no agents waiting. >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function (sab) { >+ var ia = new Int32Array(sab); >+ Atomics.add(ia, 1, 1); >+ $262.agent.leaving(); >+}) >+`); >+ >+var ia = new Int32Array(new SharedArrayBuffer(2 * Int32Array.BYTES_PER_ELEMENT)); >+$262.agent.broadcast(ia.buffer); >+ >+waitUntil(ia, 1); >+ >+// There are ZERO agents waiting to wake... >+assert.sameValue(Atomics.wake(ia, 0, 1), 0); >+ >+function waitUntil(ia, k) { >+ var i = 0; >+ while (Atomics.load(ia, k) !== 1 && i < 15) { >+ $262.agent.sleep(100); >+ i++; >+ } >+ assert.sameValue(Atomics.load(ia, k), 1, "All agents are running"); >+} >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a88f349e607c4cef24a2232092ae19e6aeb1eb58 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-with-no-matching-agents-waiting.js >@@ -0,0 +1,37 @@ >+// Copyright (C) 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-atomics.wake >+description: > >+ Test that Atomics.wake wakes zero waiters if there are no agents that match >+ its arguments waiting. >+features: [Atomics, SharedArrayBuffer, TypedArray] >+---*/ >+ >+ >+$262.agent.start( >+` >+$262.agent.receiveBroadcast(function (sab) { >+ var ia = new Int32Array(sab); >+ Atomics.add(ia, 1, 1); >+ $262.agent.leaving(); >+}) >+`); >+ >+var ia = new Int32Array(new SharedArrayBuffer(2 * Int32Array.BYTES_PER_ELEMENT)); >+$262.agent.broadcast(ia.buffer); >+ >+waitUntil(ia, 1); >+ >+// There are ZERO matching agents... >+assert.sameValue(Atomics.wake(ia, 1, 1), 0); >+ >+function waitUntil(ia, k) { >+ var i = 0; >+ while (Atomics.load(ia, k) !== 1 && i < 15) { >+ $262.agent.sleep(100); >+ i++; >+ } >+ assert.sameValue(Atomics.load(ia, k), 1, "All agents are running"); >+} >diff --git a/JSTests/test262/test/built-ins/Atomics/wake/wake-zero.js b/JSTests/test262/test/built-ins/Atomics/wake/wake-zero.js >index 40ad8e0fafd338d18ed9cef6b0043f6017952438..a82ab8415c5520a9a8bff2549da59ff0d9803c1d 100644 >--- a/JSTests/test262/test/built-ins/Atomics/wake/wake-zero.js >+++ b/JSTests/test262/test/built-ins/Atomics/wake/wake-zero.js >@@ -5,12 +5,10 @@ > esid: sec-atomics.wake > description: > > Test that Atomics.wake wakes zero waiters if that's what the count is. >-features: [Atomics] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >- > var NUMAGENT = 3; >- > var WAKEUP = 0; // Agents wait here > var RUNNING = 1; // Accounting of live agents here > var NUMELEM = 2; >@@ -24,7 +22,7 @@ $262.agent.receiveBroadcast(function (sab) { > var ia = new Int32Array(sab); > Atomics.add(ia, ${RUNNING}, 1); > // Waiters that are not woken will time out eventually. >- $262.agent.report(Atomics.wait(ia, ${WAKEUP}, 0, 2000)); >+ $262.agent.report(Atomics.wait(ia, ${WAKEUP}, 0, 200)); > $262.agent.leaving(); > }) > `); >@@ -38,7 +36,7 @@ waitUntil(ia, RUNNING, NUMAGENT); > > // Then wait some more to give the agents a fair chance to wait. If we don't, > // we risk sending the wakeup before agents are sleeping, and we hang. >-$262.agent.sleep(500); >+$262.agent.sleep(50); > > // There's a slight risk we'll fail to wake the desired count, if the preceding > // sleep() took much longer than anticipated and workers have started timing >@@ -47,27 +45,30 @@ assert.sameValue(Atomics.wake(ia, 0, WAKECOUNT), WAKECOUNT); > > // Collect and check results > var rs = []; >-for (var i = 0; i < NUMAGENT; i++) >+for (var i = 0; i < NUMAGENT; i++) { > rs.push(getReport()); >+} > rs.sort(); > >-for (var i = 0; i < WAKECOUNT; i++) >- assert.sameValue(rs[i], "ok"); >-for (var i = WAKECOUNT; i < NUMAGENT; i++) >- assert.sameValue(rs[i], "timed-out"); >+for (var i = 0; i < WAKECOUNT; i++) { >+ assert.sameValue(rs[i], "ok", "The value of rs[i] is ok"); >+} >+for (var i = WAKECOUNT; i < NUMAGENT; i++) { >+ assert.sameValue(rs[i], "timed-out", "The value of rs[i] is timed-out"); >+} > > function getReport() { > var r; > while ((r = $262.agent.getReport()) == null) >- $262.agent.sleep(100); >+ $262.agent.sleep(10); > return r; > } > > function waitUntil(ia, k, value) { > var i = 0; > while (Atomics.load(ia, k) !== value && i < 15) { >- $262.agent.sleep(100); >+ $262.agent.sleep(10); > i++; > } >- assert.sameValue(Atomics.load(ia, k), value, "All agents are running"); >+ assert.sameValue(Atomics.load(ia, k), value, "Atomics.load(ia, k) returns value (All agents are running)"); > } >diff --git a/JSTests/test262/test/built-ins/Atomics/xor/bad-range.js b/JSTests/test262/test/built-ins/Atomics/xor/bad-range.js >index c51cf02ee00e5ef93180903ac9533fbdbfb0a4d4..4a311a80b8f81bf9741db02ac28fbcfc0327e281 100644 >--- a/JSTests/test262/test/built-ins/Atomics/xor/bad-range.js >+++ b/JSTests/test262/test/built-ins/Atomics/xor/bad-range.js >@@ -6,21 +6,20 @@ esid: sec-atomics.xor > description: > > Test range checking of Atomics.xor on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(8); >-var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { > views.push(BigInt64Array); > views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- let view = new View(sab); >+testWithTypedArrayConstructors(function(TA) { >+ let view = new TA(sab); > testWithAtomicsOutOfBoundsIndices(function(IdxGen) { >- let Idx = IdxGen(view); >- assert.throws(RangeError, () => Atomics.xor(view, Idx, 0)); >+ assert.throws(RangeError, () => Atomics.xor(view, IdxGen(view), 0)); > }); > }, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/xor/good-views.js b/JSTests/test262/test/built-ins/Atomics/xor/good-views.js >index 73a3535cbd0559dd0766c7575ef5a3032236a877..76be431af49f477f3effded46169a53cd3e06055 100644 >--- a/JSTests/test262/test/built-ins/Atomics/xor/good-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/xor/good-views.js >@@ -5,18 +5,18 @@ > esid: sec-atomics.xor > description: Test Atomics.xor on arrays that allow atomic operations > includes: [testAtomics.js, testTypedArray.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray] > ---*/ > > var sab = new SharedArrayBuffer(1024); > var ab = new ArrayBuffer(16); >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var views = intArrayConstructors.slice(); > >-testWithTypedArrayConstructors(function(View) { >+testWithTypedArrayConstructors(function(TA) { > // Make it interesting - use non-zero byteOffsets and non-zero indexes. > >- var view = new View(sab, 32, 20); >- var control = new View(ab, 0, 2); >+ var view = new TA(sab, 32, 20); >+ var control = new TA(ab, 0, 2); > > view[8] = 0x33333333; > control[0] = 0x33333333; >@@ -59,4 +59,4 @@ testWithTypedArrayConstructors(function(View) { > Atomics.store(view, Idx, 37); > assert.sameValue(Atomics.xor(view, Idx, 0), 37); > }); >-}, int_views); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/xor/non-views.js b/JSTests/test262/test/built-ins/Atomics/xor/non-views.js >index 6cbec2e5e562d1e9df4f01189a1a5342b7bf6d90..1ff989839f498cbea367d9888940fab63b46c959 100644 >--- a/JSTests/test262/test/built-ins/Atomics/xor/non-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/xor/non-views.js >@@ -6,7 +6,7 @@ esid: sec-atomics.xor > description: > > Test Atomics.xor on view values other than TypedArrays > includes: [testAtomics.js] >-features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of] >+features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer] > ---*/ > > testWithAtomicsNonViewValues(function(view) { >diff --git a/JSTests/test262/test/built-ins/Atomics/xor/nonshared-int-views.js b/JSTests/test262/test/built-ins/Atomics/xor/nonshared-int-views.js >index 46447c29c2955303241429a57a8882caf8cdcc78..7e5218ebde9ac3dbee80b0558b0143063ff35cd7 100644 >--- a/JSTests/test262/test/built-ins/Atomics/xor/nonshared-int-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/xor/nonshared-int-views.js >@@ -6,20 +6,17 @@ esid: sec-atomics.xor > description: > > Test Atomics.xor on non-shared integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [ArrayBuffer, Atomics, BigInt, TypedArray] > ---*/ > >-var ab = new ArrayBuffer(16); >- >-var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; >+var buffer = new ArrayBuffer(16); >+var views = intArrayConstructors.slice(); > > if (typeof BigInt !== "undefined") { >- int_views.push(BigInt64Array); >- int_views.push(BigUint64Array); >+ views.push(BigInt64Array); >+ views.push(BigUint64Array); > } > >-testWithTypedArrayConstructors(function(View) { >- var view = new View(ab); >- >- assert.throws(TypeError, (() => Atomics.xor(view, 0, 0))); >-}, int_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.xor(new TA(buffer), 0, 0))); >+}, views); >diff --git a/JSTests/test262/test/built-ins/Atomics/xor/shared-nonint-views.js b/JSTests/test262/test/built-ins/Atomics/xor/shared-nonint-views.js >index 1c436e08daacb6635a03dc875f9fc72f2473f49d..fca92c923abb24afff961f8fb5fa15e0bf1b0335 100644 >--- a/JSTests/test262/test/built-ins/Atomics/xor/shared-nonint-views.js >+++ b/JSTests/test262/test/built-ins/Atomics/xor/shared-nonint-views.js >@@ -6,15 +6,11 @@ esid: sec-atomics.xor > description: > > Test Atomics.xor on shared non-integer TypedArrays > includes: [testTypedArray.js] >-features: [Atomics, TypedArray] >+features: [Atomics, SharedArrayBuffer, TypedArray] > ---*/ > >-var sab = new SharedArrayBuffer(1024); >+var buffer = new SharedArrayBuffer(1024); > >-var other_views = [Uint8ClampedArray, Float32Array, Float64Array]; >- >-testWithTypedArrayConstructors(function(View) { >- var view = new View(sab); >- >- assert.throws(TypeError, (() => Atomics.xor(view, 0, 0))); >-}, other_views); >+testWithTypedArrayConstructors(function(TA) { >+ assert.throws(TypeError, (() => Atomics.xor(new TA(buffer), 0, 0))); >+}, floatArrayConstructors); >diff --git a/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-errors.js b/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-errors.js >index b1e2d3f7b90c09a51f0f0ec65c9e9096a3a5769c..950cda9f6ed3d3d7f0a839c5b3a5dcde63b02cf8 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-errors.js >+++ b/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-errors.js >@@ -7,7 +7,7 @@ info: | > BigInt.asIntN ( bits, bigint ) > > 2. Let bigint ? ToBigInt(bigint). >-features: [BigInt, Symbol, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.throws(TypeError, function() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js b/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js >index e2663a00b6e0c4158d3265ae18364b79b9ed26b5..fe0a702faf190fe613bfdd9633b97309f71cf725 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js >+++ b/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js >@@ -7,7 +7,7 @@ info: | > BigInt.asIntN ( bits, bigint ) > > 2. Let bigint ? ToBigInt(bigint). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > function err() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js b/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js >index 2ee3a6c6bb74f766fc2f3879ecb1affd2fc88bd1..5b2a3956c34de94994581f0452327cb5f7eff51f 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js >+++ b/JSTests/test262/test/built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js >@@ -7,7 +7,7 @@ info: | > BigInt.asIntN ( bits, bigint ) > > 2. Let bigint ? ToBigInt(bigint). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.sameValue(BigInt.asIntN(2, Object(0n)), 0n, "ToPrimitive: unbox object with internal slot"); >diff --git a/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-errors.js b/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-errors.js >index 892c480175ca6f717d5449b242f4fadcb63310e0..9f2fabb1c13ccbf87a258f49342299963f4beb6d 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-errors.js >+++ b/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-errors.js >@@ -7,7 +7,7 @@ info: | > BigInt.asIntN ( bits, bigint ) > > 1. Let bits be ? ToIndex(bits). >-features: [BigInt, Symbol, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.throws(RangeError, function() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js b/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js >index c6b874a84e7e50b47989bbca8c8c0fa0b3328f47..10ffd610f8466a6d08022546c276facc269fc4c9 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js >+++ b/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js >@@ -7,7 +7,7 @@ info: | > BigInt.asIntN ( bits, bigint ) > > 1. Let bits be ? ToIndex(bits). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > function err() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js b/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js >index cb9a5832a150be498e9701709e902979dc54e82a..94e5635e06f3bc760446f8e678bec082a3b3d561 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js >+++ b/JSTests/test262/test/built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js >@@ -7,7 +7,7 @@ info: | > BigInt.asIntN ( bits, bigint ) > > 1. Let bits be ? ToIndex(bits). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.sameValue(BigInt.asIntN(Object(0), 1n), 0n, "ToPrimitive: unbox object with internal slot"); >diff --git a/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-errors.js b/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-errors.js >index 3df6cf714426de6a1992cda27372e2501ab60c33..924e3decb1874a8356cd4f843f89ca624702e561 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-errors.js >+++ b/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-errors.js >@@ -7,7 +7,7 @@ info: | > BigInt.asUintN ( bits, bigint ) > > 2. Let bigint ? ToBigInt(bigint). >-features: [BigInt, Symbol, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.throws(TypeError, function() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js b/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js >index 15bfa4775930c8487126474e8f943baad4c32c0e..1aff2080c31480663883c3065a4d2c13df08d68b 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js >+++ b/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js >@@ -7,7 +7,7 @@ info: | > BigInt.asUintN ( bits, bigint ) > > 2. Let bigint ? ToBigInt(bigint). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > function err() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js b/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js >index 49741b93978516fb2dd6f52e08b07ce0bdaec511..3362b284d963b3dfe19404dbbaf9ddb9f10a6713 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js >+++ b/JSTests/test262/test/built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js >@@ -7,7 +7,7 @@ info: | > BigInt.asUintN ( bits, bigint ) > > 2. Let bigint ? ToBigInt(bigint). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.sameValue(BigInt.asUintN(2, Object(0n)), 0n, "ToPrimitive: unbox object with internal slot"); >diff --git a/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-errors.js b/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-errors.js >index 9b42b295d1089ea9b0a69c16bd6cf18d24796601..3967dab25d9a4a22b90df6ad83257771b08925e9 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-errors.js >+++ b/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-errors.js >@@ -7,7 +7,7 @@ info: | > BigInt.asUintN ( bits, bigint ) > > 1. Let bits be ? ToIndex(bits). >-features: [BigInt, Symbol, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.throws(RangeError, function() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js b/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js >index 68a0421a9015ca3c909c1f3dd4f249421f313657..4933da2fbf7220339ad6d8946eac79c9df130e99 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js >+++ b/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js >@@ -7,7 +7,7 @@ info: | > BigInt.asUintN ( bits, bigint ) > > 1. Let bits be ? ToIndex(bits). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > function err() { >diff --git a/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js b/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js >index 3b78835cd0feaa6ca90b7e985f04ee9bbfd23353..ac754ee4e77f317193f4ea91aa79b962fb7060f9 100644 >--- a/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js >+++ b/JSTests/test262/test/built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js >@@ -7,7 +7,7 @@ info: | > BigInt.asUintN ( bits, bigint ) > > 1. Let bits be ? ToIndex(bits). >-features: [BigInt, Symbol.toPrimitive, computed-property-names] >+features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] > ---*/ > > assert.sameValue(BigInt.asUintN(Object(0), 1n), 0n, "ToPrimitive: unbox object with internal slot"); >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-empty-string.js b/JSTests/test262/test/built-ins/BigInt/constructor-empty-string.js >index e8b2fb52b4c2d970fb89aa377e9b3c5a0db45674..5eb5def02c8abd1b6c9b4ca158a9db3b516d0a28 100644 >--- a/JSTests/test262/test/built-ins/BigInt/constructor-empty-string.js >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-empty-string.js >@@ -5,9 +5,17 @@ > description: Empty String should in BigInt should result into 0n > esid: sec-string-to-bigint > info: | >- Apply the algorithm in 3.1.3.1 with the following changes: >+ ToBigInt ( argument ) > >- EDITOR'S NOTE StringToBigInt("") is 0n according to the logic in 3.1.3.1. >+ String: >+ >+ Let n be StringToBigInt(prim). >+ If n is NaN, throw a SyntaxError exception. >+ Return n. >+ >+ StringToBigInt ( argument ) >+ >+ Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents. > > features: [BigInt] > ---*/ >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-from-binary-string.js b/JSTests/test262/test/built-ins/BigInt/constructor-from-binary-string.js >index 35cfda0acbd12f26a2f9c0e13cb2f6bcc301747c..1b675b4727bf226f204664170d38f848a91f4b59 100644 >--- a/JSTests/test262/test/built-ins/BigInt/constructor-from-binary-string.js >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-from-binary-string.js >@@ -5,10 +5,17 @@ > description: String should be parsed to BigInt according StringToBigInt > esid: sec-string-to-bigint > info: | >- Apply the algorithm in 3.1.3.1 with the following changes: >+ ToBigInt ( argument ) > >- - Replace the StrUnsignedDecimalLiteral production with DecimalDigits >- to not allow decimal points or exponents. >+ String: >+ >+ Let n be StringToBigInt(prim). >+ If n is NaN, throw a SyntaxError exception. >+ Return n. >+ >+ StringToBigInt ( argument ) >+ >+ Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents. > > features: [BigInt] > ---*/ >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-from-decimal-string.js b/JSTests/test262/test/built-ins/BigInt/constructor-from-decimal-string.js >index c732b7f7aa064c828e31e85696b9a0af78d644cc..ecb128feed129f7aef0733ed201c271fcbe9f1cf 100644 >--- a/JSTests/test262/test/built-ins/BigInt/constructor-from-decimal-string.js >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-from-decimal-string.js >@@ -5,10 +5,17 @@ > description: String should be parsed to BigInt according StringToBigInt > esid: sec-string-to-bigint > info: | >- Apply the algorithm in 3.1.3.1 with the following changes: >+ ToBigInt ( argument ) > >- - Replace the StrUnsignedDecimalLiteral production with DecimalDigits >- to not allow decimal points or exponents. >+ String: >+ >+ Let n be StringToBigInt(prim). >+ If n is NaN, throw a SyntaxError exception. >+ Return n. >+ >+ StringToBigInt ( argument ) >+ >+ Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents. > > features: [BigInt] > ---*/ >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-from-hex-string.js b/JSTests/test262/test/built-ins/BigInt/constructor-from-hex-string.js >index f26b9d269834e4efad31423ef6b5b1eebd059975..1841559d2a7064c8cc41c28df6cea60ca10c2594 100644 >--- a/JSTests/test262/test/built-ins/BigInt/constructor-from-hex-string.js >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-from-hex-string.js >@@ -5,10 +5,17 @@ > description: Hexdecimal prefixed String should be parsed to BigInt according StringToBigInt > esid: sec-string-to-bigint > info: | >- Apply the algorithm in 3.1.3.1 with the following changes: >+ ToBigInt ( argument ) > >- - Replace the StrUnsignedDecimalLiteral production with DecimalDigits >- to not allow decimal points or exponents. >+ String: >+ >+ Let n be StringToBigInt(prim). >+ If n is NaN, throw a SyntaxError exception. >+ Return n. >+ >+ StringToBigInt ( argument ) >+ >+ Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents. > > features: [BigInt] > ---*/ >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-from-octal-string.js b/JSTests/test262/test/built-ins/BigInt/constructor-from-octal-string.js >index 59d18c64d1337595239505bac8654ca7863f0f7f..f4093fa96aebd4dfadf38f59ff6a145398f676a7 100644 >--- a/JSTests/test262/test/built-ins/BigInt/constructor-from-octal-string.js >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-from-octal-string.js >@@ -5,10 +5,17 @@ > description: Octal prefixed String should be parsed to BigInt according StringToBigInt > esid: sec-string-to-bigint > info: | >- Apply the algorithm in 3.1.3.1 with the following changes: >+ ToBigInt ( argument ) > >- - Replace the StrUnsignedDecimalLiteral production with DecimalDigits >- to not allow decimal points or exponents. >+ String: >+ >+ Let n be StringToBigInt(prim). >+ If n is NaN, throw a SyntaxError exception. >+ Return n. >+ >+ StringToBigInt ( argument ) >+ >+ Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents. > > features: [BigInt] > ---*/ >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-from-string-syntax-errors.js b/JSTests/test262/test/built-ins/BigInt/constructor-from-string-syntax-errors.js >index 6bdd6f3cbc356229dd5ebe5b3b44b68598bc04d7..0e5defa0d91b5d9371e5510ec2d451653ff647e3 100644 >--- a/JSTests/test262/test/built-ins/BigInt/constructor-from-string-syntax-errors.js >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-from-string-syntax-errors.js >@@ -5,10 +5,17 @@ > description: Invalid String into BigInt constructor should throw SyntaxError > esid: sec-string-to-bigint > info: | >- Apply the algorithm in 3.1.3.1 with the following changes: >+ ToBigInt ( argument ) > >- - Replace the StrUnsignedDecimalLiteral production with DecimalDigits >- to not allow decimal points or exponents. >+ String: >+ >+ Let n be StringToBigInt(prim). >+ If n is NaN, throw a SyntaxError exception. >+ Return n. >+ >+ StringToBigInt ( argument ) >+ >+ Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents. > > features: [BigInt] > ---*/ >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-integer.js b/JSTests/test262/test/built-ins/BigInt/constructor-integer.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a54d84b7a435b92215d0fadb44ceb2f6e1813ec7 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-integer.js >@@ -0,0 +1,58 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: BigInt constructor called with integer argument >+esid: sec-bigint-constructor-number-value >+info: | >+ BigInt ( value ) >+ >+ ... >+ 3. If Type(prim) is Number, return ? NumberToBigInt(prim). >+ >+ NumberToBigInt ( number ) >+ >+ ... >+ 3. Return a BigInt representing the mathematical value of number. >+features: [BigInt] >+---*/ >+ >+assert.sameValue( >+ BigInt(Number.MAX_SAFE_INTEGER), 9007199254740991n, >+ "BigInt(Number.MAX_SAFE_INTEGER) === 9007199254740991n" >+); >+ >+assert.sameValue( >+ BigInt(-Number.MAX_SAFE_INTEGER), -9007199254740991n, >+ "BigInt(-Number.MAX_SAFE_INTEGER) === -9007199254740991n" >+); >+ >+assert.sameValue( >+ BigInt(Number.MAX_SAFE_INTEGER + 1), 9007199254740992n, >+ "BigInt(Number.MAX_SAFE_INTEGER + 1) === 9007199254740992n" >+); >+ >+assert.sameValue( >+ BigInt(-Number.MAX_SAFE_INTEGER - 1), -9007199254740992n, >+ "BigInt(-Number.MAX_SAFE_INTEGER - 1) === -9007199254740992n" >+); >+ >+assert.sameValue( >+ BigInt(Number.MAX_SAFE_INTEGER + 2), 9007199254740992n, >+ "BigInt(Number.MAX_SAFE_INTEGER + 2) === 9007199254740992n" >+); >+ >+assert.sameValue( >+ BigInt(-Number.MAX_SAFE_INTEGER - 2), -9007199254740992n, >+ "BigInt(-Number.MAX_SAFE_INTEGER - 2) === -9007199254740992n" >+); >+ >+assert.sameValue( >+ BigInt(Number.MAX_SAFE_INTEGER + 3), 9007199254740994n, >+ "BigInt(Number.MAX_SAFE_INTEGER + 3) === 9007199254740994n" >+); >+ >+assert.sameValue( >+ BigInt(-Number.MAX_SAFE_INTEGER - 3), -9007199254740994n, >+ "BigInt(-Number.MAX_SAFE_INTEGER - 3) === -9007199254740994n" >+); >diff --git a/JSTests/test262/test/built-ins/BigInt/constructor-trailing-leading-spaces.js b/JSTests/test262/test/built-ins/BigInt/constructor-trailing-leading-spaces.js >index 8db1a76ea633d319622498cd6fa41857302df2b6..9ffdc45f461f2e407af9c92fba12381624018e7b 100644 >--- a/JSTests/test262/test/built-ins/BigInt/constructor-trailing-leading-spaces.js >+++ b/JSTests/test262/test/built-ins/BigInt/constructor-trailing-leading-spaces.js >@@ -2,13 +2,21 @@ > // This code is governed by the BSD license found in the LICENSE file. > > /*--- >-description: Tariling/Leading spaces should be ignored in BigInt constructor should >+description: Trailing/Leading spaces should be ignored in BigInt constructor > esid: sec-string-to-bigint > info: | >- Apply the algorithm in 3.1.3.1 with the following changes: >+ ToBigInt ( argument ) >+ >+ String: >+ >+ Let n be StringToBigInt(prim). >+ If n is NaN, throw a SyntaxError exception. >+ Return n. >+ >+ StringToBigInt ( argument ) >+ >+ Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents. > >- - Replace the StrUnsignedDecimalLiteral production with DecimalDigits >- to not allow decimal points or exponents. > > features: [BigInt] > ---*/ >diff --git a/JSTests/test262/test/built-ins/BigInt/issafeinteger-true.js b/JSTests/test262/test/built-ins/BigInt/issafeinteger-true.js >deleted file mode 100644 >index 1463edad3632b5822886a7e1ea962276a6f48ab5..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/BigInt/issafeinteger-true.js >+++ /dev/null >@@ -1,20 +0,0 @@ >-// Copyright (C) 2017 Robin Templeton. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-description: Throws a TypeError if BigInt is called with a new target >-esid: sec-bigint-constructor >-info: | >- ... >- 3. If Type(prim) is Number, return ? NumberToBigInt(prim). >- ... >- >- NumberToBigInt ( number ) >- >- 2. If IsSafeInteger(number) is false, throw a RangeError exception. >- >-features: [BigInt] >----*/ >- >-assert.sameValue(BigInt(Number.MAX_SAFE_INTEGER), 9007199254740991n); >-assert.sameValue(BigInt(-Number.MAX_SAFE_INTEGER), -9007199254740991n); >diff --git a/JSTests/test262/test/built-ins/BigInt/out-of-bounds-integer-rangeerror.js b/JSTests/test262/test/built-ins/BigInt/out-of-bounds-integer-rangeerror.js >deleted file mode 100644 >index cae05d72bdaddd0294e3d8b8bb04c4253205b015..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/BigInt/out-of-bounds-integer-rangeerror.js >+++ /dev/null >@@ -1,40 +0,0 @@ >-// Copyright (C) 2017 Robin Templeton. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-description: BigInt throws a RangeError if value is not a safe integer. >-esid: sec-bigint-constructor >-info: | >- BigInt ( value ) >- >- ... >- 2. Let prim be ? ToPrimitive(value, hint Number). >- 3. If Type(prim) is Number, return ? NumberToBigInt(prim). >- ... >- >- NumberToBigInt ( number ) >- >- ... >- 2. If IsSafeInteger(number) is false, throw a RangeError exception. >- ... >- >- IsSafeInteger ( number ) >- >- ... >- 3. Let integer be ToInteger(number). >- 4. If integer is not equal to number, return false. >- 5. If abs(integer) ⤠2**53-1, return true. >- 6. Otherwise, return false. >-features: [BigInt] >----*/ >- >-var pos = Math.pow(2, 53); >-var neg = -pos; >- >-assert.throws(RangeError, function() { >- BigInt(pos); >-}); >- >-assert.throws(RangeError, function() { >- BigInt(neg); >-}); >diff --git a/JSTests/test262/test/built-ins/BigInt/prototype/Symbol.toStringTag.js b/JSTests/test262/test/built-ins/BigInt/prototype/Symbol.toStringTag.js >index ab55f21253e5c72586bd6b3edad4b92071523492..a64ff70bf2d4e6f166509172c5ed21ba08b7eda5 100644 >--- a/JSTests/test262/test/built-ins/BigInt/prototype/Symbol.toStringTag.js >+++ b/JSTests/test262/test/built-ins/BigInt/prototype/Symbol.toStringTag.js >@@ -11,7 +11,7 @@ info: | > This property has the attributes { [[Writable]]: false, [[Enumerable]]: > false, [[Configurable]]: true }. > includes: [propertyHelper.js] >-features: [Symbol.toStringTag, BigInt, Symbol] >+features: [BigInt, Symbol, Symbol.toStringTag] > ---*/ > > verifyProperty(BigInt.prototype, Symbol.toStringTag, { >diff --git a/JSTests/test262/test/built-ins/BigInt/prototype/toString/default-radix.js b/JSTests/test262/test/built-ins/BigInt/prototype/toString/default-radix.js >new file mode 100644 >index 0000000000000000000000000000000000000000..edcab3c8cad8115ea17e2587f9244a62b2a229ab >--- /dev/null >+++ b/JSTests/test262/test/built-ins/BigInt/prototype/toString/default-radix.js >@@ -0,0 +1,19 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-bigint.prototype.tostring >+description: toString with default radix >+features: [BigInt] >+---*/ >+ >+assert.sameValue((-100n).toString(), "-100", "(-100n).toString() === '-100'"); >+assert.sameValue((0n).toString(), "0", "(0n).toString() === '0'"); >+assert.sameValue((100n).toString(), "100", "(100n).toString() === '100'"); >+ >+assert.sameValue((-100n).toString(undefined), "-100", >+ "(-100n).toString(undefined) === '-100'"); >+assert.sameValue((0n).toString(undefined), "0", >+ "(0n).toString(undefined) === '0'"); >+assert.sameValue((100n).toString(undefined), "100", >+ "(100n).toString(undefined) === '100'"); >diff --git a/JSTests/test262/test/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js b/JSTests/test262/test/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js >index 92eee1c683963a45c5d65beb41eefb909cc423b9..1e4a1bd6b26674f3dc4b0263a7c6a71c4f2f727e 100644 >--- a/JSTests/test262/test/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js >+++ b/JSTests/test262/test/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js >@@ -16,7 +16,7 @@ info: | > 2. If Type(value) is Object and value has a [[BigIntData]] internal slot, then > ... > 3. Throw a TypeError exception. >-features: [BigInt, Symbol.toPrimitive] >+features: [BigInt, Symbol, Symbol.toPrimitive] > ---*/ > > var toString = BigInt.prototype.toString; >diff --git a/JSTests/test262/test/built-ins/BigInt/prototype/valueOf/cross-realm.js b/JSTests/test262/test/built-ins/BigInt/prototype/valueOf/cross-realm.js >new file mode 100644 >index 0000000000000000000000000000000000000000..97e10417129fa0066cd6a37762d8f15fc2f533ee >--- /dev/null >+++ b/JSTests/test262/test/built-ins/BigInt/prototype/valueOf/cross-realm.js >@@ -0,0 +1,14 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-bigint.prototype.valueof >+description: valueOf called with a BigInt object from another realm >+features: [BigInt, cross-realm] >+---*/ >+ >+var other = $262.createRealm().global; >+var wrapped = other.Object(other.BigInt(0)); >+ >+assert.sameValue(BigInt.prototype.valueOf.call(wrapped), 0n, >+ "cross-realm valueOf"); >diff --git a/JSTests/test262/test/built-ins/BigInt/tostring-throws.js b/JSTests/test262/test/built-ins/BigInt/tostring-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..031a85e1ea31f5738691374168e087fefd18b4f1 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/BigInt/tostring-throws.js >@@ -0,0 +1,21 @@ >+// Copyright (C) 2017 Caio Lima. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Throws exception in BigIntConstructor if toString throws >+esid: sec-bigint-constructor-number-value >+info: | >+ 1. If NewTarget is not undefined, throw a TypeError exception. >+ 2. Let prim be ? ToPrimitive(value, hint Number). >+ 3. If Type(prim) is Number, return ? NumberToBigInt(prim). >+ 4. Otherwise, return ? ToBigInt(value). >+features: [BigInt] >+---*/ >+ >+assert.throws(Test262Error, function() { >+ BigInt({ >+ toString: function() { >+ throw new Test262Error(); >+ } >+ }); >+}); >diff --git a/JSTests/test262/test/built-ins/BigInt/value-of-throws.js b/JSTests/test262/test/built-ins/BigInt/value-of-throws.js >deleted file mode 100644 >index 671a9b94ca51e0c0c6aa3602841b5a1599d33131..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/BigInt/value-of-throws.js >+++ /dev/null >@@ -1,29 +0,0 @@ >-// Copyright (C) 2017 Caio Lima. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-description: Throws exception in BigIntConstructor if valueOf/toString does that >-esid: sec-bigint-constructor-number-value >-info: | >- 1. If NewTarget is not undefined, throw a TypeError exception. >- 2. Let prim be ? ToPrimitive(value, hint Number). >- 3. If Type(prim) is Number, return ? NumberToBigInt(prim). >- 4. Otherwise, return ? ToBigInt(value). >-features: [BigInt] >----*/ >- >-assert.throws(Test262Error, function() { >- BigInt({ >- valueOf: function() { >- throw new Test262Error(); >- } >- }); >-}); >- >-assert.throws(Test262Error, function() { >- BigInt({ >- toString: function() { >- throw new Test262Error(); >- } >- }); >-}); >diff --git a/JSTests/test262/test/built-ins/BigInt/valueof-throws.js b/JSTests/test262/test/built-ins/BigInt/valueof-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7e3cef1f394ab37debf77185e123973073e75309 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/BigInt/valueof-throws.js >@@ -0,0 +1,21 @@ >+// Copyright (C) 2017 Caio Lima. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Throws exception in BigIntConstructor if valueOf throws >+esid: sec-bigint-constructor-number-value >+info: | >+ 1. If NewTarget is not undefined, throw a TypeError exception. >+ 2. Let prim be ? ToPrimitive(value, hint Number). >+ 3. If Type(prim) is Number, return ? NumberToBigInt(prim). >+ 4. Otherwise, return ? ToBigInt(value). >+features: [BigInt] >+---*/ >+ >+assert.throws(Test262Error, function() { >+ BigInt({ >+ valueOf: function() { >+ throw new Test262Error(); >+ } >+ }); >+}); >diff --git a/JSTests/test262/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js b/JSTests/test262/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js >index 4e2d481c1f0a8eefd4559178f8ff853b7f25fdaa..d60507eee3be57fc8bfeae49cdab571d5554cddb 100644 >--- a/JSTests/test262/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js >+++ b/JSTests/test262/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js >@@ -1,4 +1,4 @@ >-// Copyright (C) 2017 Igalia, S.L. All rights reserved. >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. > > /*--- >@@ -20,7 +20,7 @@ values.forEach(function(value, i) { > () => sample.setBigInt64(0, BigInt(value), false), > "value: " + value); > return; >- } else if (!Number.isInteger(value) || value > 9007199254740991) { >+ } else if (!Number.isInteger(value)) { > assert.throws(RangeError, > () => sample.setBigInt64(0, BigInt(value), false), > "value " + value); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/bind/length-exceeds-int32.js b/JSTests/test262/test/built-ins/Function/prototype/bind/length-exceeds-int32.js >new file mode 100644 >index 0000000000000000000000000000000000000000..95fd81c0c4c1b8f3a38b0d6ac382f842b18f38e1 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/bind/length-exceeds-int32.js >@@ -0,0 +1,26 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-function.prototype.bind >+description: > >+ The target function length can exceed 2**31-1. >+info: | >+ 19.2.3.2 Function.prototype.bind ( thisArg, ...args ) >+ >+ ... >+ 6. If targetHasLength is true, then >+ a. Let targetLen be ? Get(Target, "length"). >+ b. If Type(targetLen) is not Number, let L be 0. >+ c. Else, >+ i. Let targetLen be ToInteger(targetLen). >+ ii. Let L be the larger of 0 and the result of targetLen minus the number of elements of args. >+ ... >+ 8. Perform ! SetFunctionLength(F, L). >+ ... >+---*/ >+ >+function f(){} >+Object.defineProperty(f, "length", {value: 2147483648}); >+ >+assert.sameValue(f.bind().length, 2147483648); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/anonymous-intrinsics.js b/JSTests/test262/test/built-ins/Function/prototype/toString/anonymous-intrinsics.js >deleted file mode 100644 >index 6c6783e3398f95138a999de60910bc63bc142d47..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Function/prototype/toString/anonymous-intrinsics.js >+++ /dev/null >@@ -1,12 +0,0 @@ >-// Copyright (C) 2018 Michael Ficarra. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-esid: sec-function.prototype.tostring >-description: Function.prototype.toString on anonymous well-known intrinsic function objects >-includes: [nativeFunctionMatcher.js] >----*/ >- >-var ThrowTypeError = (function() { "use strict"; return Object.getOwnPropertyDescriptor(arguments, "callee").get })() >-assert.sameValue(ThrowTypeError.name, ""); >-assertNativeFunction(ThrowTypeError); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/bound-function.js b/JSTests/test262/test/built-ins/Function/prototype/toString/bound-function.js >index 20881fb71e5e44ee9ecfb612adf82d2cecd44fe8..1d4ab3a4e04e2b0e95c7a877631b249382e9ac5b 100644 >--- a/JSTests/test262/test/built-ins/Function/prototype/toString/bound-function.js >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/bound-function.js >@@ -1,12 +1,17 @@ > // Copyright (C) 2016 Michael Ficarra. All rights reserved. >+// Copyright (C) 2018 the V8 project authors. All rights reserved. > // This code is governed by the BSD license found in the LICENSE file. >- > /*--- > esid: sec-function.prototype.tostring >-description: Function.prototype.toString on bound function exotic objects >+description: > >+ toString bound function does not throw (bound Function Expression) >+info: | >+ ... >+ If func is a Bound Function exotic object or a built-in Function object, >+ then return an implementation-dependent String source code representation >+ of func. The representation must have the syntax of a NativeFunction >+ ... > includes: [nativeFunctionMatcher.js] > ---*/ > >-let f = function(){}.bind(null); >- >-assertNativeFunction(f); >+assertNativeFunction(function() {}.bind({})); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/built-in-function-object.js b/JSTests/test262/test/built-ins/Function/prototype/toString/built-in-function-object.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a87201a7e40c3f5054786b944f50c53ee33a264f >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/built-in-function-object.js >@@ -0,0 +1,48 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of built-in Function object >+info: | >+ ... >+ If func is a Bound Function exotic object or a built-in Function object, then return an implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+includes: [fnGlobalObject.js, nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] >+features: [arrow-function] >+---*/ >+ >+var visited = []; >+var verified = []; >+ >+function visit(object) { >+ if (visited.includes(object)) { >+ return; >+ } >+ >+ visited.push(object); >+ >+ if (typeof object === "function") { >+ assertNativeFunction(object); >+ verified.push(object.name); >+ } >+ >+ for (var property of Object.getOwnPropertyNames(object)) { >+ if (typeof object[property] === "function" || >+ typeof object[property] === "object") { >+ try { >+ visit(object[property], assertNativeFunction); >+ } catch(error) { >+ /* we don't actually want to do anything about failures here */ >+ } >+ } >+ } >+} >+ >+visit(WellKnownIntrinsicObjects.map(wkio => wkio.reference)); >+assert.notSameValue(verified.length, 0); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/intrinsics.js b/JSTests/test262/test/built-ins/Function/prototype/toString/intrinsics.js >deleted file mode 100644 >index 7cb08d4ba8d897fdfc19ff3945ed6b83ffe239c3..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Function/prototype/toString/intrinsics.js >+++ /dev/null >@@ -1,24 +0,0 @@ >-// Copyright (C) 2016 Michael Ficarra. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-esid: sec-function.prototype.tostring >-description: Function.prototype.toString on well-known intrinsic function objects >-includes: [nativeFunctionMatcher.js] >----*/ >- >-let intrinsics = { >- Array, ArrayBuffer, Boolean, DataView, Date, decodeURI, decodeURIComponent, encodeURI, >- encodeURIComponent, Error, eval, EvalError, Float32Array, Float64Array, Function, Int8Array, >- Int16Array, Int32Array, isFinite, isNaN, Map, Number, Object, parseFloat, parseInt, Promise, >- Proxy, RangeError, ReferenceError, RegExp, Set, String, Symbol, SyntaxError, TypeError, >- Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, URIError, WeakMap, WeakSet, >-}; >- >-for (let intrinsicName in intrinsics) { >- let intrinsic = intrinsics[intrinsicName]; >- let str = Function.prototype.toString.call(intrinsic); >- assert.sameValue(typeof str, "string"); >- assert(RegExp('\\b' + intrinsicName + '\\b').test(str), "contains its name"); >- assertNativeFunction(intrinsic); >-} >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-arrow-function.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-arrow-function.js >new file mode 100644 >index 0000000000000000000000000000000000000000..05d151a499ca7bc8167134eb2796e67abf677e90 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-arrow-function.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Arrow Function) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [arrow-function, Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy(() => {}, {})); >+assertNativeFunction(new Proxy(() => {}, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-function.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-function.js >new file mode 100644 >index 0000000000000000000000000000000000000000..14524c72b11d77d0732afd80b5a1694a42b1f431 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-function.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Async Function Expression) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [async-functions, Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy(async function() {}, {})); >+assertNativeFunction(new Proxy(async function() {}, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-generator-function.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-generator-function.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0a9ec13853f575745bd96bb97da7f2cad78c4e32 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-generator-function.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Async Generator Function Expression) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [async-functions, generators, Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy(async function * () {}, {})); >+assertNativeFunction(new Proxy(async function * () {}, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-generator-method-definition.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-generator-method-definition.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c7d8d874abed8547e9a4a58cbc267b0f4b8e993b >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-generator-method-definition.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Async Generator Method Definition) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [async-functions, generators, Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy({ async * method() {} }.method, {})); >+assertNativeFunction(new Proxy({ async * method() {} }.method, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-method-definition.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-method-definition.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c75842e6a784e458bfdf6a258a68499fdcf30bcc >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-async-method-definition.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Async Method Definition) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [async-functions, generators, Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy({ async method() {} }.method, {})); >+assertNativeFunction(new Proxy({ async method() {} }.method, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-bound-function.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-bound-function.js >new file mode 100644 >index 0000000000000000000000000000000000000000..49011aa967d83e30a65cc1ed9cb599b2c8acc21d >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-bound-function.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (bound Function Expression) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy(function() {}.bind({}), {})); >+assertNativeFunction(new Proxy(function() {}.bind({}), { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-class.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-class.js >new file mode 100644 >index 0000000000000000000000000000000000000000..bc4d976165399eec31baa3773cead0b0db04305b >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-class.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Class Expression) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [class, Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy(class {}, {})); >+assertNativeFunction(new Proxy(class {}, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-function-expression.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-function-expression.js >new file mode 100644 >index 0000000000000000000000000000000000000000..4c782f1f8a206f909eb4160a232d2545be1900e0 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-function-expression.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Function Expression) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy(function() {}, {})); >+assertNativeFunction(new Proxy(function() {}, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-generator-function.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-generator-function.js >new file mode 100644 >index 0000000000000000000000000000000000000000..f4a118b21feeb4d8f1472344449f755f72fc7a54 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-generator-function.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Generator Function Expression) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [generators, Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy(function * () {}, {})); >+assertNativeFunction(new Proxy(function * () {}, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-method-definition.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-method-definition.js >new file mode 100644 >index 0000000000000000000000000000000000000000..cc648e3e38db0b27fc76c76dc150ea94d64231df >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-method-definition.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for function target does not throw (Method Definition) >+info: | >+ ... >+ If Type(func) is Object and IsCallable(func) is true, then return an >+ implementation-dependent String source code representation of func. >+ The representation must have the syntax of a NativeFunction. >+ ... >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+features: [Proxy] >+includes: [nativeFunctionMatcher.js] >+---*/ >+ >+assertNativeFunction(new Proxy({ method() {} }.method, {})); >+assertNativeFunction(new Proxy({ method() {} }.method, { apply() {} }).apply); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-non-callable-throws.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-non-callable-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..3f803bd6516343a3e04db8185780d9529f3b665b >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy-non-callable-throws.js >@@ -0,0 +1,16 @@ >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Proxy for non-callable target throws >+info: | >+ ... >+ Throw a TypeError exception. >+ >+features: [Proxy] >+---*/ >+ >+assert.throws(TypeError, function() { >+ Function.prototype.toString.call(new Proxy({}, {})); >+}); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy.js b/JSTests/test262/test/built-ins/Function/prototype/toString/proxy.js >deleted file mode 100644 >index fa5c39b9455c689bf7a9d01b7f29845abdbe6fee..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Function/prototype/toString/proxy.js >+++ /dev/null >@@ -1,17 +0,0 @@ >-// Copyright (C) 2018 Michael Ficarra. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-esid: sec-function.prototype.tostring >-description: Function.prototype.toString on a proxied function >-info: | >- Function.prototype.toString accepts any callable, including proxied >- functions, and produces a NativeFunction >-includes: [nativeFunctionMatcher.js] >----*/ >- >-const f = new Proxy(function(){}, {}); >-assertNativeFunction(f); >- >-const g = new Proxy(f, { apply() {} }); >-assertNativeFunction(g); >diff --git a/JSTests/test262/test/built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js b/JSTests/test262/test/built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js >new file mode 100644 >index 0000000000000000000000000000000000000000..337016c2b12e99b962ca7624a6e79d6564d190c0 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2016 Michael Ficarra. All rights reserved. >+// Copyright (C) 2018 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-function.prototype.tostring >+description: > >+ toString of Well-Known Intrinsic Object >+info: | >+ ... >+ If func is a Bound Function exotic object or a built-in Function object, then return an implementation-dependent String source code representation of func. The representation must have the syntax of a NativeFunction. Additionally, if func is a Well-known Intrinsic Object and is not identified as an anonymous function, the portion of the returned String that would be matched by IdentifierName must be the initial value of the name property of func. >+ >+ NativeFunction: >+ function IdentifierName_opt ( FormalParameters ) { [ native code ] } >+ >+includes: [nativeFunctionMatcher.js, wellKnownIntrinsicObjects.js] >+features: [destructuring-binding, template] >+---*/ >+ >+ >+WellKnownIntrinsicObjects.forEach(({intrinsicName, reference}) => { >+ if (typeof reference === "function") { >+ assert.sameValue( >+ ("" + reference).includes(reference.name), true, >+ `toString of Well-Known Intrinsic Object function should produce a string that matches NativeFunction syntax:\n${reference}\nis missing "${reference.name}"\n\n` >+ ); >+ assertNativeFunction(reference, intrinsicName); >+ } >+}); >diff --git a/JSTests/test262/test/built-ins/JSON/prop-desc.js b/JSTests/test262/test/built-ins/JSON/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..9c06000ebe03e713704e96730a01499a5641733b >--- /dev/null >+++ b/JSTests/test262/test/built-ins/JSON/prop-desc.js >@@ -0,0 +1,40 @@ >+// Copyright (C) 2016 The V8 Project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-json-object >+description: > >+ Property descriptor of JSON >+info: | >+ The JSON Object >+ >+ ... >+ The JSON object does not have a [[Construct]] internal method; >+ it is not possible to use the JSON object as a constructor with the new operator. >+ >+ The JSON object does not have a [[Call]] internal method; >+ it is not possible to invoke the JSON object as a function. >+ >+ 17 ECMAScript Standard Built-in Objects: >+ >+ Every other data property described in clauses 18 through 26 and in Annex B.2 >+ has the attributes { [[Writable]]: true, [[Enumerable]]: false, >+ [[Configurable]]: true } unless otherwise specified. >+includes: [propertyHelper.js] >+---*/ >+ >+assert.sameValue(typeof JSON, "object"); >+ >+assert.throws(TypeError, function() { >+ JSON(); >+}, "no [[Call]]"); >+ >+assert.throws(TypeError, function() { >+ new JSON(); >+}, "no [[Construct]]"); >+ >+verifyProperty(this, "JSON", { >+ enumerable: false, >+ writable: true, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/built-ins/Math/acosh/nan-returns.js b/JSTests/test262/test/built-ins/Math/acosh/nan-returns.js >index 4917b4905ce4e7ae684a80eab2235698b074f87d..b58e45dd5661cff81b61ac2e4a8918e721859fe2 100644 >--- a/JSTests/test262/test/built-ins/Math/acosh/nan-returns.js >+++ b/JSTests/test262/test/built-ins/Math/acosh/nan-returns.js >@@ -1,18 +1,18 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.acosh with special values >-es6id: 20.2.2.3 >-info: | >- Math.acosh ( x ) >- >- - If x is NaN, the result is NaN. >- - If x is less than 1, the result is NaN. >----*/ >- >-assert.sameValue(Math.acosh(NaN), NaN, "NaN"); >-assert.sameValue(Math.acosh(0.999999), NaN, "0.999999"); >-assert.sameValue(Math.acosh(0), NaN, "0"); >-assert.sameValue(Math.acosh(-1), NaN, "-1"); >-assert.sameValue(Math.acosh(-Infinity), NaN, "-Infinity"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.acosh with special values >+es6id: 20.2.2.3 >+info: | >+ Math.acosh ( x ) >+ >+ - If x is NaN, the result is NaN. >+ - If x is less than 1, the result is NaN. >+---*/ >+ >+assert.sameValue(Math.acosh(NaN), NaN, "NaN"); >+assert.sameValue(Math.acosh(0.999999), NaN, "0.999999"); >+assert.sameValue(Math.acosh(0), NaN, "0"); >+assert.sameValue(Math.acosh(-1), NaN, "-1"); >+assert.sameValue(Math.acosh(-Infinity), NaN, "-Infinity"); >diff --git a/JSTests/test262/test/built-ins/Math/asinh/asinh-specialVals.js b/JSTests/test262/test/built-ins/Math/asinh/asinh-specialVals.js >index 38d8c35aea735ce20d940241c2cb7a251e6dede0..33d88207c0a77fc2a41c7fb18ee6c35228bbbf21 100644 >--- a/JSTests/test262/test/built-ins/Math/asinh/asinh-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/asinh/asinh-specialVals.js >@@ -1,18 +1,18 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.asinh with special values >-es6id: 20.2.2.5 >----*/ >- >-assert.sameValue(Math.asinh(NaN), Number.NaN, >- "Math.asinh produces incorrect output for NaN"); >-assert.sameValue(Math.asinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >- "Math.asinh should produce negative infinity for Number.NEGATIVE_INFINITY"); >-assert.sameValue(Math.asinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.asinh should produce positive infinity for Number.POSITIVE_INFINITY"); >-assert.sameValue(1 / Math.asinh(-0), Number.NEGATIVE_INFINITY, >- "Math.asinh should produce -0 for -0"); >-assert.sameValue(1 / Math.asinh(0), Number.POSITIVE_INFINITY, >- "Math.asinh should produce +0 for +0"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.asinh with special values >+es6id: 20.2.2.5 >+---*/ >+ >+assert.sameValue(Math.asinh(NaN), Number.NaN, >+ "Math.asinh produces incorrect output for NaN"); >+assert.sameValue(Math.asinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >+ "Math.asinh should produce negative infinity for Number.NEGATIVE_INFINITY"); >+assert.sameValue(Math.asinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.asinh should produce positive infinity for Number.POSITIVE_INFINITY"); >+assert.sameValue(1 / Math.asinh(-0), Number.NEGATIVE_INFINITY, >+ "Math.asinh should produce -0 for -0"); >+assert.sameValue(1 / Math.asinh(0), Number.POSITIVE_INFINITY, >+ "Math.asinh should produce +0 for +0"); >diff --git a/JSTests/test262/test/built-ins/Math/atanh/atanh-specialVals.js b/JSTests/test262/test/built-ins/Math/atanh/atanh-specialVals.js >index 0a961af76d85d726dee3962cd8fca4619c182481..9148c1bb43151391d74abb5d6e6c3ec497825e48 100644 >--- a/JSTests/test262/test/built-ins/Math/atanh/atanh-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/atanh/atanh-specialVals.js >@@ -1,31 +1,31 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.atanh with special values >-es6id: 20.2.2.7 >----*/ >- >-assert.sameValue(Math.atanh(-1.9), Number.NaN, >- "Math.atanh produces incorrect output for -1.9"); >-assert.sameValue(Math.atanh(NaN), Number.NaN, >- "Math.atanh produces incorrect output for NaN"); >-assert.sameValue(Math.atanh(-10), Number.NaN, >- "Math.atanh produces incorrect output for -10"); >-assert.sameValue(Math.atanh(-Infinity), Number.NaN, >- "Math.atanh produces incorrect output for -Infinity"); >-assert.sameValue(Math.atanh(1.9), Number.NaN, >- "Math.atanh produces incorrect output for 1.9"); >-assert.sameValue(Math.atanh(10), Number.NaN, >- "Math.atanh produces incorrect output for 10"); >-assert.sameValue(Math.atanh(Number.POSITIVE_INFINITY), Number.NaN, >- "Math.atanh produces incorrect output for Number.POSITIVE_INFINITY"); >- >-assert.sameValue(Math.atanh(-1), Number.NEGATIVE_INFINITY, >- "Math.atanh should produce negative infinity for -1"); >-assert.sameValue(Math.atanh(+1), Number.POSITIVE_INFINITY, >- "Math.atanh should produce positive infinity for +1"); >-assert.sameValue(1 / Math.atanh(-0), Number.NEGATIVE_INFINITY, >- "Math.atanh should produce -0 for -0"); >-assert.sameValue(1 / Math.atanh(0), Number.POSITIVE_INFINITY, >- "Math.atanh should produce +0 for +0"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.atanh with special values >+es6id: 20.2.2.7 >+---*/ >+ >+assert.sameValue(Math.atanh(-1.9), Number.NaN, >+ "Math.atanh produces incorrect output for -1.9"); >+assert.sameValue(Math.atanh(NaN), Number.NaN, >+ "Math.atanh produces incorrect output for NaN"); >+assert.sameValue(Math.atanh(-10), Number.NaN, >+ "Math.atanh produces incorrect output for -10"); >+assert.sameValue(Math.atanh(-Infinity), Number.NaN, >+ "Math.atanh produces incorrect output for -Infinity"); >+assert.sameValue(Math.atanh(1.9), Number.NaN, >+ "Math.atanh produces incorrect output for 1.9"); >+assert.sameValue(Math.atanh(10), Number.NaN, >+ "Math.atanh produces incorrect output for 10"); >+assert.sameValue(Math.atanh(Number.POSITIVE_INFINITY), Number.NaN, >+ "Math.atanh produces incorrect output for Number.POSITIVE_INFINITY"); >+ >+assert.sameValue(Math.atanh(-1), Number.NEGATIVE_INFINITY, >+ "Math.atanh should produce negative infinity for -1"); >+assert.sameValue(Math.atanh(+1), Number.POSITIVE_INFINITY, >+ "Math.atanh should produce positive infinity for +1"); >+assert.sameValue(1 / Math.atanh(-0), Number.NEGATIVE_INFINITY, >+ "Math.atanh should produce -0 for -0"); >+assert.sameValue(1 / Math.atanh(0), Number.POSITIVE_INFINITY, >+ "Math.atanh should produce +0 for +0"); >diff --git a/JSTests/test262/test/built-ins/Math/cbrt/cbrt-specialValues.js b/JSTests/test262/test/built-ins/Math/cbrt/cbrt-specialValues.js >index 271c60cbdb3326a0b4560f9a21f729c54aabb7e5..9ac640cabec9872b4f110acc9cecb3ad1924e200 100644 >--- a/JSTests/test262/test/built-ins/Math/cbrt/cbrt-specialValues.js >+++ b/JSTests/test262/test/built-ins/Math/cbrt/cbrt-specialValues.js >@@ -1,18 +1,18 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.cbrt with special values >-es6id: 20.2.2.9 >----*/ >- >-assert.sameValue(Math.cbrt(NaN), Number.NaN, >- "Math.cbrt produces incorrect output for NaN"); >-assert.sameValue(Math.cbrt(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >- "Math.cbrt should produce negative infinity for Number.NEGATIVE_INFINITY"); >-assert.sameValue(Math.cbrt(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.cbrt should produce positive infinity for Number.POSITIVE_INFINITY"); >-assert.sameValue(1 / Math.cbrt(-0), Number.NEGATIVE_INFINITY, >- "Math.cbrt should produce -0 for -0"); >-assert.sameValue(1 / Math.cbrt(0), Number.POSITIVE_INFINITY, >- "Math.cbrt should produce +0 for +0"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.cbrt with special values >+es6id: 20.2.2.9 >+---*/ >+ >+assert.sameValue(Math.cbrt(NaN), Number.NaN, >+ "Math.cbrt produces incorrect output for NaN"); >+assert.sameValue(Math.cbrt(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >+ "Math.cbrt should produce negative infinity for Number.NEGATIVE_INFINITY"); >+assert.sameValue(Math.cbrt(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.cbrt should produce positive infinity for Number.POSITIVE_INFINITY"); >+assert.sameValue(1 / Math.cbrt(-0), Number.NEGATIVE_INFINITY, >+ "Math.cbrt should produce -0 for -0"); >+assert.sameValue(1 / Math.cbrt(0), Number.POSITIVE_INFINITY, >+ "Math.cbrt should produce +0 for +0"); >diff --git a/JSTests/test262/test/built-ins/Math/cbrt/prop-desc.js b/JSTests/test262/test/built-ins/Math/cbrt/prop-desc.js >index 0a5a2657cc17c7011b0ac74b48b5f63fcad410b7..e7d83a78fd1cbcd2ded06c9d62bb1de9f07f1dd3 100644 >--- a/JSTests/test262/test/built-ins/Math/cbrt/prop-desc.js >+++ b/JSTests/test262/test/built-ins/Math/cbrt/prop-desc.js >@@ -1,12 +1,12 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Testing descriptor property of Math.cbrt >-includes: [propertyHelper.js] >-es6id: 20.2.2.9 >----*/ >- >-verifyNotEnumerable(Math, "cbrt"); >-verifyWritable(Math, "cbrt"); >-verifyConfigurable(Math, "cbrt"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Testing descriptor property of Math.cbrt >+includes: [propertyHelper.js] >+es6id: 20.2.2.9 >+---*/ >+ >+verifyNotEnumerable(Math, "cbrt"); >+verifyWritable(Math, "cbrt"); >+verifyConfigurable(Math, "cbrt"); >diff --git a/JSTests/test262/test/built-ins/Math/cosh/cosh-specialVals.js b/JSTests/test262/test/built-ins/Math/cosh/cosh-specialVals.js >index 09bde42964007d0b810130af21aebd196963d6c7..ddb54453916d56d26df6580fe2b6dd18cb6e1f7d 100644 >--- a/JSTests/test262/test/built-ins/Math/cosh/cosh-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/cosh/cosh-specialVals.js >@@ -1,16 +1,16 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.cosh with special values >-es6id: 20.2.2.13 >----*/ >- >-assert.sameValue(Math.cosh(NaN), Number.NaN, >- "Math.cosh produces incorrect output for NaN"); >-assert.sameValue(Math.cosh(0), 1, "Math.cosh should produce 1 for input = 0"); >-assert.sameValue(Math.cosh(-0), 1, "Math.cosh should produce 1 for input = -0"); >-assert.sameValue(Math.cosh(Number.NEGATIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.cosh should produce Number.POSITIVE_INFINITY for Number.NEGATIVE_INFINITY"); >-assert.sameValue(Math.cosh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.cosh should produce Number.POSITIVE_INFINITY for Number.POSITIVE_INFINITY"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.cosh with special values >+es6id: 20.2.2.13 >+---*/ >+ >+assert.sameValue(Math.cosh(NaN), Number.NaN, >+ "Math.cosh produces incorrect output for NaN"); >+assert.sameValue(Math.cosh(0), 1, "Math.cosh should produce 1 for input = 0"); >+assert.sameValue(Math.cosh(-0), 1, "Math.cosh should produce 1 for input = -0"); >+assert.sameValue(Math.cosh(Number.NEGATIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.cosh should produce Number.POSITIVE_INFINITY for Number.NEGATIVE_INFINITY"); >+assert.sameValue(Math.cosh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.cosh should produce Number.POSITIVE_INFINITY for Number.POSITIVE_INFINITY"); >diff --git a/JSTests/test262/test/built-ins/Math/expm1/expm1-specialVals.js b/JSTests/test262/test/built-ins/Math/expm1/expm1-specialVals.js >index 1ca16baa9dd50fd54d9cbcb93fc001a79e762336..65aa97904d0eeb3fe121fc9865ca6b02a3b17005 100644 >--- a/JSTests/test262/test/built-ins/Math/expm1/expm1-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/expm1/expm1-specialVals.js >@@ -1,18 +1,18 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.expm1 with sample values. >-es6id: 20.2.2.15 >----*/ >- >-assert.sameValue(Math.expm1(NaN), Number.NaN, >- "Math.expm1 produces incorrect output for NaN"); >-assert.sameValue(Math.expm1(Number.NEGATIVE_INFINITY), -1, >- "Math.expm1 should produce -1 for Number.NEGATIVE_INFINITY"); >-assert.sameValue(Math.expm1(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.expm1 should produce POSITIVE infinity for Number.POSITIVE_INFINITY"); >-assert.sameValue(1 / Math.expm1(-0), Number.NEGATIVE_INFINITY, >- "Math.expm1 should produce -0 for -0"); >-assert.sameValue(1 / Math.expm1(0), Number.POSITIVE_INFINITY, >- "Math.expm1 should produce +0 for +0"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.expm1 with sample values. >+es6id: 20.2.2.15 >+---*/ >+ >+assert.sameValue(Math.expm1(NaN), Number.NaN, >+ "Math.expm1 produces incorrect output for NaN"); >+assert.sameValue(Math.expm1(Number.NEGATIVE_INFINITY), -1, >+ "Math.expm1 should produce -1 for Number.NEGATIVE_INFINITY"); >+assert.sameValue(Math.expm1(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.expm1 should produce POSITIVE infinity for Number.POSITIVE_INFINITY"); >+assert.sameValue(1 / Math.expm1(-0), Number.NEGATIVE_INFINITY, >+ "Math.expm1 should produce -0 for -0"); >+assert.sameValue(1 / Math.expm1(0), Number.POSITIVE_INFINITY, >+ "Math.expm1 should produce +0 for +0"); >diff --git a/JSTests/test262/test/built-ins/Math/log10/Log10-specialVals.js b/JSTests/test262/test/built-ins/Math/log10/Log10-specialVals.js >index e208dd0ebd68024d748b14b6f2297a1a51c094a6..341ea36e0913914e96bd29bfaa3cd6e3e3f6df42 100644 >--- a/JSTests/test262/test/built-ins/Math/log10/Log10-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/log10/Log10-specialVals.js >@@ -1,32 +1,32 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.Log10 with sample values. >-es6id: 20.2.2.20 >----*/ >- >-assert.sameValue(Math.log10(-0), Number.NEGATIVE_INFINITY, >- "Math.log10 produces incorrect output for -0"); >-assert.sameValue(Math.log10(+0), Number.NEGATIVE_INFINITY, >- "Math.log10 produces incorrect output for +0"); >-assert.sameValue(Math.log10(-0.9), Number.NaN, >- "Math.log10 produces incorrect output for -0.9"); >-assert.sameValue(Math.log10(NaN), Number.NaN, >- "Math.log10 produces incorrect output for NaN"); >-assert.sameValue(Math.log10(-10), Number.NaN, >- "Math.log10 produces incorrect output for -10"); >-assert.sameValue(Math.log10(null), Number.NEGATIVE_INFINITY, >- "Math.log10 produces incorrect output for null"); >-assert.sameValue(Math.log10(undefined), Number.NaN, >- "Math.log10 produces incorrect output for undefined"); >-assert.sameValue(Math.log10(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.log10 produces incorrect output for Number.POSITIVE_INFINITY"); >-assert.sameValue(Math.log10(1), 0, >- "Math.log10 produces incorrect output for 1"); >-assert.sameValue(Math.log10(10.00), 1, >- "Math.log10 produces incorrect output for 10.00"); >-assert.sameValue(Math.log10(100.00), 2, >- "Math.log10 produces incorrect output for 100.00"); >-assert.sameValue(Math.log10(1000.00), 3, >- "Math.log10 produces incorrect output for 1000.00"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.Log10 with sample values. >+es6id: 20.2.2.20 >+---*/ >+ >+assert.sameValue(Math.log10(-0), Number.NEGATIVE_INFINITY, >+ "Math.log10 produces incorrect output for -0"); >+assert.sameValue(Math.log10(+0), Number.NEGATIVE_INFINITY, >+ "Math.log10 produces incorrect output for +0"); >+assert.sameValue(Math.log10(-0.9), Number.NaN, >+ "Math.log10 produces incorrect output for -0.9"); >+assert.sameValue(Math.log10(NaN), Number.NaN, >+ "Math.log10 produces incorrect output for NaN"); >+assert.sameValue(Math.log10(-10), Number.NaN, >+ "Math.log10 produces incorrect output for -10"); >+assert.sameValue(Math.log10(null), Number.NEGATIVE_INFINITY, >+ "Math.log10 produces incorrect output for null"); >+assert.sameValue(Math.log10(undefined), Number.NaN, >+ "Math.log10 produces incorrect output for undefined"); >+assert.sameValue(Math.log10(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.log10 produces incorrect output for Number.POSITIVE_INFINITY"); >+assert.sameValue(Math.log10(1), 0, >+ "Math.log10 produces incorrect output for 1"); >+assert.sameValue(Math.log10(10.00), 1, >+ "Math.log10 produces incorrect output for 10.00"); >+assert.sameValue(Math.log10(100.00), 2, >+ "Math.log10 produces incorrect output for 100.00"); >+assert.sameValue(Math.log10(1000.00), 3, >+ "Math.log10 produces incorrect output for 1000.00"); >diff --git a/JSTests/test262/test/built-ins/Math/log2/log2-basicTests.js b/JSTests/test262/test/built-ins/Math/log2/log2-basicTests.js >index 59b5c9dd189a9354bb2100bd6351c672b6ebcdc7..bd3bb510a3a9f6786ce575c1d2dfe501f318c935 100644 >--- a/JSTests/test262/test/built-ins/Math/log2/log2-basicTests.js >+++ b/JSTests/test262/test/built-ins/Math/log2/log2-basicTests.js >@@ -1,34 +1,34 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.Log2 with sample values. >-es6id: 20.2.2.23 >----*/ >- >-assert.sameValue(Math.log2(-0), Number.NEGATIVE_INFINITY, >- "Math.log2 produces incorrect output for -0"); >-assert.sameValue(Math.log2(+0), Number.NEGATIVE_INFINITY, >- "Math.log2 produces incorrect output for +0"); >-assert.sameValue(Math.log2(-0.9), NaN, >- "Math.log2 produces incorrect output for -0.9"); >-assert.sameValue(Math.log2(NaN), NaN, >- "Math.log2 produces incorrect output for NaN"); >-assert.sameValue(Math.log2(-10), NaN, >- "Math.log2 produces incorrect output for -10"); >-assert.sameValue(Math.log2(-Infinity), NaN, >- "Math.log2 produces incorrect output for -Infinity"); >-assert.sameValue(Math.log2(null), Number.NEGATIVE_INFINITY, >- "Math.log2 produces incorrect output for null"); >-assert.sameValue(Math.log2(undefined), NaN, >- "Math.log2 produces incorrect output for undefined"); >-assert.sameValue(Math.log2(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.log2 produces incorrect output for Number.POSITIVE_INFINITY"); >-assert.sameValue(Math.log2(1), 0, >- "Math.log2 produces incorrect output for 1"); >-assert.sameValue(Math.log2(2.00), 1, >- "Math.log2 produces incorrect output for 2.00"); >-assert.sameValue(Math.log2(4.00), 2, >- "Math.log2 produces incorrect output for 4.00"); >-assert.sameValue(Math.log2(8.00), 3, >- "Math.log2 produces incorrect output for 8.00"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.Log2 with sample values. >+es6id: 20.2.2.23 >+---*/ >+ >+assert.sameValue(Math.log2(-0), Number.NEGATIVE_INFINITY, >+ "Math.log2 produces incorrect output for -0"); >+assert.sameValue(Math.log2(+0), Number.NEGATIVE_INFINITY, >+ "Math.log2 produces incorrect output for +0"); >+assert.sameValue(Math.log2(-0.9), NaN, >+ "Math.log2 produces incorrect output for -0.9"); >+assert.sameValue(Math.log2(NaN), NaN, >+ "Math.log2 produces incorrect output for NaN"); >+assert.sameValue(Math.log2(-10), NaN, >+ "Math.log2 produces incorrect output for -10"); >+assert.sameValue(Math.log2(-Infinity), NaN, >+ "Math.log2 produces incorrect output for -Infinity"); >+assert.sameValue(Math.log2(null), Number.NEGATIVE_INFINITY, >+ "Math.log2 produces incorrect output for null"); >+assert.sameValue(Math.log2(undefined), NaN, >+ "Math.log2 produces incorrect output for undefined"); >+assert.sameValue(Math.log2(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.log2 produces incorrect output for Number.POSITIVE_INFINITY"); >+assert.sameValue(Math.log2(1), 0, >+ "Math.log2 produces incorrect output for 1"); >+assert.sameValue(Math.log2(2.00), 1, >+ "Math.log2 produces incorrect output for 2.00"); >+assert.sameValue(Math.log2(4.00), 2, >+ "Math.log2 produces incorrect output for 4.00"); >+assert.sameValue(Math.log2(8.00), 3, >+ "Math.log2 produces incorrect output for 8.00"); >diff --git a/JSTests/test262/test/built-ins/Math/prop-desc.js b/JSTests/test262/test/built-ins/Math/prop-desc.js >index b78c0bb93875624e2a95b3f1b0abc8a9d2f214d6..682fc0bd33edfd191593ecc8c89a19adff249f8a 100644 >--- a/JSTests/test262/test/built-ins/Math/prop-desc.js >+++ b/JSTests/test262/test/built-ins/Math/prop-desc.js >@@ -2,18 +2,18 @@ > // This code is governed by the BSD license found in the LICENSE file. > > /*--- >-es6id: 20.2 > esid: sec-math-object > description: > > Property descriptor of Math > info: | > The Math Object > >- [...] >- The Math object is not a function object. It does not have a [[Construct]] >- internal method; it is not possible to use the Math object as a constructor >- with the new operator. The Math object also does not have a [[Call]] internal >- method; it is not possible to invoke the Math object as a function. >+ ... >+ The Math object does not have a [[Construct]] internal method; >+ it is not possible to use the Math object as a constructor with the new operator. >+ >+ The Math object does not have a [[Call]] internal method; >+ it is not possible to invoke the Math object as a function. > > 17 ECMAScript Standard Built-in Objects: > >@@ -23,11 +23,18 @@ info: | > includes: [propertyHelper.js] > ---*/ > >-assert.sameValue(typeof Math, "object", "no [[Call]]"); >+assert.sameValue(typeof Math, "object"); >+ >+assert.throws(TypeError, function() { >+ Math(); >+}, "no [[Call]]"); >+ > assert.throws(TypeError, function() { > new Math(); > }, "no [[Construct]]"); > >-verifyNotEnumerable(this, "Math"); >-verifyWritable(this, "Math"); >-verifyConfigurable(this, "Math"); >+verifyProperty(this, "Math", { >+ enumerable: false, >+ writable: true, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/built-ins/Math/sign/sign-specialVals.js b/JSTests/test262/test/built-ins/Math/sign/sign-specialVals.js >index 0e63fe895f2b2410cf9c8393fb7627e10fe4f402..9026c223ce3124d860310b5fbbffe9b88e1f6733 100644 >--- a/JSTests/test262/test/built-ins/Math/sign/sign-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/sign/sign-specialVals.js >@@ -1,20 +1,20 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: > >- Returns the sign of the x, indicating whether x is positive, negative or zero. >-es6id: 20.2.2.29 >----*/ >- >-assert.sameValue(Math.sign(NaN), NaN, "NaN"); >-assert.sameValue(Math.sign(-0), -0, "-0"); >-assert.sameValue(Math.sign(0), 0, "0"); >- >-assert.sameValue(Math.sign(-0.000001), -1, "-0.000001"); >-assert.sameValue(Math.sign(-1), -1, "-1"); >-assert.sameValue(Math.sign(-Infinity), -1, "-Infinity"); >- >-assert.sameValue(Math.sign(0.000001), 1, "0.000001"); >-assert.sameValue(Math.sign(1), 1, "1"); >-assert.sameValue(Math.sign(Infinity), 1, "Infinity"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: > >+ Returns the sign of the x, indicating whether x is positive, negative or zero. >+es6id: 20.2.2.29 >+---*/ >+ >+assert.sameValue(Math.sign(NaN), NaN, "NaN"); >+assert.sameValue(Math.sign(-0), -0, "-0"); >+assert.sameValue(Math.sign(0), 0, "0"); >+ >+assert.sameValue(Math.sign(-0.000001), -1, "-0.000001"); >+assert.sameValue(Math.sign(-1), -1, "-1"); >+assert.sameValue(Math.sign(-Infinity), -1, "-Infinity"); >+ >+assert.sameValue(Math.sign(0.000001), 1, "0.000001"); >+assert.sameValue(Math.sign(1), 1, "1"); >+assert.sameValue(Math.sign(Infinity), 1, "Infinity"); >diff --git a/JSTests/test262/test/built-ins/Math/sinh/sinh-specialVals.js b/JSTests/test262/test/built-ins/Math/sinh/sinh-specialVals.js >index 9f0b5e23b2b8dec72be1cfd1e790b5cce3d14526..beda3cd0f8a05c167959f0370ba510eaeaf031e4 100644 >--- a/JSTests/test262/test/built-ins/Math/sinh/sinh-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/sinh/sinh-specialVals.js >@@ -1,18 +1,18 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.sinh with special values >-es6id: 20.2.2.31 >----*/ >- >-assert.sameValue(Math.sinh(NaN), Number.NaN, >- "Math.sinh produces incorrect output for NaN"); >-assert.sameValue(Math.sinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >- "Math.sinh should produce negative infinity for Number.NEGATIVE_INFINITY"); >-assert.sameValue(Math.sinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.sinh should produce positive infinity for Number.POSITIVE_INFINITY"); >-assert.sameValue(1 / Math.sinh(-0), Number.NEGATIVE_INFINITY, >- "Math.sinh should produce -0 for -0"); >-assert.sameValue(1 / Math.sinh(0), Number.POSITIVE_INFINITY, >- "Math.sinh should produce +0 for +0"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.sinh with special values >+es6id: 20.2.2.31 >+---*/ >+ >+assert.sameValue(Math.sinh(NaN), Number.NaN, >+ "Math.sinh produces incorrect output for NaN"); >+assert.sameValue(Math.sinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >+ "Math.sinh should produce negative infinity for Number.NEGATIVE_INFINITY"); >+assert.sameValue(Math.sinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.sinh should produce positive infinity for Number.POSITIVE_INFINITY"); >+assert.sameValue(1 / Math.sinh(-0), Number.NEGATIVE_INFINITY, >+ "Math.sinh should produce -0 for -0"); >+assert.sameValue(1 / Math.sinh(0), Number.POSITIVE_INFINITY, >+ "Math.sinh should produce +0 for +0"); >diff --git a/JSTests/test262/test/built-ins/Math/tanh/tanh-specialVals.js b/JSTests/test262/test/built-ins/Math/tanh/tanh-specialVals.js >index 4b1a729b753c28b175fdd634f79a95c4e908945e..a26b2af2aa7e4eff5e4e681dc6e130a7fce89d57 100644 >--- a/JSTests/test262/test/built-ins/Math/tanh/tanh-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/tanh/tanh-specialVals.js >@@ -1,18 +1,18 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.tanh with special values >-es6id: 20.2.2.34 >----*/ >- >-assert.sameValue(Math.tanh(NaN), Number.NaN, >- "Math.tanh produces incorrect output for NaN"); >-assert.sameValue(Math.tanh(Number.NEGATIVE_INFINITY), -1, >- "Math.tanh should produce -1 for Number.NEGATIVE_INFINITY"); >-assert.sameValue(Math.tanh(Number.POSITIVE_INFINITY), 1, >- "Math.tanh should produce 1 for Number.POSITIVE_INFINITY"); >-assert.sameValue(1 / Math.tanh(-0), Number.NEGATIVE_INFINITY, >- "Math.tanh should produce -0 for -0"); >-assert.sameValue(1 / Math.tanh(0), Number.POSITIVE_INFINITY, >- "Math.tanh should produce +0 for +0"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.tanh with special values >+es6id: 20.2.2.34 >+---*/ >+ >+assert.sameValue(Math.tanh(NaN), Number.NaN, >+ "Math.tanh produces incorrect output for NaN"); >+assert.sameValue(Math.tanh(Number.NEGATIVE_INFINITY), -1, >+ "Math.tanh should produce -1 for Number.NEGATIVE_INFINITY"); >+assert.sameValue(Math.tanh(Number.POSITIVE_INFINITY), 1, >+ "Math.tanh should produce 1 for Number.POSITIVE_INFINITY"); >+assert.sameValue(1 / Math.tanh(-0), Number.NEGATIVE_INFINITY, >+ "Math.tanh should produce -0 for -0"); >+assert.sameValue(1 / Math.tanh(0), Number.POSITIVE_INFINITY, >+ "Math.tanh should produce +0 for +0"); >diff --git a/JSTests/test262/test/built-ins/Math/trunc/trunc-sampleTests.js b/JSTests/test262/test/built-ins/Math/trunc/trunc-sampleTests.js >index 59d3d8dbdc1a4a3f85396c3f67f8890071e88aa5..a99c6cb50c6e50e1b40b0143e8857033b558b3a1 100644 >--- a/JSTests/test262/test/built-ins/Math/trunc/trunc-sampleTests.js >+++ b/JSTests/test262/test/built-ins/Math/trunc/trunc-sampleTests.js >@@ -1,47 +1,47 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: sample tests for trunc >-es6id: 20.2.2.35 >----*/ >- >-assert.sameValue(1 / Math.trunc(0.02047410048544407), Number.POSITIVE_INFINITY, >- "Math.trunc should produce +0 for values between 0 and 1"); >-assert.sameValue(1 / Math.trunc(0.00000000000000001), Number.POSITIVE_INFINITY, >- "Math.trunc should produce +0 for values between 0 and 1"); >-assert.sameValue(1 / Math.trunc(0.9999999999999999), Number.POSITIVE_INFINITY, >- "Math.trunc should produce +0 for values between 0 and 1"); >-assert.sameValue(1 / Math.trunc(Number.EPSILON), Number.POSITIVE_INFINITY, >- "Math.trunc should produce +0 for values between 0 and 1"); >-assert.sameValue(1 / Math.trunc(Number.MIN_VALUE), Number.POSITIVE_INFINITY, >- "Math.trunc should produce +0 for values between 0 and 1"); >- >-assert.sameValue(1 / Math.trunc(-0.02047410048544407), Number.NEGATIVE_INFINITY, >- "Math.trunc should produce -0 for values between -1 and 0"); >-assert.sameValue(1 / Math.trunc(-0.00000000000000001), Number.NEGATIVE_INFINITY, >- "Math.trunc should produce -0 for values between -1 and 0"); >-assert.sameValue(1 / Math.trunc(-0.9999999999999999), Number.NEGATIVE_INFINITY, >- "Math.trunc should produce -0 for values between -1 and 0"); >-assert.sameValue(1 / Math.trunc(-Number.EPSILON), Number.NEGATIVE_INFINITY, >- "Math.trunc should produce -0 for values between -1 and 0"); >-assert.sameValue(1 / Math.trunc(-Number.MIN_VALUE), Number.NEGATIVE_INFINITY, >- "Math.trunc should produce -0 for values between -1 and 0"); >- >-assert.sameValue(Math.trunc(Number.MAX_VALUE), Math.floor(Number.MAX_VALUE), >- "Math.trunc produces incorrect result for Number.MAX_VALUE"); >-assert.sameValue(Math.trunc(10), Math.floor(10), >- "Math.trunc produces incorrect result for 10"); >-assert.sameValue(Math.trunc(3.9), Math.floor(3.9), >- "Math.trunc produces incorrect result for 3.9"); >-assert.sameValue(Math.trunc(4.9), Math.floor(4.9), >- "Math.trunc produces incorrect result for 4.9"); >- >-assert.sameValue(Math.trunc(-Number.MAX_VALUE), Math.ceil(-Number.MAX_VALUE), >- "Math.trunc produces incorrect result for -Number.MAX_VALUE"); >-assert.sameValue(Math.trunc(-10), Math.ceil(-10), >- "Math.trunc produces incorrect result for -10"); >-assert.sameValue(Math.trunc(-3.9), Math.ceil(-3.9), >- "Math.trunc produces incorrect result for -3.9"); >-assert.sameValue(Math.trunc(-4.9), Math.ceil(-4.9), >- "Math.trunc produces incorrect result for -4.9"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: sample tests for trunc >+es6id: 20.2.2.35 >+---*/ >+ >+assert.sameValue(1 / Math.trunc(0.02047410048544407), Number.POSITIVE_INFINITY, >+ "Math.trunc should produce +0 for values between 0 and 1"); >+assert.sameValue(1 / Math.trunc(0.00000000000000001), Number.POSITIVE_INFINITY, >+ "Math.trunc should produce +0 for values between 0 and 1"); >+assert.sameValue(1 / Math.trunc(0.9999999999999999), Number.POSITIVE_INFINITY, >+ "Math.trunc should produce +0 for values between 0 and 1"); >+assert.sameValue(1 / Math.trunc(Number.EPSILON), Number.POSITIVE_INFINITY, >+ "Math.trunc should produce +0 for values between 0 and 1"); >+assert.sameValue(1 / Math.trunc(Number.MIN_VALUE), Number.POSITIVE_INFINITY, >+ "Math.trunc should produce +0 for values between 0 and 1"); >+ >+assert.sameValue(1 / Math.trunc(-0.02047410048544407), Number.NEGATIVE_INFINITY, >+ "Math.trunc should produce -0 for values between -1 and 0"); >+assert.sameValue(1 / Math.trunc(-0.00000000000000001), Number.NEGATIVE_INFINITY, >+ "Math.trunc should produce -0 for values between -1 and 0"); >+assert.sameValue(1 / Math.trunc(-0.9999999999999999), Number.NEGATIVE_INFINITY, >+ "Math.trunc should produce -0 for values between -1 and 0"); >+assert.sameValue(1 / Math.trunc(-Number.EPSILON), Number.NEGATIVE_INFINITY, >+ "Math.trunc should produce -0 for values between -1 and 0"); >+assert.sameValue(1 / Math.trunc(-Number.MIN_VALUE), Number.NEGATIVE_INFINITY, >+ "Math.trunc should produce -0 for values between -1 and 0"); >+ >+assert.sameValue(Math.trunc(Number.MAX_VALUE), Math.floor(Number.MAX_VALUE), >+ "Math.trunc produces incorrect result for Number.MAX_VALUE"); >+assert.sameValue(Math.trunc(10), Math.floor(10), >+ "Math.trunc produces incorrect result for 10"); >+assert.sameValue(Math.trunc(3.9), Math.floor(3.9), >+ "Math.trunc produces incorrect result for 3.9"); >+assert.sameValue(Math.trunc(4.9), Math.floor(4.9), >+ "Math.trunc produces incorrect result for 4.9"); >+ >+assert.sameValue(Math.trunc(-Number.MAX_VALUE), Math.ceil(-Number.MAX_VALUE), >+ "Math.trunc produces incorrect result for -Number.MAX_VALUE"); >+assert.sameValue(Math.trunc(-10), Math.ceil(-10), >+ "Math.trunc produces incorrect result for -10"); >+assert.sameValue(Math.trunc(-3.9), Math.ceil(-3.9), >+ "Math.trunc produces incorrect result for -3.9"); >+assert.sameValue(Math.trunc(-4.9), Math.ceil(-4.9), >+ "Math.trunc produces incorrect result for -4.9"); >diff --git a/JSTests/test262/test/built-ins/Math/trunc/trunc-specialVals.js b/JSTests/test262/test/built-ins/Math/trunc/trunc-specialVals.js >index 4339aba11daf73244015c0ce3faa2c99f8bfae26..19efbf6b658e883756d0933d1bceb7c3b3a8ae23 100644 >--- a/JSTests/test262/test/built-ins/Math/trunc/trunc-specialVals.js >+++ b/JSTests/test262/test/built-ins/Math/trunc/trunc-specialVals.js >@@ -1,16 +1,16 @@ >-// Copyright 2015 Microsoft Corporation. All rights reserved. >-// This code is governed by the license found in the LICENSE file. >- >-/*--- >-description: Math.trunc with sample values. >-es6id: 20.2.2.35 >----*/ >- >-assert.sameValue(Math.trunc(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >- "Math.trunc should produce negative infinity for Number.NEGATIVE_INFINITY"); >-assert.sameValue(Math.trunc(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >- "Math.trunc should produce positive infinity for Number.POSITIVE_INFINITY"); >-assert.sameValue(1 / Math.trunc(-0), Number.NEGATIVE_INFINITY, >- "Math.trunc should produce -0 for -0"); >-assert.sameValue(1 / Math.trunc(0), Number.POSITIVE_INFINITY, >- "Math.trunc should produce +0 for +0"); >+// Copyright 2015 Microsoft Corporation. All rights reserved. >+// This code is governed by the license found in the LICENSE file. >+ >+/*--- >+description: Math.trunc with sample values. >+es6id: 20.2.2.35 >+---*/ >+ >+assert.sameValue(Math.trunc(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, >+ "Math.trunc should produce negative infinity for Number.NEGATIVE_INFINITY"); >+assert.sameValue(Math.trunc(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, >+ "Math.trunc should produce positive infinity for Number.POSITIVE_INFINITY"); >+assert.sameValue(1 / Math.trunc(-0), Number.NEGATIVE_INFINITY, >+ "Math.trunc should produce -0 for -0"); >+assert.sameValue(1 / Math.trunc(0), Number.POSITIVE_INFINITY, >+ "Math.trunc should produce +0 for +0"); >diff --git a/JSTests/test262/test/built-ins/Object/assign/strings-and-symbol-order.js b/JSTests/test262/test/built-ins/Object/assign/strings-and-symbol-order.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8372154f9574b282837c16f3dfd580a85975a43b >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Object/assign/strings-and-symbol-order.js >@@ -0,0 +1,61 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-object.assign >+description: > >+ Symbol-valued properties are copied after String-valued properties. >+info: | >+ 19.1.2.1 Object.assign ( target, ...sources ) >+ >+ ... >+ 4. For each element nextSource of sources, in ascending index order, do >+ a. ... >+ b. Else, >+ i. Let from be ! ToObject(nextSource). >+ ii. Let keys be ? from.[[OwnPropertyKeys]](). >+ c. For each element nextKey of keys in List order, do >+ ... >+ ... >+ >+ 9.1.11.1 OrdinaryOwnPropertyKeys ( O ) >+ >+ ... >+ 3. For each own property key P of O that is a String but is not an integer index, >+ in ascending chronological order of property creation, do >+ a. Add P as the last element of keys. >+ 4. For each own property key P of O that is a Symbol, in ascending chronological >+ order of property creation, do >+ a. Add P as the last element of keys. >+ ... >+ >+includes: [compareArray.js] >+---*/ >+ >+var log = []; >+ >+var sym1 = Symbol("x"); >+var sym2 = Symbol("y"); >+ >+var source = {}; >+ >+Object.defineProperty(source, sym1, { >+ get: function(){ log.push("get sym(x)") }, >+ enumerable: true, configurable: true, >+}); >+Object.defineProperty(source, "a", { >+ get: function(){ log.push("get a") }, >+ enumerable: true, configurable: true, >+}); >+Object.defineProperty(source, sym2, { >+ get: function(){ log.push("get sym(y)") }, >+ enumerable: true, configurable: true, >+}); >+Object.defineProperty(source, "b", { >+ get: function(){ log.push("get b") }, >+ enumerable: true, configurable: true, >+}); >+ >+var target = Object.assign({}, source); >+ >+assert.compareArray(log, ["get a", "get b", "get sym(x)", "get sym(y)"]); >diff --git a/JSTests/test262/test/built-ins/Object/keys/property-traps-order-with-proxied-array.js b/JSTests/test262/test/built-ins/Object/keys/property-traps-order-with-proxied-array.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c93d72771e8aaae3235d09a1550186f52e95988d >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Object/keys/property-traps-order-with-proxied-array.js >@@ -0,0 +1,37 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-object.keys >+description: > >+ Ensure the correct property traps are called on a proxy of an array. >+info: | >+ 19.1.2.16 Object.keys ( O ) >+ ... >+ 2. Let nameList be ? EnumerableOwnPropertyNames(obj, "key"). >+ ... >+ >+ 7.3.21 EnumerableOwnPropertyNames ( O, kind ) >+ ... >+ 2. Let ownKeys be ? O.[[OwnPropertyKeys]](). >+ ... >+ 4. For each element key of ownKeys in List order, do >+ a. If Type(key) is String, then >+ i. Let desc be ? O.[[GetOwnProperty]](key). >+ ... >+features: [Proxy] >+includes: [compareArray.js] >+---*/ >+ >+var log = []; >+ >+Object.keys(new Proxy([], new Proxy({},{ >+ get(t, pk, r) { >+ log.push(pk); >+ } >+}))); >+ >+assert.compareArray([ >+ "ownKeys", >+ "getOwnPropertyDescriptor", >+], log); >diff --git a/JSTests/test262/test/built-ins/Reflect/Reflect.js b/JSTests/test262/test/built-ins/Reflect/Reflect.js >deleted file mode 100644 >index 2500acb2b654cc7f2d73d6347d5762b8f52fdd91..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Reflect/Reflect.js >+++ /dev/null >@@ -1,31 +0,0 @@ >-// Copyright (C) 2015 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-es6id: 26.1 >-description: > >- The Reflect object is an ordinary object. >-info: | >- 26.1 The Reflect Object >- >- The Reflect object is the %Reflect% intrinsic object and the initial value of >- the Reflect property of the global object. The Reflect object is an ordinary >- object. >- >- The Reflect object is not a function object. It does not have a [[Construct]] >- internal method; it is not possible to use the Reflect object as a constructor >- with the new operator. The Reflect object also does not have a [[Call]] >- internal method; it is not possible to invoke the Reflect object as a >- function. >----*/ >- >-assert.sameValue(typeof Reflect, 'object', '`typeof Reflect` is `"object"`'); >- >-// Reflect is not callable >-assert.throws(TypeError, function() { >- Reflect(); >-}); >- >-// Reflect doesn't have a constructor >-assert.throws(TypeError, function() { >- new Reflect(); >-}); >diff --git a/JSTests/test262/test/built-ins/Reflect/prop-desc.js b/JSTests/test262/test/built-ins/Reflect/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..72fee3c151c0c01403a21c4fd2b15789c9080f96 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Reflect/prop-desc.js >@@ -0,0 +1,40 @@ >+// Copyright (C) 2016 The V8 Project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-math-object >+description: > >+ Property descriptor of Reflect >+info: | >+ The Reflect Object >+ >+ ... >+ The Reflect object does not have a [[Construct]] internal method; >+ it is not possible to use the Reflect object as a constructor with the new operator. >+ >+ The Reflect object does not have a [[Call]] internal method; >+ it is not possible to invoke the Reflect object as a function. >+ >+ 17 ECMAScript Standard Built-in Objects: >+ >+ Every other data property described in clauses 18 through 26 and in Annex B.2 >+ has the attributes { [[Writable]]: true, [[Enumerable]]: false, >+ [[Configurable]]: true } unless otherwise specified. >+includes: [propertyHelper.js] >+---*/ >+ >+assert.sameValue(typeof Reflect, "object"); >+ >+assert.throws(TypeError, function() { >+ Reflect(); >+}, "no [[Call]]"); >+ >+assert.throws(TypeError, function() { >+ new Reflect(); >+}, "no [[Construct]]"); >+ >+verifyProperty(this, "Reflect", { >+ enumerable: false, >+ writable: true, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/built-ins/Reflect/properties.js b/JSTests/test262/test/built-ins/Reflect/properties.js >deleted file mode 100644 >index d39c350ba3ed732767edafdee2eedae54c4f98c7..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/built-ins/Reflect/properties.js >+++ /dev/null >@@ -1,14 +0,0 @@ >-// Copyright (C) 2015 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-es6id: 26.1 >-description: > >- Reflect is configurable, writable and not enumerable. >-info: | >- 17 ECMAScript Standard Built-in Objects >-includes: [propertyHelper.js] >----*/ >- >-verifyNotEnumerable(this, 'Reflect'); >-verifyWritable(this, 'Reflect'); >-verifyConfigurable(this, 'Reflect'); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/internal-regexp-lastindex-not-zero.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/internal-regexp-lastindex-not-zero.js >new file mode 100644 >index 0000000000000000000000000000000000000000..944ef30989eed624e7497de72e816761a7d2c943 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/internal-regexp-lastindex-not-zero.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ Throws TypeError when internally created RegExp's lastIndex is not 0 >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ 3. Else, >+ a. Let matcher be RegExpCreate(R, "g"). >+ b. If ? IsRegExp(matcher) is not true, throw a TypeError exception. >+ [...] >+ 3. If Get(matcher, "lastIndex") is not 0, throw a TypeError exception. >+features: [Symbol.match, Symbol.matchAll] >+---*/ >+ >+Object.defineProperty(RegExp.prototype, Symbol.match, { >+ get() { >+ this.lastIndex = 1; >+ return true; >+ } >+}); >+ >+assert.throws(TypeError, function() { >+ RegExp.prototype[Symbol.matchAll].call({}, ''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-is-false.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-is-false.js >new file mode 100644 >index 0000000000000000000000000000000000000000..214e9b7efd29fe7cf9293e6005a94a4fcda70644 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-is-false.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Throws TypeError when internally created RegExp's @@match is false >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ 3. Else, >+ a. Let matcher be RegExpCreate(R, "g"). >+ b. If ? IsRegExp(matcher) is not true, throw a TypeError exception. >+features: [Symbol.match, Symbol.matchAll] >+---*/ >+ >+Object.defineProperty(RegExp.prototype, Symbol.match, { >+ get() { >+ return false; >+ } >+}); >+ >+assert.throws(TypeError, function() { >+ RegExp.prototype[Symbol.matchAll].call({}, ''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..70b62da39f54a3ab09ca8cc01b1faa5fd62f53b7 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-internal-regexp-throws.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown while accessing @@match property >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ 3. Else, >+ a. Let matcher be RegExpCreate(R, "g"). >+ b. If ? IsRegExp(matcher) is not true, throw a TypeError exception. >+features: [Symbol.match, Symbol.matchAll] >+---*/ >+ >+Object.defineProperty(RegExp.prototype, Symbol.match, { >+ get() { >+ throw new Test262Error(); >+ } >+}); >+ >+assert.throws(Test262Error, function() { >+ RegExp.prototype[Symbol.matchAll].call({}, ''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ce31f3392fb8483c113205243a2ccbf52e4b9f5e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/isregexp-this-throws.js >@@ -0,0 +1,26 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown while accessing RegExp's @@match property >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+features: [Symbol.match, Symbol.matchAll] >+---*/ >+ >+var obj = { >+ get [Symbol.match]() { >+ throw new Test262Error(); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ RegExp.prototype[Symbol.matchAll].call(obj, ''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/length.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/length.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7aee38c0cb72bd3fb5c9747a4e12b9abab673f41 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/length.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: RegExp.prototype[Symbol.matchAll] `length` property >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every built-in function object, including constructors, has a length >+ property whose value is an integer. Unless otherwise specified, this >+ value is equal to the largest number of named arguments shown in the >+ subclause headings for the function description. Optional parameters >+ (which are indicated with brackets: [ ]) or rest parameters (which >+ are shown using the form «...name») are not included in the default >+ argument count. >+ >+ Unless otherwise specified, the length property of a built-in function >+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false, >+ [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Symbol.matchAll] >+---*/ >+ >+assert.sameValue(RegExp.prototype[Symbol.matchAll].length, 1); >+ >+verifyNotEnumerable(RegExp.prototype[Symbol.matchAll], 'length'); >+verifyNotWritable(RegExp.prototype[Symbol.matchAll], 'length'); >+verifyConfigurable(RegExp.prototype[Symbol.matchAll], 'length'); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/name.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/name.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b6030216425e225a4c5755d525d3d156bf771ac4 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/name.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: RegExp.prototype[Symbol.matchAll] `name` property >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every built-in function object, including constructors, that is not >+ identified as an anonymous function has a name property whose value >+ is a String. >+ >+ [...] >+ >+ Unless otherwise specified, the name property of a built-in function >+ object, if it exists, has the attributes { [[Writable]]: false, >+ [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Symbol.matchAll] >+---*/ >+ >+assert.sameValue(RegExp.prototype[Symbol.matchAll].name, '[Symbol.matchAll]'); >+ >+verifyNotEnumerable(RegExp.prototype[Symbol.matchAll], 'name'); >+verifyNotWritable(RegExp.prototype[Symbol.matchAll], 'name'); >+verifyConfigurable(RegExp.prototype[Symbol.matchAll], 'name'); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..63d27c57b783d89e641cb9a18bcd684bce0ea470 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/prop-desc.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: RegExp.prototype[Symbol.matchAll] property descriptor >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every other data property described in clauses 18 through 26 and in Annex >+ B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, >+ [[Configurable]]: true } unless otherwise specified. >+includes: [propertyHelper.js] >+features: [Symbol.matchAll] >+---*/ >+ >+assert.sameValue(typeof RegExp.prototype[Symbol.matchAll], 'function'); >+ >+verifyNotEnumerable(RegExp.prototype, Symbol.matchAll); >+verifyWritable(RegExp.prototype, Symbol.matchAll); >+verifyConfigurable(RegExp.prototype, Symbol.matchAll); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d34b563c2827ae2e8c5c1d078c407e9d87743a4a >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/regexpcreate-this-throws.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors while creating an internal RegExp >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ 3. Else, >+ a. Let R be RegExpCreate(R, "g"). >+features: [Symbol.matchAll] >+---*/ >+ >+var obj = { >+ toString() { >+ throw new Test262Error(); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ RegExp.prototype[Symbol.matchAll].call(obj, ''); >+}); >+ >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..2c255853ee3b9cab422dc3473cbea92a8b32da90 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-constructor-throws.js >@@ -0,0 +1,32 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ Re-throws errors thrown while accessing RegExp's constructor property >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ a. Let C be ? SpeciesConstructor(R, RegExp). >+ >+ SpeciesConstructor ( O, defaultConstructor ) >+ [...] >+ 2. Let C be ? Get(O, "constructor"). >+features: [Symbol.matchAll] >+---*/ >+ >+var regexp = /./; >+Object.defineProperty(regexp, 'constructor', { >+ get(){ >+ throw new Test262Error(); >+ } >+}); >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..3e429a88dc7d29189cafb487baa3be1de05d3060 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-get-species-throws.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown while accessing of @@species property >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ a. Let C be ? SpeciesConstructor(R, RegExp). >+ >+ SpeciesConstructor ( O, defaultConstructor ) >+ [...] >+ 2. Let C be ? Get(O, "constructor"). >+features: [Symbol.matchAll, Symbol.species] >+---*/ >+ >+var regexp = /./; >+regexp.constructor = { >+ get [Symbol.species]() { >+ throw new Test262Error(); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d26752a94157e21db4136a66191409b1dc6deb15 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-not-object-throws.js >@@ -0,0 +1,41 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Throws TypeError if `constructor` property is not an object >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ a. Let C be ? SpeciesConstructor(R, RegExp). >+ >+ SpeciesConstructor ( O, defaultConstructor ) >+ [...] >+ 2. Let C be ? Get(O, "constructor"). >+ 3. If C is undefined, return defaultConstructor. >+ 4. If Type(C) is not Object, throw a TypeError exception. >+features: [Symbol.matchAll] >+---*/ >+ >+var regexp = /./; >+ >+function callMatchAll() { regexp[Symbol.matchAll](''); } >+ >+regexp.constructor = null; >+assert.throws(TypeError, callMatchAll, "`constructor` value is null"); >+ >+regexp.constructor = true; >+assert.throws(TypeError, callMatchAll, "`constructor` value is Boolean"); >+ >+regexp.constructor = ""; >+assert.throws(TypeError, callMatchAll, "`constructor` value is String"); >+ >+regexp.constructor = Symbol(); >+assert.throws(TypeError, callMatchAll, "`constructor` value is Symbol"); >+ >+regexp.constructor = 1; >+assert.throws(TypeError, callMatchAll, "`constructor` value is Number"); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js >new file mode 100644 >index 0000000000000000000000000000000000000000..792bb1e7f8c35dd810b3fb8417197821497d8da7 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-is-undefined.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Throws TypeError if `constructor` property is not an object >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ a. Let C be ? SpeciesConstructor(R, RegExp). >+ >+ SpeciesConstructor ( O, defaultConstructor ) >+ [...] >+ 2. Let C be ? Get(O, "constructor"). >+ 3. If C is undefined, return defaultConstructor. >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var regexp = /\w/g; >+regexp.constructor = undefined; >+var str = 'a*b'; >+ >+assert.compareIterator(regexp[Symbol.matchAll](str), [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+]); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b47402d7d69bd26fc2bd5be1fe1f497ee4c1818a >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-not-constructor.js >@@ -0,0 +1,45 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: TypeError is thrown when species constructor is not a constructor >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 2. Return ? [MatchAllIterator](#matchalliterator)(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 3. Let C be ? [SpeciesConstructor][species-constructor](R, RegExp). >+ >+ SpeciesConstructor ( O, defaultConstructor ) >+ [...] >+ 2. Let C be ? Get(O, "constructor"). >+ 3. If C is undefined, return defaultConstructor. >+ 4. If Type(C) is not Object, throw a TypeError exception. >+ 5. Let S be ? Get(C, @@species). >+ 6. If S is either undefined or null, return defaultConstructor. >+ 7. If IsConstructor(S) is true, return S. >+ 8. Throw a TypeError exception. >+features: [Symbol.matchAll, Symbol.species] >+---*/ >+ >+var regexp = /./; >+var speciesConstructor = {}; >+regexp.constructor = speciesConstructor; >+ >+var callMatchAll = function() { >+ regexp[Symbol.matchAll](''); >+} >+ >+speciesConstructor[Symbol.species] = true; >+assert.throws(TypeError, callMatchAll, "`constructor[Symbol.species]` value is Boolean"); >+ >+speciesConstructor[Symbol.species] = 1; >+assert.throws(TypeError, callMatchAll, "`constructor[Symbol.species]` value is Number"); >+ >+speciesConstructor[Symbol.species] = Symbol(); >+assert.throws(TypeError, callMatchAll, "`constructor[Symbol.species]` value is Symbol"); >+ >+speciesConstructor[Symbol.species] = true; >+assert.throws(TypeError, callMatchAll, "`constructor[Symbol.species]` value is Boolean"); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js >new file mode 100644 >index 0000000000000000000000000000000000000000..564d8bb58b955a3c48132e76b681cfd85a8898ef >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-is-null-or-undefined.js >@@ -0,0 +1,41 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ Default constructor is used when species constructor is null or undefined >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 2. Return ? [MatchAllIterator](#matchalliterator)(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 3. Let C be ? [SpeciesConstructor][species-constructor](R, RegExp). >+ >+ SpeciesConstructor ( O, defaultConstructor ) >+ [...] >+ 2. Let C be ? Get(O, "constructor"). >+ 3. If C is undefined, return defaultConstructor. >+ 4. If Type(C) is not Object, throw a TypeError exception. >+ 5. Let S be ? Get(C, @@species). >+ 6. If S is either undefined or null, return defaultConstructor. >+features: [Symbol.matchAll, Symbol.species] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+function TestWithConstructor(ctor) { >+ var regexp = /\w/g; >+ regexp.constructor = { >+ [Symbol.species]: ctor >+ }; >+ var str = 'a*b'; >+ >+ assert.compareIterator(regexp[Symbol.matchAll](str), [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+ ]); >+} >+ >+TestWithConstructor(undefined); >+TestWithConstructor(null); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..70a6683f4886ce3d68a85e426e79d6ea078a3853 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor-species-throws.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors when calling constructor's @@species >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ a. Let C be ? SpeciesConstructor(R, RegExp). >+ b. Let flags be ? ToString(? Get(R, "flags")) >+ c. Let matcher be ? Construct(C, R, flags). >+features: [Symbol.matchAll, Symbol.species] >+---*/ >+ >+var regexp = /./; >+regexp.constructor = { >+ [Symbol.species]: function() { >+ throw new Test262Error(); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js >new file mode 100644 >index 0000000000000000000000000000000000000000..cb9e9bf03c251719dc0a0e47741de0f633267682 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-constructor.js >@@ -0,0 +1,42 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Custom species constructor is called when creating internal RegExp >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ a. Let C be ? SpeciesConstructor(R, RegExp). >+ b. Let flags be ? ToString(? Get(R, "flags")) >+ c. Let matcher be ? Construct(C, R, flags). >+features: [Symbol.matchAll, Symbol.species] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var callCount = 0; >+var callArgs; >+var regexp = /\d/u; >+regexp.constructor = { >+ [Symbol.species]: function(){ >+ callCount++; >+ callArgs = arguments; >+ return /\w/g; >+ } >+}; >+var str = 'a*b'; >+var iter = regexp[Symbol.matchAll](str); >+ >+assert.sameValue(callCount, 1); >+assert.sameValue(callArgs.length, 2); >+assert.sameValue(callArgs[0], regexp); >+assert.sameValue(callArgs[1], 'u'); >+ >+assert.compareIterator(iter, [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+]); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..46304cc84a0178bc9334c0869419b7b343a1f7d7 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-global-throws.js >@@ -0,0 +1,34 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ Re-throws errors thrown while accessing species constructed RegExp's >+ global property >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ d. Let global be ? ToBoolean(? Get(matcher, "global")). >+features: [Symbol.matchAll, Symbol.species] >+---*/ >+ >+var regexp = /./; >+regexp.constructor = { >+ [Symbol.species]: function() { >+ return Object.defineProperty(/./, 'global', { >+ get() { >+ throw new Test262Error(); >+ } >+ }); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..931b028995607a4e3c2d6937c858400f6be1aa79 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/species-regexp-get-unicode-throws.js >@@ -0,0 +1,34 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ Re-throws errors thrown while accessing species constructed RegExp's >+ unicode property >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ e. Let fullUnicode be ? ToBoolean(? Get(matcher, "unicode")). >+features: [Symbol.matchAll, Symbol.species] >+---*/ >+ >+var regexp = /./; >+regexp.constructor = { >+ [Symbol.species]: function() { >+ return Object.defineProperty(/./, 'unicode', { >+ get() { >+ throw new Test262Error(); >+ } >+ }); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..672ba5792c9e74df78de091718de6026614b0d0c >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring-throws.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: String coercion of string parameter >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ 1. Let S be ? ToString(O). >+features: [Symbol.matchAll] >+---*/ >+ >+var obj = { >+ valueOf() { >+ $ERROR('This method should not be invoked.'); >+ }, >+ toString() { >+ throw new Test262Error('toString invoked'); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ /toString value/[Symbol.matchAll](obj); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js >new file mode 100644 >index 0000000000000000000000000000000000000000..bafeb125b65abebc6df5c921f028d86b0354b1c7 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/string-tostring.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: String coercion of `string` argument >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ 1. Let S be ? ToString(O). >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var str = 'a*b'; >+var obj = { >+ toString() { >+ return str; >+ } >+}; >+var regexp = /\w/g; >+ >+assert.compareIterator(regexp[Symbol.matchAll](obj), [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+]); >+ >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0f21590b74d72f5fc56c7d8aadc79a3c81c027ac >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags-throws.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown while accessing RegExp's flags property >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ b. Let flags be ? ToString(? Get(R, "flags")) >+features: [Symbol.matchAll] >+---*/ >+ >+var regexp = /./; >+Object.defineProperty(regexp, 'flags', { >+ get() { >+ throw new Test262Error(); >+ } >+}); >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js >new file mode 100644 >index 0000000000000000000000000000000000000000..eca4ffa4d4be71e0a23bec3b17fe1b01671be4e3 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-get-flags.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Regexp's flags >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ b. Let flags be ? ToString(? Get(R, "flags")) >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var regexp = /\w/; >+Object.defineProperty(regexp, 'flags', { >+ value: 'g' >+}); >+var str = 'a*b'; >+ >+assert.compareIterator(regexp[Symbol.matchAll](str), [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+]); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ebefdb4e388938956c47b57cb0786003015f6686 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-lastindex-cached.js >@@ -0,0 +1,36 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Verify regexp's lastIndex is cached >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ f. Let lastIndex be ? ToLength(? Get(R, "lastIndex")). >+ g. Perform ? Set(matcher, "lastIndex", lastIndex, true). >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var regexp = /./g; >+regexp.lastIndex = { >+ valueOf() { >+ return 2; >+ } >+}; >+var str = 'abcd'; >+var iter = regexp[Symbol.matchAll](str); >+ >+// Verify lastIndex is cached at the time of calling @@matchAll >+regexp.lastIndex = 0; >+ >+assert.compareIterator(iter, [ >+ matchValidator(['c'], 2, str), >+ matchValidator(['d'], 3, str) >+]); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b8f350d05f67475e0f06b217907326b8a062ec46 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-not-object-throws.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Throws TypeError when `this` is not an Object >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ 1. Let R be the this value. >+ 2. If Type(R) is not Object, throw a TypeError exception. >+features: [Symbol.matchAll] >+---*/ >+ >+var thisValue; >+var callMatchAll = function() { >+ RegExp.prototype[Symbol.matchAll].call(thisValue, ''); >+}; >+ >+thisValue = null; >+assert.throws(TypeError, callMatchAll, 'this value is null'); >+ >+thisValue = true; >+assert.throws(TypeError, callMatchAll, 'this value is Boolean'); >+ >+thisValue = ''; >+assert.throws(TypeError, callMatchAll, 'this value is String'); >+ >+thisValue = Symbol(); >+assert.throws(TypeError, callMatchAll, 'this value is Symbol'); >+ >+thisValue = 1; >+assert.throws(TypeError, callMatchAll, 'this value is Number'); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..fcaefdaf415f664456739b97862df0653fc91bb8 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tolength-lastindex-throws.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors while coercing RegExp's lastIndex >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ f. Let lastIndex be ? ToLength(? Get(R, "lastIndex")). >+features: [Symbol.matchAll] >+---*/ >+ >+var regexp = /./; >+regexp.lastIndex = { >+ valueOf() { >+ throw new Test262Error(); >+ } >+}; >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..206cc65d1008d3042742889d1674ad40486052f9 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags-throws.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors while coercing RegExp's flags to a string >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ b. Let flags be ? ToString(? Get(R, "flags")) >+features: [Symbol.matchAll] >+---*/ >+ >+var regexp = /\w/; >+Object.defineProperty(regexp, 'flags', { >+ value: { >+ valueOf() { >+ ERROR('valueOf Should not be called'); >+ }, >+ toString() { >+ throw new Test262Error(); >+ } >+ } >+}); >+ >+assert.throws(Test262Error, function() { >+ regexp[Symbol.matchAll](''); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js >new file mode 100644 >index 0000000000000000000000000000000000000000..5c7f9cb81593046f7957acf935974dd1f9dcfe29 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExp/prototype/Symbol.matchAll/this-tostring-flags.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Corercing regexp's flags >+info: | >+ RegExp.prototype [ @@matchAll ] ( string ) >+ [...] >+ 3. Return ? MatchAllIterator(R, string). >+ >+ MatchAllIterator ( R, O ) >+ [...] >+ 2. If ? IsRegExp(R) is true, then >+ [...] >+ b. Let flags be ? ToString(? Get(R, "flags")) >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var regexp = /\w/; >+Object.defineProperty(regexp, 'flags', { >+ value: { >+ toString() { >+ return 'g'; >+ } >+ } >+}); >+var str = 'a*b'; >+ >+assert.compareIterator(regexp[Symbol.matchAll](str), [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+]); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a412432545788b5aa54177ceed2667d51b5249e9 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/Symbol.toStringTag.js >@@ -0,0 +1,23 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ `Symbol.toStringTag` property descriptor >+info: | >+ The initial value of the @@toStringTag property is the string value "String >+ Iterator". >+ >+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: >+ false, [[Configurable]]: true }. >+features: [Symbol.matchAll, Symbol.toStringTag] >+includes: [propertyHelper.js] >+---*/ >+ >+var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('')); >+ >+assert.sameValue(RegExpStringIteratorProto[Symbol.toStringTag], 'RegExp String Iterator'); >+ >+verifyNotEnumerable(RegExpStringIteratorProto, Symbol.toStringTag); >+verifyNotWritable(RegExpStringIteratorProto, Symbol.toStringTag); >+verifyConfigurable(RegExpStringIteratorProto, Symbol.toStringTag); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/ancestry.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/ancestry.js >new file mode 100644 >index 0000000000000000000000000000000000000000..f7a6e7b6cbc1d7825a722611b0e0ed97a01e9135 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/ancestry.js >@@ -0,0 +1,16 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ The [[Prototype]] internal slot ofthe %RegExpStringIteratorPrototype% is the >+ %IteratorPrototype% intrinsic object (25.1.2). >+features: [Symbol.iterator, Symbol.matchAll] >+---*/ >+ >+var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('a')); >+var ArrayIteratorProto = Object.getPrototypeOf( >+ Object.getPrototypeOf([][Symbol.iterator]()) >+); >+ >+assert.sameValue(Object.getPrototypeOf(RegExpStringIteratorProto), ArrayIteratorProto); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..74df2c83d10e3ea150c816e18e8e5ee693cef664 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-call-throws.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors when calling exec >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ >+ Runtime Semantics: RegExpExec ( R, S ) >+ 1. Assert: Type(R) is Object. >+ 2. Assert: Type(S) is String. >+ 3. Let exec be ? Get(R, "exec"). >+ 4. If IsCallable(exec) is true, then >+ a. Let result be ? Call(exec, R, « S »). >+features: [Symbol.matchAll] >+---*/ >+ >+var iter = /./[Symbol.matchAll](''); >+ >+RegExp.prototype.exec = function() { >+ throw new Test262Error(); >+}; >+ >+assert.throws(Test262Error, function() { >+ iter.next(); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..808b142a219b9df447b773836dfbaa2e379aaf51 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown while accessing RegExp's exec property >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ >+ Runtime Semantics: RegExpExec ( R, S ) >+ 1. Assert: Type(R) is Object. >+ 2. Assert: Type(S) is String. >+ 3. Let exec be ? Get(R, "exec"). >+features: [Symbol.matchAll] >+---*/ >+ >+var iter = /./[Symbol.matchAll](''); >+ >+Object.defineProperty(RegExp.prototype, 'exec', { >+ get() { >+ throw new Test262Error(); >+ } >+}); >+ >+assert.throws(Test262Error, function() { >+ iter.next(); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7dc986da924940c7bf6ae29f9410b9a5d711709b >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-throws.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown while accessing the first match >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ 10. If match is null, then >+ [...] >+ 11. Else, >+ a. If global is true, >+ i. Let matchStr be ? ToString(? Get(match, "0")). >+features: [Symbol.matchAll] >+---*/ >+ >+var iter = /./g[Symbol.matchAll](''); >+ >+RegExp.prototype.exec = function() { >+ return { >+ get '0'() { >+ throw new Test262Error(); >+ } >+ }; >+}; >+ >+assert.throws(Test262Error, function() { >+ iter.next(); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e84b3c4fc03c708dab961a5ba88dac5f65ed03c0 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring-throws.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown from coercing first match to a string >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ 10. If match is null, then >+ [...] >+ 11. Else, >+ a. If global is true, >+ i. Let matchStr be ? ToString(? Get(match, "0")). >+features: [Symbol.matchAll] >+---*/ >+ >+var iter = /./g[Symbol.matchAll](''); >+ >+RegExp.prototype.exec = function() { >+ return [{ >+ toString: function() { >+ throw new Test262Error(); >+ } >+ }]; >+}; >+ >+assert.throws(Test262Error, function() { >+ iter.next(); >+}); >+ >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js >new file mode 100644 >index 0000000000000000000000000000000000000000..33ac742ca2d5d9127ae58a261a5c219e952d1034 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-match-get-0-tostring.js >@@ -0,0 +1,48 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Behavior when first match is coerced to a empty string >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ 10. If match is null, then >+ [...] >+ 11. Else, >+ a. If global is true, >+ i. Let matchStr be ? ToString(? Get(match, "0")). >+ ii. If matchStr is the empty string, >+ 1. Let thisIndex be ? ToLength(? Get(R, "lastIndex"). >+ 2. Let nextIndex be ! AdvanceStringIndex(S, thisIndex, fullUnicode). >+ 3. Perform ? Set(R, "lastIndex", nextIndex, true). >+ iii. Return ! CreateIterResultObject(match, false). >+features: [Symbol.matchAll] >+---*/ >+ >+var iter = /./g[Symbol.matchAll](''); >+ >+var execResult = { >+ get '0'() { >+ return { >+ toString() { return ''; } >+ }; >+ } >+}; >+ >+var internalRegExp; >+RegExp.prototype.exec = function () { >+ internalRegExp = this; >+ return execResult; >+}; >+ >+var result = iter.next(); >+assert.sameValue(internalRegExp.lastIndex, 1); >+assert.sameValue(result.value, execResult); >+assert(!result.done); >+ >+ >+result = iter.next(); >+assert.sameValue(internalRegExp.lastIndex, 2); >+assert.sameValue(result.value, execResult); >+assert(!result.done); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d659cd28d44609f01df1cd7a48863f286735d190 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-not-callable.js >@@ -0,0 +1,40 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Behavior with a custom RegExp exec >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ >+ Runtime Semantics: RegExpExec ( R, S ) >+ 1. Assert: Type(R) is Object. >+ 2. Assert: Type(S) is String. >+ 3. Let exec be ? Get(R, "exec"). >+ 4. If IsCallable(exec) is true, then >+ [...] >+ 5. If R does not have a [[RegExpMatcher]] internal slot, throw a >+ TypeError exception. >+ 6. Return ? RegExpBuiltinExec(R, S). >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+function TestWithRegExpExec(exec) { >+ RegExp.prototype.exec = exec; >+ >+ var regexp = /\w/g; >+ var str = 'a*b'; >+ >+ assert.compareIterator(regexp[Symbol.matchAll](str), [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+ ]); >+} >+ >+TestWithRegExpExec(undefined); >+TestWithRegExpExec(null); >+TestWithRegExpExec(5); >+TestWithRegExpExec(true); >+TestWithRegExpExec(Symbol()); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js >new file mode 100644 >index 0000000000000000000000000000000000000000..850a7a18c0ec18f754b6b59411b2af01e257c4a0 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec.js >@@ -0,0 +1,55 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Behavior with a custom RegExp exec >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ >+ Runtime Semantics: RegExpExec ( R, S ) >+ 1. Assert: Type(R) is Object. >+ 2. Assert: Type(S) is String. >+ 3. Let exec be ? Get(R, "exec"). >+ 4. If IsCallable(exec) is true, then >+ a. Let result be ? Call(exec, R, « S »). >+ b. If Type(result) is neither Object or Null, throw a TypeError exception. >+ c. Return result. >+features: [Symbol.matchAll] >+---*/ >+ >+var regexp = /./g; >+var str = 'abc'; >+var iter = regexp[Symbol.matchAll](str); >+ >+var callArgs, callCount; >+function callNextWithExecReturnValue(returnValue) { >+ callArgs = undefined; >+ callCount = 0; >+ >+ RegExp.prototype.exec = function() { >+ callArgs = arguments; >+ callCount++; >+ return returnValue; >+ } >+ >+ return iter.next(); >+} >+ >+var firstExecReturnValue = ['ab']; >+var result = callNextWithExecReturnValue(firstExecReturnValue); >+assert.sameValue(result.value, firstExecReturnValue); >+assert(!result.done); >+ >+assert.sameValue(callArgs.length, 1); >+assert.sameValue(callArgs[0], str); >+assert.sameValue(callCount, 1); >+ >+result = callNextWithExecReturnValue(null); >+assert.sameValue(result.value, undefined); >+assert(result.done); >+ >+assert.sameValue(callArgs.length, 1); >+assert.sameValue(callArgs[0], str); >+assert.sameValue(callCount, 1); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/length.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/length.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b9ae0f009984ce3115c9878460920a5a72151638 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/length.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ %RegExpStringIteratorPrototype%.next `length` property >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every built-in function object, including constructors, has a length >+ property whose value is an integer. Unless otherwise specified, this >+ value is equal to the largest number of named arguments shown in the >+ subclause headings for the function description. Optional parameters >+ (which are indicated with brackets: [ ]) or rest parameters (which >+ are shown using the form «...name») are not included in the default >+ argument count. >+ >+ Unless otherwise specified, the length property of a built-in function >+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false, >+ [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Symbol.matchAll] >+---*/ >+ >+var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('')); >+ >+assert.sameValue(RegExpStringIteratorProto.next.length, 0); >+ >+verifyNotEnumerable(RegExpStringIteratorProto.next, 'length'); >+verifyNotWritable(RegExpStringIteratorProto.next, 'length'); >+verifyConfigurable(RegExpStringIteratorProto.next, 'length'); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/name.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/name.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d9f275fbfeac82223180efb797ec7e6d9b1485ba >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/name.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ %RegExpStringIteratorPrototype%.next `name` property >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every built-in function object, including constructors, that is not >+ identified as an anonymous function has a name property whose value >+ is a String. >+ >+ [...] >+ >+ Unless otherwise specified, the name property of a built-in function >+ object, if it exists, has the attributes { [[Writable]]: false, >+ [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Symbol.matchAll] >+---*/ >+ >+var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('')); >+ >+assert.sameValue(RegExpStringIteratorProto.next.name, 'next'); >+ >+verifyNotEnumerable(RegExpStringIteratorProto.next, 'name'); >+verifyNotWritable(RegExpStringIteratorProto.next, 'name'); >+verifyConfigurable(RegExpStringIteratorProto.next, 'name'); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d1b6726e585087f2676fc63d5a9c37c4b4a40f05 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration-global.js >@@ -0,0 +1,40 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Iterates over each match >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 4. If O.[[Done]] is true, then >+ a. Return ! reateIterResultObject(undefined, true). >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ 10. If match is null, then >+ a. Set O.[[Done]] to true. >+ b. Return ! CreateIterResultObject(undefined, true). >+ 11. Else, >+ a. If global is true, >+ i. Let matchStr be ? ToString(? Get(match, "0")). >+ ii. If matchStr is the empty string, >+ 1. Let thisIndex be ? ToLength(? Get(R, "lastIndex"). >+ 2. Let nextIndex be ! AdvanceStringIndex(S, thisIndex, fullUnicode). >+ 3. Perform ? Set(R, "lastIndex", nextIndex, true). >+ iii. Return ! CreateIterResultObject(match, false). >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var regexp = /\w/g; >+var str = 'a*b'; >+var iter = regexp[Symbol.matchAll](str); >+ >+assert.compareIterator(iter, [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+]); >+ >+// Verifies %RegExpStringIteratorPrototype%.next() step 4 >+var result = iter.next(); >+assert.sameValue(result.value, undefined); >+assert(result.done); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a6de2ad8a91a6aa5908adbcfe0c058e1f3aee41f >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-iteration.js >@@ -0,0 +1,37 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Iterates over the first match >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 4. If O.[[Done]] is true, then >+ a. Return ! reateIterResultObject(undefined, true). >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ 10. If match is null, then >+ a. Set O.[[Done]] to true. >+ b. Return ! CreateIterResultObject(undefined, true). >+ 11. Else, >+ a. If global is true, >+ [...] >+ b. Else, >+ i. Set O.[[Done]] to true. >+ ii. Return ! CreateIterResultObject(match, false). >+features: [Symbol.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var regexp = /\w/; >+var str = '*a*b'; >+var iter = regexp[Symbol.matchAll](str); >+ >+assert.compareIterator(iter, [ >+ matchValidator(['a'], 1, str) >+]); >+ >+// Verifies %RegExpStringIteratorPrototype%.next() step 4 >+var result = iter.next(); >+assert.sameValue(result.value, undefined); >+assert(result.done); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js >new file mode 100644 >index 0000000000000000000000000000000000000000..826b2ae3c5d6126a16fb535d3cc8a69ce2ea3f72 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js >@@ -0,0 +1,21 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Throws TypeError when `this` does not have all internal slots >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ 1. Let O be the this value. >+ 2. If Type(O) is not Object, throw a TypeError exception. >+ 3. If O does not have all of the internal slots of a RegExp String Iterator >+ Object Instance (see PropertiesOfRegExpStringIteratorInstances), throw a >+ TypeError. >+features: [Symbol.matchAll] >+---*/ >+ >+var iterator = /./[Symbol.matchAll](''); >+var object = Object.create(iterator); >+ >+assert.throws(TypeError, function() { >+ object.next(); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a679e0ae4ccd39d85b68e5cb0f0a08841e018395 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/prop-desc.js >@@ -0,0 +1,25 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ %RegExpStringIteratorPrototype%.next property descriptor >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every other data property described in clauses 18 through 26 and in Annex >+ B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, >+ [[Configurable]]: true } unless otherwise specified. >+includes: [propertyHelper.js] >+features: [Symbol.matchAll] >+---*/ >+ >+var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('')); >+ >+assert.sameValue(typeof RegExpStringIteratorProto.next, 'function'); >+ >+verifyNotEnumerable(RegExpStringIteratorProto, 'next'); >+verifyWritable(RegExpStringIteratorProto, 'next'); >+verifyConfigurable(RegExpStringIteratorProto, 'next'); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..603393df67dd43a309251dda86309dbc5f0f1e1c >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/regexp-tolength-lastindex-throws.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown coercing RegExp's lastIndex to a length >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ [...] >+ 9. Let match be ? RegExpExec(R, S). >+ 10. If match is null, then >+ [...] >+ 11. Else, >+ a. If global is true, >+ i. Let matchStr be ? ToString(? Get(match, "0")). >+ ii. If matchStr is the empty string, >+ 1. Let thisIndex be ? ToLength(? Get(R, "lastIndex"). >+features: [Symbol.matchAll] >+---*/ >+ >+var iter = /./g[Symbol.matchAll](''); >+ >+RegExp.prototype.exec = function() { >+ this.lastIndex = { >+ valueOf() { >+ throw new Test262Error(); >+ } >+ }; >+ return ['']; >+}; >+ >+assert.throws(Test262Error, function() { >+ iter.next(); >+}); >diff --git a/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..4470ff19e8d9074e568bad53c0c3815e7fc73b42 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/RegExpStringIteratorPrototype/next/this-is-not-object-throws.js >@@ -0,0 +1,34 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Throws TypeError when `this` is not an Object >+info: | >+ %RegExpStringIteratorPrototype%.next ( ) >+ 1. Let O be the this value. >+ 2. If Type(O) is not Object, throw a TypeError exception. >+features: [Symbol.matchAll] >+---*/ >+ >+var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('')); >+ >+var thisValue; >+var callNext = function() { >+ RegExpStringIteratorProto.next.call(thisValue); >+}; >+ >+thisValue = null; >+assert.throws(TypeError, callNext, 'this value is null'); >+ >+thisValue = true; >+assert.throws(TypeError, callNext, 'this value is Boolean'); >+ >+thisValue = ''; >+assert.throws(TypeError, callNext, 'this value is String'); >+ >+thisValue = Symbol(); >+assert.throws(TypeError, callNext, 'this value is Symbol'); >+ >+thisValue = 1; >+assert.throws(TypeError, callNext, 'this value is Number'); >+ >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/length.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/length.js >new file mode 100644 >index 0000000000000000000000000000000000000000..101d8bbf2ed8b3551adbdb72d1f8388272b73088 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/length.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: String.prototype.matchAll `length` property >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every built-in function object, including constructors, has a length >+ property whose value is an integer. Unless otherwise specified, this >+ value is equal to the largest number of named arguments shown in the >+ subclause headings for the function description. Optional parameters >+ (which are indicated with brackets: [ ]) or rest parameters (which >+ are shown using the form «...name») are not included in the default >+ argument count. >+ >+ Unless otherwise specified, the length property of a built-in function >+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false, >+ [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [String.prototype.matchAll] >+---*/ >+ >+assert.sameValue(String.prototype.matchAll.length, 1); >+ >+verifyNotEnumerable(String.prototype.matchAll, 'length'); >+verifyNotWritable(String.prototype.matchAll, 'length'); >+verifyConfigurable(String.prototype.matchAll, 'length'); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/name.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/name.js >new file mode 100644 >index 0000000000000000000000000000000000000000..cef87994c1253c818004c88aa482135aee2c00fa >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/name.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: String.prototype.matchAll `name` property >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every built-in function object, including constructors, that is not >+ identified as an anonymous function has a name property whose value >+ is a String. >+ >+ [...] >+ >+ Unless otherwise specified, the name property of a built-in function >+ object, if it exists, has the attributes { [[Writable]]: false, >+ [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [String.prototype.matchAll] >+---*/ >+ >+assert.sameValue(String.prototype.matchAll.name, 'matchAll'); >+ >+verifyNotEnumerable(String.prototype.matchAll, 'name'); >+verifyNotWritable(String.prototype.matchAll, 'name'); >+verifyConfigurable(String.prototype.matchAll, 'name'); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/prop-desc.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..eb1c59a60dcb9f61a98433dd3484df277a22690e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/prop-desc.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: String.prototype.matchAll property descriptor >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ [...] >+ >+ Every other data property described in clauses 18 through 26 and in Annex >+ B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, >+ [[Configurable]]: true } unless otherwise specified. >+includes: [propertyHelper.js] >+features: [String.prototype.matchAll] >+---*/ >+ >+assert.sameValue(typeof String.prototype.matchAll, 'function'); >+ >+verifyNotEnumerable(String.prototype, 'matchAll'); >+verifyWritable(String.prototype, 'matchAll'); >+verifyConfigurable(String.prototype, 'matchAll'); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8c73480b05b8855e911a2877833af0db55a51eef >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js >@@ -0,0 +1,25 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors when calling @@matchAll >+info: | >+ String.prototype.matchAll ( regexp ) >+ [...] >+ 2. If regexp is neither undefined nor null, then >+ a. Let matcher be ? GetMethod(regexp, @@matchAll). >+ b. If matcher is not undefined, then >+ i. Return ? Call(matcher, regexp, « O »). >+features: [Symbol.matchAll, String.prototype.matchAll] >+---*/ >+ >+var regexp = /./; >+Object.defineProperty(regexp, Symbol.matchAll, { >+ get() { >+ throw new Test262Error(); >+ } >+}); >+ >+assert.throws(Test262Error, function() { >+ ''.matchAll(regexp); >+}); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-is-null.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-is-null.js >new file mode 100644 >index 0000000000000000000000000000000000000000..9ae102e6b1646645ab61cc1272559f1de3cb50aa >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-is-null.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Behavior when regexp is null >+info: | >+ String.prototype.matchAll ( regexp ) >+ 1. Let O be ? RequireObjectCoercible(this value). >+ 2. If regexp is neither undefined nor null, then >+ [...] >+ 3. Return ? MatchAllIterator(regexp, O). >+ >+ MatchAllIterator( regexp, O ) >+ [...] >+ 2. If ? IsRegExp(regexp) is true, then >+ [...] >+ 3. Else, >+ a. Let R be RegExpCreate(regexp, "g"). >+features: [String.prototype.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var str = '-null-'; >+ >+assert.compareIterator(str.matchAll(null), [ >+ matchValidator(['null'], 1, str) >+]); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-is-undefined.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-is-undefined.js >new file mode 100644 >index 0000000000000000000000000000000000000000..bf9ac09e00437bf9101d836f991cac4593de4396 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-is-undefined.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Behavior when regexp is null >+info: | >+ String.prototype.matchAll ( regexp ) >+ 1. Let O be ? RequireObjectCoercible(this value). >+ 2. If regexp is neither undefined nor null, then >+ [...] >+ 3. Return ? MatchAllIterator(regexp, O). >+ >+ MatchAllIterator( regexp, O ) >+ [...] >+ 2. If ? IsRegExp(regexp) is true, then >+ [...] >+ 3. Else, >+ a. Let R be RegExpCreate(regexp, "g"). >+features: [String.prototype.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+var str = 'a'; >+ >+assert.compareIterator(str.matchAll(undefined), [ >+ matchValidator([''], 0, str), >+ matchValidator([''], 1, str) >+]); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7afe2c796575deca7fec7811ca54eb0d32183294 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-invocation.js >@@ -0,0 +1,35 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Invocation of @@matchAll property of user-supplied RegExp objects >+info: | >+ String.prototype.matchAll ( regexp ) >+ [...] >+ 2. If regexp is neither undefined nor null, then >+ a. Let matcher be ? GetMethod(regexp, @@matchAll). >+ b. If matcher is not undefined, then >+ i. Return ? Call(matcher, regexp, « O »). >+features: [Symbol.matchAll, String.prototype.matchAll] >+---*/ >+ >+var obj = {}; >+var returnVal = {}; >+var callCount = 0; >+var thisVal, args; >+ >+obj[Symbol.matchAll] = function () { >+ callCount++; >+ thisVal = this; >+ args = arguments; >+ return returnVal; >+}; >+ >+var str = ''; >+ >+assert.sameValue(str.matchAll(obj), returnVal); >+assert.sameValue(callCount, 1, 'Invokes the method exactly once'); >+assert.sameValue(thisVal, obj); >+assert.notSameValue(args, undefined); >+assert.sameValue(args.length, 1); >+assert.sameValue(args[0], str); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c94ddd095fe1ec4cdc8f19258621558cdabb888f >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-matchAll-throws.js >@@ -0,0 +1,21 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors when calling @@matchAll >+info: | >+ String.prototype.matchAll ( regexp ) >+ [...] >+ 2. If regexp is neither undefined nor null, then >+ a. Let matcher be ? GetMethod(regexp, @@matchAll). >+features: [Symbol.matchAll, String.prototype.matchAll] >+---*/ >+ >+var regexp = /./; >+regexp[Symbol.matchAll] = function() { >+ throw new Test262Error(); >+}; >+ >+assert.throws(Test262Error, function() { >+ ''.matchAll(regexp); >+}); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ccafad46a5275d7d4dc42404db54ed6003ff960e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-get-matchAll-throws.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors thrown while accessing RegExp's @@matchAll property >+info: | >+ String.prototype.matchAll ( regexp ) >+ [...] >+ 2. If regexp is neither undefined nor null, then >+ a. Let matcher be ? GetMethod(regexp, @@matchAll). >+features: [Symbol.matchAll] >+---*/ >+ >+Object.defineProperty(RegExp.prototype, Symbol.matchAll, { >+ get() { >+ throw new Test262Error(); >+ } >+}); >+ >+assert.throws(Test262Error, function() { >+ ''.matchAll(/./); >+}); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0aeb021a9e3ed074e66852419f79940e53433026 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js >@@ -0,0 +1,24 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Behavior when @@matchAll is removed from RegExp's prototype >+info: | >+ String.prototype.matchAll ( regexp ) >+ 1. Let O be ? RequireObjectCoercible(this value). >+ 2. If regexp is neither undefined nor null, then >+ a. Let matcher be ? GetMethod(regexp, @@matchAll). >+ b. If matcher is not undefined, then >+ [...] >+ 3. Return ? MatchAllIterator(regexp, O). >+features: [Symbol.matchAll, String.prototype.matchAll] >+includes: [compareArray.js, compareIterator.js, regExpUtils.js] >+---*/ >+ >+delete RegExp.prototype[Symbol.matchAll]; >+var str = 'a*b'; >+ >+assert.compareIterator(str.matchAll(/\w/g), [ >+ matchValidator(['a'], 0, str), >+ matchValidator(['b'], 2, str) >+]); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js >new file mode 100644 >index 0000000000000000000000000000000000000000..2aec69141ce0690d0824c651a57ae5fd65f17805 >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-invocation.js >@@ -0,0 +1,36 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Behavior when invoking of @@matchAll >+info: | >+ String.prototype.matchAll ( regexp ) >+ [...] >+ 2. If regexp is neither undefined nor null, then >+ a. Let matcher be ? GetMethod(regexp, @@matchAll). >+ b. If matcher is not undefined, then >+ i. Return ? Call(matcher, regexp, « O »). >+features: [Symbol.matchAll] >+---*/ >+ >+var obj = {}; >+var returnVal = {}; >+var callCount = 0; >+var thisVal, args; >+ >+RegExp.prototype[Symbol.matchAll] = function() { >+ callCount++; >+ thisVal = this; >+ args = arguments; >+ return returnVal; >+}; >+ >+var regexp = /./; >+var str = ''; >+ >+assert.sameValue(str.matchAll(regexp), returnVal); >+assert.sameValue(callCount, 1, 'Invokes the method exactly once'); >+assert.sameValue(thisVal, regexp); >+assert.notSameValue(args, undefined); >+assert.sameValue(args.length, 1); >+assert.sameValue(args[0], str); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c2be2331a3e0fb6253deb655739b27c3739bb38c >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-throws.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Re-throws errors when calling @@matchAll >+info: | >+ String.prototype.matchAll ( regexp ) >+ [...] >+ 2. If regexp is neither undefined nor null, then >+ a. Let matcher be ? GetMethod(regexp, @@matchAll). >+ b. If matcher is not undefined, then >+ i. Return ? Call(matcher, regexp, « O »). >+features: [Symbol.matchAll] >+---*/ >+ >+RegExp.prototype[Symbol.matchAll] = function() { >+ throw new Test262Error(); >+}; >+ >+assert.throws(Test262Error, function() { >+ ''.matchAll(/./); >+}); >diff --git a/JSTests/test262/test/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js b/JSTests/test262/test/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js >new file mode 100644 >index 0000000000000000000000000000000000000000..9cfd7705de6924043380a3ad3dfd51dd5fffe01d >--- /dev/null >+++ b/JSTests/test262/test/built-ins/String/prototype/matchAll/this-val-non-obj-coercible.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 Jordan Harband. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: The `this` value cannot be coerced into an object >+info: | >+ String.prototype.matchAll ( regexp ) >+ 1. Let O be RequireObjectCoercible(this value). >+features: [String.prototype.matchAll] >+---*/ >+ >+var matchAll = String.prototype.matchAll; >+ >+assert.sameValue(typeof matchAll, 'function'); >+ >+assert.throws(TypeError, function() { >+ matchAll.call(undefined); >+}, 'undefined'); >+ >+assert.throws(TypeError, function() { >+ matchAll.call(null); >+}, 'null'); >diff --git a/JSTests/test262/test/built-ins/Symbol/matchAll/cross-realm.js b/JSTests/test262/test/built-ins/Symbol/matchAll/cross-realm.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e6d2f9cebf1a249cd117a1df437c49a4280c067e >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Symbol/matchAll/cross-realm.js >@@ -0,0 +1,14 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: Value shared by all realms >+info: | >+ Unless otherwise specified, well-known symbols values are shared by all >+ realms. >+features: [cross-realm, Symbol.matchAll] >+---*/ >+ >+var OSymbol = $262.createRealm().global.Symbol; >+ >+assert.sameValue(Symbol.matchAll, OSymbol.matchAll); >diff --git a/JSTests/test262/test/built-ins/Symbol/matchAll/prop-desc.js b/JSTests/test262/test/built-ins/Symbol/matchAll/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..705adfc519c06b82e38c5742598b724480b66dbb >--- /dev/null >+++ b/JSTests/test262/test/built-ins/Symbol/matchAll/prop-desc.js >@@ -0,0 +1,17 @@ >+// Copyright (C) 2018 Peter Wong. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: pending >+description: | >+ `Symbol.matchAll` property descriptor >+info: | >+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: >+ false, [[Configurable]]: false }. >+includes: [propertyHelper.js] >+features: [Symbol.match] >+---*/ >+ >+assert.sameValue(typeof Symbol.matchAll, 'symbol'); >+verifyNotEnumerable(Symbol, 'matchAll'); >+verifyNotWritable(Symbol, 'matchAll'); >+verifyNotConfigurable(Symbol, 'matchAll'); >diff --git a/JSTests/test262/test/harness/testTypedArray.js b/JSTests/test262/test/harness/testTypedArray.js >index 9c99a05a1ee086ab799590aeb3e6a480602e5e14..dba6c700108a6670ae4794543c5338ad469ad321 100644 >--- a/JSTests/test262/test/harness/testTypedArray.js >+++ b/JSTests/test262/test/harness/testTypedArray.js >@@ -39,3 +39,22 @@ var callCount = 0; > testWithTypedArrayConstructors(() => callCount++); > assert.sameValue(callCount, length); > >+assert.sameValue(typedArrayConstructors[0], Float64Array); >+assert.sameValue(typedArrayConstructors[1], Float32Array); >+assert.sameValue(typedArrayConstructors[2], Int32Array); >+assert.sameValue(typedArrayConstructors[3], Int16Array); >+assert.sameValue(typedArrayConstructors[4], Int8Array); >+assert.sameValue(typedArrayConstructors[5], Uint32Array); >+assert.sameValue(typedArrayConstructors[6], Uint16Array); >+assert.sameValue(typedArrayConstructors[7], Uint8Array); >+assert.sameValue(typedArrayConstructors[8], Uint8ClampedArray); >+ >+assert.sameValue(typedArrayConstructors[0], TAConstructors[0]); >+assert.sameValue(typedArrayConstructors[1], TAConstructors[1]); >+assert.sameValue(typedArrayConstructors[2], TAConstructors[2]); >+assert.sameValue(typedArrayConstructors[3], TAConstructors[3]); >+assert.sameValue(typedArrayConstructors[4], TAConstructors[4]); >+assert.sameValue(typedArrayConstructors[5], TAConstructors[5]); >+assert.sameValue(typedArrayConstructors[6], TAConstructors[6]); >+assert.sameValue(typedArrayConstructors[7], TAConstructors[7]); >+assert.sameValue(typedArrayConstructors[8], TAConstructors[8]); >diff --git a/JSTests/test262/test/intl402/Array/prototype/toLocaleString/calls-toLocaleString-number-elements.js b/JSTests/test262/test/intl402/Array/prototype/toLocaleString/calls-toLocaleString-number-elements.js >new file mode 100644 >index 0000000000000000000000000000000000000000..62de5101b439705bc067a5a55ad0e8d3fd020764 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Array/prototype/toLocaleString/calls-toLocaleString-number-elements.js >@@ -0,0 +1,17 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sup-array.prototype.tolocalestring >+description: > >+ Ensure "toLocaleString" is called with locale and options on number elements. >+---*/ >+ >+var n = 0; >+ >+var locale = "th-u-nu-thai"; >+var options = { >+ minimumFractionDigits: 3 >+}; >+ >+assert.sameValue([n].toLocaleString(locale, options), n.toLocaleString(locale, options)); >diff --git a/JSTests/test262/test/intl402/Intl/getCanonicalLocales/invalid-tags.js b/JSTests/test262/test/intl402/Intl/getCanonicalLocales/invalid-tags.js >index e218f21f1b632c79340b426289ccf5a8e3ca82ef..b131603a5028da402efb3ca6ade2d560e91a17df 100644 >--- a/JSTests/test262/test/intl402/Intl/getCanonicalLocales/invalid-tags.js >+++ b/JSTests/test262/test/intl402/Intl/getCanonicalLocales/invalid-tags.js >@@ -21,58 +21,7 @@ info: | > includes: [testIntl.js] > ---*/ > >-var invalidLanguageTags = [ >- "", // empty tag >- "i", // singleton alone >- "x", // private use without subtag >- "u", // extension singleton in first place >- "419", // region code in first place >- "u-nu-latn-cu-bob", // extension sequence without language >- "hans-cmn-cn", // "hans" could theoretically be a 4-letter language code, >- // but those can't be followed by extlang codes. >- "cmn-hans-cn-u-u", // duplicate singleton >- "cmn-hans-cn-t-u-ca-u", // duplicate singleton >- "de-gregory-gregory", // duplicate variant >- "*", // language range >- "de-*", // language range >- "䏿", // non-ASCII letters >- "en-Ã", // non-ASCII letters >- "ıd", // non-ASCII letters >- >- // underscores in different parts of the language tag >- "de_DE", >- "DE_de", >- "cmn_Hans", >- "cmn-hans_cn", >- "es_419", >- "es-419-u-nu-latn-cu_bob", >- "i_klingon", >- "cmn-hans-cn-t-ca-u-ca-x_t-u", >- "enochian_enochian", >- "de-gregory_u-ca-gregory", >- >- "en\u0000", // null-terminator sequence >- " en", // leading whitespace >- "en ", // trailing whitespace >- "it-IT-Latn", // country before script tag >- "de-u", // incomplete Unicode extension sequences >- "de-u-", >- "de-u-ca-", >- "de-u-ca-gregory-", >- "si-x", // incomplete private-use tags >- "x-", >- "x-y-", >-]; >- >-// make sure the data above is correct >-for (var i = 0; i < invalidLanguageTags.length; ++i) { >- var invalidTag = invalidLanguageTags[i]; >- assert( >- !isCanonicalizedStructurallyValidLanguageTag(invalidTag), >- "Test data \"" + invalidTag + "\" is a canonicalized and structurally valid language tag." >- ); >-} >- >+var invalidLanguageTags = getInvalidLanguageTags(); > for (var i = 0; i < invalidLanguageTags.length; ++i) { > var invalidTag = invalidLanguageTags[i]; > assert.throws(RangeError, function() { >diff --git a/JSTests/test262/test/intl402/Locale/constructor-newtarget-undefined.js b/JSTests/test262/test/intl402/Locale/constructor-newtarget-undefined.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e24be35be472cd26c504a2e7bd9254c2968be208 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-newtarget-undefined.js >@@ -0,0 +1,21 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Verifies the NewTarget check for Intl.Locale. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ 1. If NewTarget is undefined, throw a TypeError exception. >+features: [Intl.Locale] >+---*/ >+ >+assert.throws(TypeError, function() { >+ Intl.Locale(); >+}); >+ >+assert.throws(TypeError, function() { >+ Intl.Locale("en"); >+}); >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-calendar-invalid.js b/JSTests/test262/test/intl402/Locale/constructor-options-calendar-invalid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7722a2ecedcfe4db7e785f2572c82c2a882cec11 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-calendar-invalid.js >@@ -0,0 +1,36 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ ... >+ 15. If calendar is not undefined, then >+ a. If calendar does not match the [(3*8alphanum) *("-" (3*8alphanum))] sequence, throw a RangeError exception. >+ 16. Set opt.[[ca]] to calendar. >+ >+features: [Intl.Locale] >+---*/ >+ >+ >+/* >+ alphanum = (ALPHA / DIGIT) ; letters and numbers >+ calendar = (3*8alphanum) *("-" (3*8alphanum)) >+*/ >+const invalidCalendarOptions = [ >+ "", >+ "a", >+ "ab", >+ "abcdefghi", >+ "abc-abcdefghi", >+]; >+for (const invalidCalendarOption of invalidCalendarOptions) { >+ assert.throws(RangeError, function() { >+ new Intl.Locale("en", {calendar: invalidCalendarOption}); >+ }, `${invalidCalendarOption} is an invalid calendar option value`); >+} >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-calendar-valid.js b/JSTests/test262/test/intl402/Locale/constructor-options-calendar-valid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..fbd4f6d741dc4c75e5b31ca8f5ab3c10bf92f139 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-calendar-valid.js >@@ -0,0 +1,42 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ ... >+ 14. Let calendar be ? GetOption(options, "calendar", "string", undefined, undefined). >+ ... >+ >+features: [Intl.Locale] >+---*/ >+ >+const validCalendarOptions = [ >+ ["abc", "en-u-ca-abc"], >+ ["abcd", "en-u-ca-abcd"], >+ ["abcde", "en-u-ca-abcde"], >+ ["abcdef", "en-u-ca-abcdef"], >+ ["abcdefg", "en-u-ca-abcdefg"], >+ ["abcdefgh", "en-u-ca-abcdefgh"], >+ ["12345678", "en-u-ca-12345678"], >+ ["1234abcd", "en-u-ca-1234abcd"], >+ ["1234abcd-abc123", "en-u-ca-1234abcd-abc123"], >+]; >+for (const [calendar, expected] of validCalendarOptions) { >+ let options = { calendar }; >+ assert.sameValue( >+ new Intl.Locale('en', options).toString(), >+ expected, >+ `new Intl.Locale('en', options).toString() equals the value of ${expected}` >+ ); >+ assert.sameValue( >+ new Intl.Locale('en-u-ca-gregory', options).toString(), >+ expected, >+ `new Intl.Locale('en-u-ca-gregory', options).toString() equals the value of ${expected}` >+ ); >+} >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-language-invalid.js b/JSTests/test262/test/intl402/Locale/constructor-options-language-invalid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6ac5f3e03b94763c9158a09a3f9bc29936e40173 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-language-invalid.js >@@ -0,0 +1,68 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ 10. If options is undefined, then >+ 11. Else >+ a. Let options be ? ToObject(options). >+ 12. Set tag to ? ApplyOptionsToTag(tag, options). >+ >+ ApplyOptionsToTag( tag, options ) >+ ... >+ 4. If language is not undefined, then >+ a. If language does not match the language production, throw a RangeError exception. >+ ... >+ >+features: [Intl.Locale] >+---*/ >+ >+/* >+ language = 2*3ALPHA ; shortest ISO 639 code >+ ["-" extlang] ; sometimes followed by >+ ; extended language subtags >+ / 4ALPHA ; or reserved for future use >+ / 5*8ALPHA ; or registered language subtag >+ >+ extlang = 3ALPHA ; selected ISO 639 codes >+ *2("-" 3ALPHA) ; permanently reserved >+*/ >+const invalidLanguageOptions = [ >+ "", >+ "a", >+ "ab7", >+ "notalanguage", >+ "undefined", >+ >+ // Value contains more than just the 'language' production. >+ "fr-Latn", >+ "fr-FR", >+ "sa-vaidika", >+ "fr-a-asdf", >+ "fr-x-private", >+ >+ // Irregular grandfathered language tag. >+ "i-klingon", >+ >+ // Regular grandfathered language tag. >+ "zh-Hant", >+ >+ // Reserved with extended language subtag >+ "abcd-US", >+ "abcde-US", >+ "abcdef-US", >+ "abcdefg-US", >+ "abcdefgh-US", >+ >+ 7, >+]; >+for (const invalidLanguageOption of invalidLanguageOptions) { >+ assert.throws(RangeError, function() { >+ new Intl.Locale("en", {language: invalidLanguageOption}); >+ }, `${invalidLanguageOption} is an invalid language option value`); >+} >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-language-valid.js b/JSTests/test262/test/intl402/Locale/constructor-options-language-valid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..bf5c764dd5fd5e5201bb67b498cd5642e35e8af3 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-language-valid.js >@@ -0,0 +1,44 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ 10. If options is undefined, then >+ 11. Else >+ a. Let options be ? ToObject(options). >+ 12. Set tag to ? ApplyOptionsToTag(tag, options). >+ >+ ApplyOptionsToTag( tag, options ) >+ ... >+ 9. If tag matches the langtag production, then >+ a. If language is not undefined, then >+ i. Set tag to tag with the substring corresponding to the language production replaced by the string language. >+ >+features: [Intl.Locale] >+---*/ >+ >+const validLanguageOptions = [ >+ [undefined, "en"], >+ [null, "null"], >+ ["zh-cmn", "cmn"], >+ ["ZH-CMN", "cmn"], >+ ["abcd", "abcd"], >+ ["abcde", "abcde"], >+ ["abcdef", "abcdef"], >+ ["abcdefg", "abcdefg"], >+ ["abcdefgh", "abcdefgh"], >+ [{ toString() { return "de" } }, "de"], >+]; >+for (const [language, expected] of validLanguageOptions) { >+ let options = { language }; >+ assert.sameValue( >+ new Intl.Locale('en', options).toString(), >+ expected, >+ `new Intl.Locale('en', options).toString() equals the value of ${expected}` >+ ); >+} >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-region-invalid.js b/JSTests/test262/test/intl402/Locale/constructor-options-region-invalid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6939c225b98c57f500ff9c210ee584021827d005 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-region-invalid.js >@@ -0,0 +1,56 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ 10. If options is undefined, then >+ 11. Else >+ a. Let options be ? ToObject(options). >+ 12. Set tag to ? ApplyOptionsToTag(tag, options). >+ >+ ApplyOptionsToTag( tag, options ) >+ ... >+ 8. If region is not undefined, then >+ a. If region does not match the region production, throw a RangeError exception. >+ ... >+ >+features: [Intl.Locale] >+---*/ >+ >+/* >+ region = 2ALPHA ; ISO 3166-1 code >+ / 3DIGIT ; UN M.49 code >+*/ >+const invalidRegionOptions = [ >+ "", >+ "a", >+ "abc", >+ "a7", >+ >+ // Value cannot be parsed as a 'region' production. >+ "notaregion", >+ >+ // Value contains more than just the 'region' production. >+ "SA-vaidika", >+ "SA-a-asdf", >+ "SA-x-private", >+ >+ // Value contains more than just the 'script' production. >+ "ary-Arab", >+ "Latn-SA", >+ "Latn-vaidika", >+ "Latn-a-asdf", >+ "Latn-x-private", >+ >+ 7, >+]; >+for (const invalidRegionOption of invalidRegionOptions) { >+ assert.throws(RangeError, function() { >+ new Intl.Locale("en", {region: invalidRegionOption}); >+ }, `${invalidRegionOption} is an invalid region option value`); >+} >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-region-valid.js b/JSTests/test262/test/intl402/Locale/constructor-options-region-valid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..00d4762736606f8f095b026c7fcdaec315960900 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-region-valid.js >@@ -0,0 +1,46 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ 10. If options is undefined, then >+ 11. Else >+ a. Let options be ? ToObject(options). >+ 12. Set tag to ? ApplyOptionsToTag(tag, options). >+ >+ ApplyOptionsToTag( tag, options ) >+ ... >+ 7. Let region be ? GetOption(options, "region", "string", undefined, undefined). >+ ... >+ 9. If tag matches the langtag production, then >+ ... >+ c. If region is not undefined, then >+ i. If tag does not contain a region production, then >+ 1. Set tag to the concatenation of the language production of tag, the substring corresponding to the "-" script production if present, "-", region, and the rest of tag. >+ >+features: [Intl.Locale] >+---*/ >+ >+const validRegionOptions = [ >+ ["FR", "en-FR"], >+ ["554", "en-554"], >+ [554, "en-554"], >+]; >+for (const [region, expected] of validRegionOptions) { >+ let options = { region }; >+ assert.sameValue( >+ new Intl.Locale('en', options).toString(), >+ expected, >+ `new Intl.Locale('en', options).toString() equals the value of ${expected}` >+ ); >+ assert.sameValue( >+ new Intl.Locale('en-US', options).toString(), >+ expected, >+ `new Intl.Locale('en-US', options).toString() equals the value of ${expected}` >+ ); >+} >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-script-invalid.js b/JSTests/test262/test/intl402/Locale/constructor-options-script-invalid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a736280d54824caa43a141c8a39b703cd928c5d6 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-script-invalid.js >@@ -0,0 +1,52 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ 10. If options is undefined, then >+ 11. Else >+ a. Let options be ? ToObject(options). >+ 12. Set tag to ? ApplyOptionsToTag(tag, options). >+ >+ ApplyOptionsToTag( tag, options ) >+ ... >+ 6. If script is not undefined, then >+ a. If script does not match the script production, throw a RangeError exception. >+ ... >+ >+features: [Intl.Locale] >+---*/ >+ >+/* >+ script = 4ALPHA ; ISO 15924 code >+*/ >+const invalidScriptOptions = [ >+ "", >+ "a", >+ "ab", >+ "abc", >+ "abc7", >+ "notascript", >+ "undefined", >+ "Bal\u0130", >+ "Bal\u0131", >+ >+ // Value contains more than just the 'script' production. >+ "ary-Arab", >+ "Latn-SA", >+ "Latn-vaidika", >+ "Latn-a-asdf", >+ "Latn-x-private", >+ >+ 7, >+]; >+for (const invalidScriptOption of invalidScriptOptions) { >+ assert.throws(RangeError, function() { >+ new Intl.Locale("en", {script: invalidScriptOption}); >+ }, `${invalidScriptOption} is an invalid script option value`); >+} >diff --git a/JSTests/test262/test/intl402/Locale/constructor-options-script-valid.js b/JSTests/test262/test/intl402/Locale/constructor-options-script-valid.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a9c10a4dd1c074740e7fc7c1e2d1a44f1652b2e0 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/constructor-options-script-valid.js >@@ -0,0 +1,51 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ 10. If options is undefined, then >+ 11. Else >+ a. Let options be ? ToObject(options). >+ 12. Set tag to ? ApplyOptionsToTag(tag, options). >+ >+ ApplyOptionsToTag( tag, options ) >+ ... >+ 5. Let script be ? GetOption(options, "script", "string", undefined, undefined). >+ ... >+ 9. If tag matches the langtag production, then >+ ... >+ b. If script is not undefined, then >+ i. If tag does not contain a script production, then >+ 1. Set tag to the concatenation of the language production of tag, "-", script, and the rest of tag. >+ ii. Else, >+ 1. Set tag to tag with the substring corresponding to the script production replaced by the string script. >+ >+ >+features: [Intl.Locale] >+---*/ >+ >+const validScriptOptions = [ >+ [null, "en-Null"], >+ ["bali", "en-Bali"], >+ ["Bali", "en-Bali"], >+ ["bALI", "en-BALI"], // TODO REVIEW: is this the correct case regularization? >+ [{ toString() { return "Brai" } }, "en-Brai"], >+]; >+for (const [script, expected] of validScriptOptions) { >+ let options = { script }; >+ assert.sameValue( >+ new Intl.Locale("en", options).toString(), >+ expected, >+ `new Intl.Locale("en", options).toString() equals the value of ${expected}` >+ ); >+ assert.sameValue( >+ new Intl.Locale("en-Cyrl", options).toString(), >+ expected, >+ `new Intl.Locale("en-Cyrl", options).toString() equals the value of ${expected}` >+ ); >+} >diff --git a/JSTests/test262/test/intl402/Locale/function-prototype.js b/JSTests/test262/test/intl402/Locale/function-prototype.js >new file mode 100644 >index 0000000000000000000000000000000000000000..044ecfa33d26e7540eb960646a02ecd4584ce820 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/function-prototype.js >@@ -0,0 +1,16 @@ >+// Copyright 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ The value of the [[Prototype]] internal slot of the Intl.Locale constructor is the >+ intrinsic object %FunctionPrototype%. >+features: [Intl.Locale] >+---*/ >+ >+assert.sameValue( >+ Object.getPrototypeOf(Intl.Locale), >+ Function.prototype, >+ "Object.getPrototypeOf(Intl.Locale) equals the value of Function.prototype" >+); >diff --git a/JSTests/test262/test/intl402/Locale/instance-extensibility.js b/JSTests/test262/test/intl402/Locale/instance-extensibility.js >new file mode 100644 >index 0000000000000000000000000000000000000000..41ac73c1feb6ca0d4f8f540d6dfca7e6e81aafb0 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/instance-extensibility.js >@@ -0,0 +1,20 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Intl.Locale instance object extensibility >+info: | >+ 17 ECMAScript Standard Built-in Objects: >+ >+ Unless specified otherwise, the [[Extensible]] internal slot >+ of a built-in object initially has the value true. >+features: [Intl.Locale] >+---*/ >+ >+assert.sameValue( >+ Object.isExtensible(new Intl.Locale('en')), >+ true, >+ "Object.isExtensible(new Intl.Locale('en')) returns true" >+); >diff --git a/JSTests/test262/test/intl402/Locale/instance.js b/JSTests/test262/test/intl402/Locale/instance.js >new file mode 100644 >index 0000000000000000000000000000000000000000..11dc3f225f9726a0f02779a97259504ce8d62efa >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/instance.js >@@ -0,0 +1,22 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Intl.Locale instance object created from %LocalePrototype%. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ 6. Let locale be ? >+ OrdinaryCreateFromConstructor(NewTarget, %LocalePrototype%, >+ internalSlotsList). >+features: [Intl.Locale] >+---*/ >+ >+const value = new Intl.Locale('en'); >+assert.sameValue( >+ Object.getPrototypeOf(value), >+ Intl.Locale.prototype, >+ "Object.getPrototypeOf(value) equals the value of Intl.Locale.prototype" >+); >diff --git a/JSTests/test262/test/intl402/Locale/invalid-tag-throws-boolean.js b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-boolean.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ce6937e2ea60a20ea3e62f23ddd04cb495fd8109 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-boolean.js >@@ -0,0 +1,20 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Verifies the type check on the tag argument to Intl.Locale. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ 7. If Type(tag) is not String or Object, throw a TypeError exception. >+features: [Intl.Locale] >+---*/ >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(true); >+}, "true is an invalid tag value"); >+assert.throws(TypeError, function() { >+ new Intl.Locale(false); >+}, "false is an invalid tag value"); >diff --git a/JSTests/test262/test/intl402/Locale/invalid-tag-throws-null.js b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-null.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6d08c26286aa2c0b003aeb14eaae03ea1c12f2e2 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-null.js >@@ -0,0 +1,17 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Verifies the type check on the tag argument to Intl.Locale. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ 7. If Type(tag) is not String or Object, throw a TypeError exception. >+features: [Intl.Locale] >+---*/ >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(null); >+}, "null is an invalid tag value"); >diff --git a/JSTests/test262/test/intl402/Locale/invalid-tag-throws-number.js b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-number.js >new file mode 100644 >index 0000000000000000000000000000000000000000..805d36c525e4bf8c0199202c8337fcf287032fa7 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-number.js >@@ -0,0 +1,30 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Verifies the type check on the tag argument to Intl.Locale. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ 7. If Type(tag) is not String or Object, throw a TypeError exception. >+features: [Intl.Locale] >+---*/ >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(0); >+}, "0 is an invalid tag value"); >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(1); >+}, "1 is an invalid tag value"); >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(Infinity); >+}, "Infinity is an invalid tag value"); >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(NaN); >+}, "NaN is an invalid tag value"); >+ >diff --git a/JSTests/test262/test/intl402/Locale/invalid-tag-throws-symbol.js b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-symbol.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a56882e47b14b096378e0e97999b0b38cb62234d >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-symbol.js >@@ -0,0 +1,17 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Verifies the type check on the tag argument to Intl.Locale. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ 7. If Type(tag) is not String or Object, throw a TypeError exception. >+features: [Intl.Locale] >+---*/ >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(Symbol()); >+}, "Symbol() is an invalid tag value"); >diff --git a/JSTests/test262/test/intl402/Locale/invalid-tag-throws-undefined.js b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-undefined.js >new file mode 100644 >index 0000000000000000000000000000000000000000..609c20b38439a01077532e19b85ea856474da11a >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/invalid-tag-throws-undefined.js >@@ -0,0 +1,21 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Verifies the type check on the tag argument to Intl.Locale. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ 7. If Type(tag) is not String or Object, throw a TypeError exception. >+features: [Intl.Locale] >+---*/ >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(); >+}, "(empty) is an invalid tag value"); >+ >+assert.throws(TypeError, function() { >+ new Intl.Locale(undefined) >+}, "undefined is an invalid tag value"); >diff --git a/JSTests/test262/test/intl402/Locale/invalid-tag-throws.js b/JSTests/test262/test/intl402/Locale/invalid-tag-throws.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ee6449510f18f41ecef442b5a0d7b74118ec9583 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/invalid-tag-throws.js >@@ -0,0 +1,38 @@ >+// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks error cases for the options argument to the Locale >+ constructor. >+info: | >+ Intl.Locale( tag [, options] ) >+ >+ ... >+ 11. Else >+ a. Let options be ? ToObject(options). >+ 12. Set tag to ? ApplyOptionsToTag(tag, options). >+ ... >+ >+ ApplyOptionsToTag( tag, options ) >+ >+ ... >+ 2. If IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception. >+ ... >+includes: [testIntl.js] >+features: [Intl.Locale] >+---*/ >+ >+// Intl.Locale step 11.a. >+assert.throws(TypeError, function() { new Intl.Locale("en", null) }) >+ >+ >+// ApplyOptionsToTag step 2. >+for (const invalidTag of getInvalidLanguageTags()) { >+ assert.throws(RangeError, function() { >+ new Intl.Locale(invalidTag); >+ }, `${invalidTag} is an invalid tag value`); >+} >+ >+ >diff --git a/JSTests/test262/test/intl402/Locale/length.js b/JSTests/test262/test/intl402/Locale/length.js >new file mode 100644 >index 0000000000000000000000000000000000000000..256eb377b23af0f2d7352c7c1f4138c3647d786e >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/length.js >@@ -0,0 +1,22 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks the "length" property of the Locale constructor. >+info: | >+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. >+ The Locale constructor is a standard built-in property of the Intl object. >+ Every built-in function object, including constructors, has a length property whose value is an integer. Unless otherwise specified, this value is equal to the largest number of named arguments shown in the subclause headings for the function description. Optional parameters (which are indicated with brackets: [ ]) or rest parameters (which are shown using the form «...name») are not included in the default argument count. >+ Unless otherwise specified, the length property of a built-in function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+verifyProperty(Intl.Locale, "length", { >+ value: 1, >+ writable: false, >+ enumerable: false, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/intl402/Locale/name.js b/JSTests/test262/test/intl402/Locale/name.js >new file mode 100644 >index 0000000000000000000000000000000000000000..30689c7b09c9717ad936c3579ec688e2dc0e0ea0 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/name.js >@@ -0,0 +1,21 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ Checks the "name" property of the Locale constructor. >+info: | >+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. >+ Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. >+ Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+verifyProperty(Intl.Locale, "name", { >+ value: "Locale", >+ writable: false, >+ enumerable: false, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/intl402/Locale/prop-desc.js b/JSTests/test262/test/intl402/Locale/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7be47a352c50bda545d8127f69e53cb8d5532da0 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/prop-desc.js >@@ -0,0 +1,26 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale >+description: > >+ The value of the [[Prototype]] internal slot of the Intl.Locale constructor is the >+ intrinsic object %FunctionPrototype%. >+info: | >+ The value of Intl.Locale.prototype is %LocalePrototype%. >+ >+ This property has the attributes >+ { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. >+ >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+assert.sameValue(typeof Intl.Locale, "function", "typeof Intl.Locale is function"); >+ >+verifyProperty(Intl, "Locale", { >+ value: Intl.Locale, >+ writable: false, >+ enumerable: false, >+ configurable: false, >+}); >diff --git a/JSTests/test262/test/intl402/Locale/prototype/constructor.js b/JSTests/test262/test/intl402/Locale/prototype/constructor.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e2c7c95dd72cb77f00a09b4d2c1a3963d8f1350b >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/prototype/constructor.js >@@ -0,0 +1,25 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale.prototype.constructor >+description: > >+ Checks the "constructor" property of the Locale prototype object. >+info: | >+ Intl.Locale.prototype.constructor >+ >+ The initial value of Intl.Locale.prototype.constructor is %Locale%. >+ >+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. >+ >+ Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+verifyProperty(Intl.Locale.prototype, 'constructor', { >+ value: Intl.Locale, >+ writable: true, >+ enumerable: false, >+ configurable: true, >+}); >diff --git a/JSTests/test262/test/intl402/Locale/prototype/maximize/length.js b/JSTests/test262/test/intl402/Locale/prototype/maximize/length.js >new file mode 100644 >index 0000000000000000000000000000000000000000..dc59be0d579d361c22952e01704373f2be4d03f5 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/prototype/maximize/length.js >@@ -0,0 +1,22 @@ >+// Copyright 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale.prototype.maximize >+description: > >+ Checks the "length" property of Intl.Locale.prototype.maximize(). >+info: | >+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. >+ The Locale constructor is a standard built-in property of the Intl object. >+ Every built-in function object, including constructors, has a length property whose value is an integer. Unless otherwise specified, this value is equal to the largest number of named arguments shown in the subclause headings for the function description. Optional parameters (which are indicated with brackets: [ ]) or rest parameters (which are shown using the form «...name») are not included in the default argument count. >+ Unless otherwise specified, the length property of a built-in function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+verifyProperty(Intl.Locale.prototype.maximize, 'length', { >+ value: 1, >+ writable: false, >+ enumerable: false, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/intl402/Locale/prototype/maximize/name.js b/JSTests/test262/test/intl402/Locale/prototype/maximize/name.js >new file mode 100644 >index 0000000000000000000000000000000000000000..45af040eb2c72baca67219019ef0a80141adf54f >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/prototype/maximize/name.js >@@ -0,0 +1,21 @@ >+// Copyright 2018 Rick Waldron. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale.prototype.maximize >+description: > >+ Checks the "name" property of Intl.Locale.prototype.maximize(). >+info: | >+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. >+ Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. >+ Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+verifyProperty(Intl.Locale.prototype.maximize, 'name', { >+ value: 'maximize', >+ writable: false, >+ enumerable: false, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/intl402/Locale/prototype/maximize/prop-desc.js b/JSTests/test262/test/intl402/Locale/prototype/maximize/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c5ff64d6e447705de180cc6d1d1245c061020f36 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/prototype/maximize/prop-desc.js >@@ -0,0 +1,29 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale.prototype.maximize >+description: > >+ Checks the "maximize" property of the Locale prototype object. >+info: | >+ Intl.Locale.prototype.maximize () >+ >+ Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. >+ >+ Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+assert.sameValue( >+ typeof Intl.Locale.prototype.maximize, >+ 'function', >+ "typeof Intl.Locale.prototype.maximize is function" >+); >+ >+verifyProperty(Intl.Locale.prototype, 'maximize', { >+ writable: true, >+ enumerable: false, >+ configurable: false, >+}); >+ >diff --git a/JSTests/test262/test/intl402/Locale/prototype/prop-desc.js b/JSTests/test262/test/intl402/Locale/prototype/prop-desc.js >new file mode 100644 >index 0000000000000000000000000000000000000000..5389b26356e30d7294ddaac43799598b8bd27807 >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/prototype/prop-desc.js >@@ -0,0 +1,22 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale.prototype >+description: > >+ Checks the "prototype" property of the Locale constructor. >+info: | >+ Intl.Locale.prototype >+ >+ The value of Intl.Locale.prototype is %LocalePrototype%. >+ >+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. >+includes: [propertyHelper.js] >+features: [Intl.Locale] >+---*/ >+ >+verifyProperty(Intl.Locale, 'prototype', { >+ writable: false, >+ enumerable: false, >+ configurable: false, >+}); >diff --git a/JSTests/test262/test/intl402/Locale/prototype/toStringTag.js b/JSTests/test262/test/intl402/Locale/prototype/toStringTag.js >new file mode 100644 >index 0000000000000000000000000000000000000000..dd939b574f8e780a622ecba9c87544b67478c93e >--- /dev/null >+++ b/JSTests/test262/test/intl402/Locale/prototype/toStringTag.js >@@ -0,0 +1,23 @@ >+// Copyright 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-intl.locale.prototype-@@tostringtag >+description: > >+ Checks the @@toStringTag property of the Locale prototype object. >+info: | >+ Intl.Locale.prototype[ @@toStringTag ] >+ >+ The initial value of the @@toStringTag property is the string value "Intl.Locale". >+ >+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. >+includes: [propertyHelper.js] >+features: [Intl.Locale, Symbol.toStringTag] >+---*/ >+ >+verifyProperty(Intl.Locale.prototype, Symbol.toStringTag, { >+ value: 'Intl.Locale', >+ writable: false, >+ enumerable: false, >+ configurable: true >+}); >diff --git a/JSTests/test262/test/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js b/JSTests/test262/test/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js >new file mode 100644 >index 0000000000000000000000000000000000000000..db9d45d23d949d0f64c5fbb99903d8ae93e1171d >--- /dev/null >+++ b/JSTests/test262/test/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js >@@ -0,0 +1,23 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sup-array.prototype.tolocalestring >+description: > >+ Ensure "toLocaleString" is called with locale and options on number elements. >+includes: [testTypedArray.js] >+features: [TypedArray] >+---*/ >+ >+var n = 0; >+ >+var locale = "th-u-nu-thai"; >+var options = { >+ minimumFractionDigits: 3 >+}; >+ >+var expected = n.toLocaleString(locale, options); >+ >+testWithTypedArrayConstructors(function(TA) { >+ assert.sameValue(new TA([n]).toLocaleString(locale, options), expected); >+}); >diff --git a/JSTests/test262/test/language/asi/S7.9_A11_T8.js b/JSTests/test262/test/language/asi/S7.9_A11_T8.js >index c41423fb0beb94e125704519e370a551efd34e6c..cb5e2b419f8d90160216a1f7e01a69354c2f99c8 100644 >--- a/JSTests/test262/test/language/asi/S7.9_A11_T8.js >+++ b/JSTests/test262/test/language/asi/S7.9_A11_T8.js >@@ -12,10 +12,5 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-//CHECK#1 >-var x = 0; >-if (false) {x = 1}; >-else x = -1 >-if (x !== -1) { >- $ERROR('#1: Check If Statement for automatic semicolon insertion'); >-} >+if (false) {}; >+else {} >diff --git a/JSTests/test262/test/language/asi/S7.9_A4.js b/JSTests/test262/test/language/asi/S7.9_A4.js >index 266bfbbf2ae74537b3cd682062912d4ad7ff89cb..5151bc5ed8bd1659b12efb938fefce76c60d9975 100644 >--- a/JSTests/test262/test/language/asi/S7.9_A4.js >+++ b/JSTests/test262/test/language/asi/S7.9_A4.js >@@ -18,4 +18,3 @@ try { > 1; > } catch(e) { > } >-$ERROR('#1: Check throw statement for automatic semicolon insertion'); >diff --git a/JSTests/test262/test/language/asi/S7.9_A5.1_T1.js b/JSTests/test262/test/language/asi/S7.9_A5.1_T1.js >index 322bd7e4b02111fe35be5cf55cad39888f57141c..4fe951cf754ffbcd257f46e7db4d184b007036ab 100644 >--- a/JSTests/test262/test/language/asi/S7.9_A5.1_T1.js >+++ b/JSTests/test262/test/language/asi/S7.9_A5.1_T1.js >@@ -12,8 +12,6 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-//CHECK#1 > var x = 0; > x > ++; >-$ERROR('#1: Check Postfix Increment Operator for automatic semicolon insertion'); >diff --git a/JSTests/test262/test/language/asi/S7.9_A5.3_T1.js b/JSTests/test262/test/language/asi/S7.9_A5.3_T1.js >index 97dbc6a6b8bb099d4399a76d868b05b87ab685c8..32ccb5e9e877a7a9635aeeb6e15b5891a07103e8 100644 >--- a/JSTests/test262/test/language/asi/S7.9_A5.3_T1.js >+++ b/JSTests/test262/test/language/asi/S7.9_A5.3_T1.js >@@ -16,4 +16,3 @@ throw "Test262: This statement should not be evaluated."; > var x = 1; > x > --; >-$ERROR('#1: Check Postfix Decrement Operator for automatic semicolon insertion'); >diff --git a/JSTests/test262/test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js b/JSTests/test262/test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0c638faf6c39e5589e58478a01640f0c8a108997 >--- /dev/null >+++ b/JSTests/test262/test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js >@@ -0,0 +1,31 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-block-static-semantics-early-errors >+description: > >+ Redeclaration with VariableDeclaration (FunctionDeclaration in BlockStatement) >+info: | >+ 13.2.1 Static Semantics: Early Errors >+ >+ It is a Syntax Error if any element of the LexicallyDeclaredNames of >+ StatementList also occurs in the VarDeclaredNames of StatementList. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+function g() { >+ // Create an outer block-statement. >+ { >+ // A lexically declared function declaration. >+ function f() {} >+ >+ // An inner block-statement with a variable-declared name. >+ { >+ var f; >+ } >+ } >+} >diff --git a/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-null.js b/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-null.js >index 1b5adc8767fb1f75412a9434e13381643d807bf5..779e21dd83117e2f99c355f32244083c4e6c7387 100644 >--- a/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-null.js >+++ b/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-null.js >@@ -12,6 +12,7 @@ info: | > > 1. Let valid be RequireObjectCoercible(value). > 2. ReturnIfAbrupt(valid). >+features: [destructuring-binding] > ---*/ > > function fn({}) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-undefined.js b/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-undefined.js >index 639bd3252a9923975b9a7cda9e288d887c65cd10..08e39671e9e233619fadefa250f694c6f8df5745 100644 >--- a/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-undefined.js >+++ b/JSTests/test262/test/language/destructuring/binding/initialization-requires-object-coercible-undefined.js >@@ -12,6 +12,7 @@ info: | > > 1. Let valid be RequireObjectCoercible(value). > 2. ReturnIfAbrupt(valid). >+features: [destructuring-binding] > ---*/ > > function fn({}) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/initialization-returns-normal-completion-for-empty-objects.js b/JSTests/test262/test/language/destructuring/binding/initialization-returns-normal-completion-for-empty-objects.js >index f2f31e5996e9e50cca3e2baa47b8089a6c655106..c3f4678312fac06a5c904b57d15b45b3c8769b65 100644 >--- a/JSTests/test262/test/language/destructuring/binding/initialization-returns-normal-completion-for-empty-objects.js >+++ b/JSTests/test262/test/language/destructuring/binding/initialization-returns-normal-completion-for-empty-objects.js >@@ -18,6 +18,7 @@ info: | > > 1. Return NormalCompletion(empty). > >+features: [destructuring-binding] > ---*/ > > function fn({}) { return true; } >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-initializer.js b/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-initializer.js >index d0534312c02591532407a4f8177d9e96ce50a8ec..95be5688a54122b074517983881fd3fb4f882145 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-initializer.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-initializer.js >@@ -23,6 +23,7 @@ info: | > BindingElement[Yield ] : > SingleNameBinding[?Yield] > BindingPattern[?Yield] Initializer[In, ?Yield]opt >+features: [destructuring-binding] > ---*/ > > function fn1([a, b = 42]) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-object-patterns.js b/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-object-patterns.js >index f216f5c63d3e6a1c02e8e7fd3c3e89ded65ee682..72eb40ce785a6ba8514cdc742042e0e83689955a 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-object-patterns.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-with-object-patterns.js >@@ -23,6 +23,7 @@ info: | > BindingElement[Yield ] : > SingleNameBinding[?Yield] > BindingPattern[?Yield] Initializer[In, ?Yield]opt >+features: [destructuring-binding] > ---*/ > > function fn1([{}]) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-without-initializer.js b/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-without-initializer.js >index 13a515077284fd11a8a12ce812aba147f36c33f2..3b21f6badeb646edddf1e86131da0dce9f57f7e6 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-without-initializer.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/array-elements-without-initializer.js >@@ -23,6 +23,7 @@ info: | > BindingElement[Yield ] : > SingleNameBinding[?Yield] > BindingPattern[?Yield] Initializer[In, ?Yield]opt >+features: [destructuring-binding] > ---*/ > > function fn1([a, b]) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-elisions.js b/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-elisions.js >index 2ec24cf017275286382d24ba27e0313340662413..f5f5dbac98acee88af54c2cdf2bdf97bbad1135f 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-elisions.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-elisions.js >@@ -12,6 +12,7 @@ info: | > [ Elisionopt BindingRestElement[?Yield]opt ] > [ BindingElementList[?Yield] ] > [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] >+features: [destructuring-binding] > ---*/ > > function fn1([,]) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-no-elements.js b/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-no-elements.js >index b509dbc22f10c96126c32d4a4232bccefac9ecf7..3740e84ba40fc05be52affb538a72734c03e1045 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-no-elements.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/array-pattern-with-no-elements.js >@@ -12,6 +12,7 @@ info: | > [ Elisionopt BindingRestElement[?Yield]opt ] > [ BindingElementList[?Yield] ] > [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] >+features: [destructuring-binding] > ---*/ > > function fn([]) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/array-rest-elements.js b/JSTests/test262/test/language/destructuring/binding/syntax/array-rest-elements.js >index 3922d1eeafb23844f5236160c13660a015ef64bf..31de6136e30287bbe1f5700cac0a30e177bd14cd 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/array-rest-elements.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/array-rest-elements.js >@@ -15,6 +15,7 @@ info: | > > BindingRestElement[Yield] : > ... BindingIdentifier[?Yield] >+features: [destructuring-binding] > ---*/ > > function fn1([...args]) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/object-pattern-with-no-property-list.js b/JSTests/test262/test/language/destructuring/binding/syntax/object-pattern-with-no-property-list.js >index b91cd57692f44d9441255b9bdf09d9849f37993b..b53a785473db05b1ad99fbc140686021084c1031 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/object-pattern-with-no-property-list.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/object-pattern-with-no-property-list.js >@@ -13,6 +13,7 @@ info: | > { BindingPropertyList[?Yield] } > { BindingPropertyList[?Yield] , } > >+features: [destructuring-binding] > ---*/ > > function fn({}) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-bindings-elements.js b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-bindings-elements.js >index d1ec99e56ed6f67c029eaadbde175a7ce3d903d3..2a521f161e9b187a3a2e21169c17afc487b10768 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-bindings-elements.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-bindings-elements.js >@@ -28,6 +28,7 @@ info: | > SingleNameBinding[Yield] : > BindingIdentifier[?Yield] Initializer[In, ?Yield]opt > >+features: [destructuring-binding] > ---*/ > > // BindingElement w/ SingleNameBinding >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-followed-by-a-single-comma.js b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-followed-by-a-single-comma.js >index bd0ddc3932207f327417779a71cbabb0b4e0086e..499b7eabade13d247766a98035354f0620b80799 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-followed-by-a-single-comma.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-followed-by-a-single-comma.js >@@ -13,6 +13,7 @@ info: | > { BindingPropertyList[?Yield] } > { BindingPropertyList[?Yield] , } > >+features: [destructuring-binding] > ---*/ > > function fn1({x,}) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-single-name-bindings.js b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-single-name-bindings.js >index 03755e5aa42726bb819d451962c9534765493856..502ecc081e26012971291593c06973c308bacece 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-single-name-bindings.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-single-name-bindings.js >@@ -24,6 +24,7 @@ info: | > SingleNameBinding[Yield] : > BindingIdentifier[?Yield] Initializer[In, ?Yield]opt > >+features: [destructuring-binding] > ---*/ > > function fna({x}) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-with-property-list.js b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-with-property-list.js >index 2cee982e41294b0f325a8e18bcaca992baf428d6..b9b2dd60d7c5f8fa927c37a0736a9200b188843d 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/property-list-with-property-list.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/property-list-with-property-list.js >@@ -17,6 +17,7 @@ info: | > BindingProperty[?Yield] > BindingPropertyList[?Yield] , BindingProperty[?Yield] > >+features: [destructuring-binding] > ---*/ > > function fn1({a: {p: q}, b: {r}, c: {s = 0}, d: {}}) {} >diff --git a/JSTests/test262/test/language/destructuring/binding/syntax/recursive-array-and-object-patterns.js b/JSTests/test262/test/language/destructuring/binding/syntax/recursive-array-and-object-patterns.js >index 977618ecb0d5535286a35fe28ad4b90f09052354..7ab60ffcd4befd642b1488ec72e3867b2d44b30f 100644 >--- a/JSTests/test262/test/language/destructuring/binding/syntax/recursive-array-and-object-patterns.js >+++ b/JSTests/test262/test/language/destructuring/binding/syntax/recursive-array-and-object-patterns.js >@@ -11,6 +11,7 @@ info: | > BindingPattern[Yield] : > ObjectBindingPattern[?Yield] > ArrayBindingPattern[?Yield] >+features: [destructuring-binding] > ---*/ > > function fn1([{}]) {} >diff --git a/JSTests/test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js b/JSTests/test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..12deaa67fa00a452c20ac85b941ab641c4dbc237 >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Block statement >+ in eval code containing a function declaration >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err; >+ >+eval('"use strict";{ function f() {} }'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js b/JSTests/test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0ee638614a7ce2050555266bfb1993dcf76f72da >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js >@@ -0,0 +1,28 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Block statement >+ in eval code containing a function declaration >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err; >+ >+eval('"use strict";{ function f() {} }'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >+ >diff --git a/JSTests/test262/test/language/eval-code/direct/block-decl-onlystrict.js b/JSTests/test262/test/language/eval-code/direct/block-decl-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..2a61cb4467616154b30296772666ece98c2a024a >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/block-decl-onlystrict.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Block statement >+ in eval code containing a function declaration >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err; >+ >+eval('{ function f() {} }'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/block-decl-strict-caller.js b/JSTests/test262/test/language/eval-code/direct/block-decl-strict-caller.js >deleted file mode 100644 >index 43a29e0b2b6a01f6f24e6180f08ebd616a46a91e..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/eval-code/direct/block-decl-strict-caller.js >+++ /dev/null >@@ -1,25 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.2 >-flags: [onlyStrict] >-info: | >- Block statement in eval code containing a function declaration >- >- B.3.3.3 Changes to EvalDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err; >- >-eval('{ function f() {} }'); >- >-try { >- f; >-} catch (exception) { >- err = exception; >-} >- >-assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/block-decl-strict-source.js b/JSTests/test262/test/language/eval-code/direct/block-decl-strict-source.js >deleted file mode 100644 >index dad6f7563b12bc5abcdf232bd12d41055f80311e..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/eval-code/direct/block-decl-strict-source.js >+++ /dev/null >@@ -1,24 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.2 >-info: | >- Block statement in eval code containing a function declaration >- >- B.3.3.3 Changes to EvalDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err; >- >-eval('"use strict";{ function f() {} }'); >- >-try { >- f; >-} catch (exception) { >- err = exception; >-} >- >-assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e58338702d1a02560546f61aed5cd05858762050 >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `case` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ "use strict";\ >+ switch (1) {\ >+ case 1:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0368049c07c9e39e0c5d54f660255bc235efb131 >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `case` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ "use strict";\ >+ switch (1) {\ >+ case 1:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-case-decl-onlystrict.js b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..3c9277fa0480a62fd9aad722d353603303091fea >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-onlystrict.js >@@ -0,0 +1,32 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `case` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ switch (1) {\ >+ case 1:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-caller.js b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-caller.js >deleted file mode 100644 >index 604da83499f39eb4fe0091cedc9a7250e53514d7..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-caller.js >+++ /dev/null >@@ -1,31 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.3 >-flags: [onlyStrict] >-info: | >- Function declaration in the `case` clause of a `switch` statement in eval >- code >- >- B.3.3.3 Changes to EvalDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err; >- >-eval('\ >- switch (1) {\ >- case 1:\ >- function f() { }\ >- }\ >-'); >- >-try { >- f; >-} catch (exception) { >- err = exception; >-} >- >-assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-source.js b/JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-source.js >deleted file mode 100644 >index 6c5835de0bf7b239c1e3b4057402b0fb0f12db32..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/eval-code/direct/switch-case-decl-strict-source.js >+++ /dev/null >@@ -1,31 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.3 >-info: | >- Function declaration in the `case` clause of a `switch` statement in eval >- code >- >- B.3.3.3 Changes to EvalDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err; >- >-eval('\ >- "use strict";\ >- switch (1) {\ >- case 1:\ >- function f() { }\ >- }\ >-'); >- >-try { >- f; >-} catch (exception) { >- err = exception; >-} >- >-assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..4370569bc31f2dbb1b3ae6e629fa073730e7ff47 >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `default` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [noStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ "use strict";\ >+ switch (1) {\ >+ default:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..fd16e8d14603bf7e86cbbba297d9aef0a3265ad7 >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `default` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ "use strict";\ >+ switch (1) {\ >+ default:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-onlystrict.js b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..067ea894eb90470f68c6ceb04f0cd0ad0b18e6f1 >--- /dev/null >+++ b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-onlystrict.js >@@ -0,0 +1,32 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-evaldeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode: Function declaration >+ in the `default` clause of a `switch` statement in eval code >+info: | >+ B.3.3.3 Changes to EvalDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err; >+ >+eval('\ >+ switch (1) {\ >+ default:\ >+ function f() { }\ >+ }\ >+'); >+ >+try { >+ f; >+} catch (exception) { >+ err = exception; >+} >+ >+assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js >deleted file mode 100644 >index fcf5e87190f9a41cdc521d44f1900767e77fb044..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js >+++ /dev/null >@@ -1,31 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.3 >-flags: [onlyStrict] >-info: | >- Function declaration in the `default` clause of a `switch` statement in >- eval code >- >- B.3.3.3 Changes to EvalDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err; >- >-eval('\ >- switch (1) {\ >- default:\ >- function f() { }\ >- }\ >-'); >- >-try { >- f; >-} catch (exception) { >- err = exception; >-} >- >-assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-source.js b/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-source.js >deleted file mode 100644 >index f601fd23c5c98de581bbaf99b4986735001c9213..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/eval-code/direct/switch-dflt-decl-strict-source.js >+++ /dev/null >@@ -1,31 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.3 >-info: | >- Function declaration in the `default` clause of a `switch` statement in >- eval code >- >- B.3.3.3 Changes to EvalDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err; >- >-eval('\ >- "use strict";\ >- switch (1) {\ >- default:\ >- function f() { }\ >- }\ >-'); >- >-try { >- f; >-} catch (exception) { >- err = exception; >-} >- >-assert.sameValue(err.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8823023178b3d49332143d36a7fe57a55d0b460b >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js >@@ -0,0 +1,15 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-async-arrow-function-definitions >+description: > >+ It is a SyntaxError if FormalParameters' default expressions contains await. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+async(a = await => {}) => {}; >diff --git a/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js >new file mode 100644 >index 0000000000000000000000000000000000000000..bf6d180bf07955f134eccb9571d433658dbf6610 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js >@@ -0,0 +1,15 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-async-arrow-function-definitions >+description: > >+ It is a SyntaxError if FormalParameters' default expressions contains await. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+async() => { (a = await/r/g) => {} }; >diff --git a/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js >new file mode 100644 >index 0000000000000000000000000000000000000000..79266eaa546aa7e2fffbe66174f8d78fe2f30e42 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js >@@ -0,0 +1,15 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-async-arrow-function-definitions >+description: > >+ It is a SyntaxError if FormalParameters' default expressions contains await. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+async(a = (await) => {}) => {}; >diff --git a/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ca65bf19a7d9d4d6c9f19805445e70946b723697 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js >@@ -0,0 +1,15 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-async-arrow-function-definitions >+description: > >+ It is a SyntaxError if FormalParameters' default expressions contains await. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+async(a = (...await) => {}) => {}; >diff --git a/JSTests/test262/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js b/JSTests/test262/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ee3a7a05474b70aa007115cd213a9fcb29e0b3da >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/async-arrow-function/escaped-async-line-terminator.js >@@ -0,0 +1,29 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-async-arrow-function-definitions >+description: > >+ Escaped "async" followed by a line-terminator is not misinterpreted as an AsyncArrowFunction. >+info: | >+ 14.7 Async Function Definitions >+ >+ async [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] => AsyncConciseBody[?In] >+ >+ 5.1.5 Grammar Notation >+ >+ Terminal symbols of the lexical, RegExp, and numeric string grammars are shown >+ in fixed width font, both in the productions of the grammars and throughout this >+ specification whenever the text directly refers to such a terminal symbol. These >+ are to appear in a script exactly as written. All terminal symbol code points >+ specified in this way are to be understood as the appropriate Unicode code points >+ from the Basic Latin range, as opposed to any similar-looking code points from >+ other Unicode ranges. >+features: [async-functions] >+---*/ >+ >+// Throws ReferenceError because reference for "async" cannot be resolved. >+assert.throws(ReferenceError, function() { >+ \u0061sync >+ p => {} >+}); >diff --git a/JSTests/test262/test/language/expressions/async-generator/generator-created-after-decl-inst.js b/JSTests/test262/test/language/expressions/async-generator/generator-created-after-decl-inst.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d492e5ef166b186675ed2afd0d2e98eb9a7e4b40 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/async-generator/generator-created-after-decl-inst.js >@@ -0,0 +1,24 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-asyncgenerator-definitions-evaluatebody >+description: > >+ The generator object is created after FunctionDeclarationInstantiation. >+info: | >+ 14.5.10 Runtime Semantics: EvaluateBody >+ >+ 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList). >+ 2. Let generator be ? OrdinaryCreateFromConstructor(functionObject, "%AsyncGeneratorPrototype%", >+ « [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]] »). >+ 3. Perform ! AsyncGeneratorStart(generator, FunctionBody). >+ ... >+ >+features: [async-iteration] >+---*/ >+ >+var g = async function*(a = (g.prototype = null)) {} >+var oldPrototype = g.prototype; >+var it = g(); >+ >+assert.notSameValue(Object.getPrototypeOf(it), oldPrototype); >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-await-escaped-module.js b/JSTests/test262/test/language/expressions/class/class-name-ident-await-escaped-module.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8fc155c4baa63aff5cc49ae732c1096b71969ef9 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-await-escaped-module.js >@@ -0,0 +1,23 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` with escape sequence is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module >+ and the StringValue of IdentifierName is "await". >+negative: >+ phase: parse >+ type: SyntaxError >+flags: [module] >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class aw\u0061it {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-await-escaped.js b/JSTests/test262/test/language/expressions/class/class-name-ident-await-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b3dd022b492819d1fc0f7b888a4de649d0c804f3 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-await-escaped.js >@@ -0,0 +1,17 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` with escape sequence is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module >+ and the StringValue of IdentifierName is "await". >+---*/ >+ >+var C = class aw\u0061it {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-await-module.js b/JSTests/test262/test/language/expressions/class/class-name-ident-await-module.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e9ba2b59302c134d061872320f87b72d2e64002e >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-await-module.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ IdentifierReference : yield >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module. >+negative: >+ phase: parse >+ type: SyntaxError >+flags: [module] >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class await {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-await.js b/JSTests/test262/test/language/expressions/class/class-name-ident-await.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8fbf07e990ffd9914c7699ec74898218ed8bb785 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-await.js >@@ -0,0 +1,16 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ IdentifierReference : yield >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module. >+---*/ >+ >+var C = class await {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-let-escaped.js b/JSTests/test262/test/language/expressions/class/class-name-ident-let-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e9beb52c1de1c83edc5f71e10f802d066f5c559c >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-let-escaped.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `let` with escape sequence is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class l\u0065t {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-let.js b/JSTests/test262/test/language/expressions/class/class-name-ident-let.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d08620fde6ccd86065979111bc037807c9d725f9 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-let.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `let` is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class let {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-static-escaped.js b/JSTests/test262/test/language/expressions/class/class-name-ident-static-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..8680e6909b42c6ee51a1034190a2be1932d581c2 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-static-escaped.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `static` with escape sequence is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class st\u0061tic {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-static.js b/JSTests/test262/test/language/expressions/class/class-name-ident-static.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a914e599be540c8b733af0093951c8d172e4ec90 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-static.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `static` is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class static {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-yield-escaped.js b/JSTests/test262/test/language/expressions/class/class-name-ident-yield-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6adf12d7574b7f80f41373f7ca8eea44569ed387 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-yield-escaped.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `yield` with escape sequence is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class yi\u0065ld {}; >diff --git a/JSTests/test262/test/language/expressions/class/class-name-ident-yield.js b/JSTests/test262/test/language/expressions/class/class-name-ident-yield.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ecc3f44dda91bb3015518885863632f4955f4a3e >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/class-name-ident-yield.js >@@ -0,0 +1,25 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `yield` is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ IdentifierReference : yield >+ >+ It is a Syntax Error if the code matched by this production is contained in strict mode code. >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+var C = class yield {}; >diff --git a/JSTests/test262/test/language/expressions/class/constructor-this-tdz-during-initializers.js b/JSTests/test262/test/language/expressions/class/constructor-this-tdz-during-initializers.js >new file mode 100644 >index 0000000000000000000000000000000000000000..fe859e7531cf11de6f8aceef10d942ea95163c8c >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/constructor-this-tdz-during-initializers.js >@@ -0,0 +1,43 @@ >+// Copyright (C) 2018 Kevin Gibbons. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-super-keyword-runtime-semantics-evaluation >+description: > >+ `this` is bound in the constructor of derived classes immediately before running initializers >+info: | >+ [...] >+ 6. Let result be ? Construct(func, argList, newTarget). >+ [...] >+ 10. Perform ? thisER.BindThisValue(result). >+ 11. Perform ? InitializeInstanceFields(result, F). >+ [...] >+features: [class-fields-public] >+---*/ >+ >+ >+var probeCtorThis; >+var thisDuringField; >+var thisFromProbe; >+var thisDuringCtor; >+ >+class Base { >+ constructor() { >+ assert.throws(ReferenceError, probeCtorThis); >+ } >+} >+ >+var C = class extends Base { >+ field = (thisDuringField = this, thisFromProbe = probeCtorThis()); >+ constructor() { >+ probeCtorThis = () => this; >+ assert.throws(ReferenceError, probeCtorThis); >+ super(); >+ thisDuringCtor = this; >+ } >+}; >+ >+var instance = new C(); >+ >+assert.sameValue(thisDuringField, instance); >+assert.sameValue(thisFromProbe, instance); >+assert.sameValue(thisDuringCtor, instance); >diff --git a/JSTests/test262/test/language/expressions/class/fields-run-once-on-double-super.js b/JSTests/test262/test/language/expressions/class/fields-run-once-on-double-super.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e01de58ca803339881911ce79f7f4bb54e219efa >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/class/fields-run-once-on-double-super.js >@@ -0,0 +1,41 @@ >+// Copyright (C) 2018 Kevin Gibbons. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-super-keyword-runtime-semantics-evaluation >+description: > >+ when calling `super()` for a second time in a derived class, the super constructor is run twice but the field initializers are only run once >+info: | >+ [...] >+ 6. Let result be ? Construct(func, argList, newTarget). >+ [...] >+ 10. Perform ? thisER.BindThisValue(result). >+ 11. Perform ? InitializeInstanceFields(result, F). >+ [...] >+features: [class-fields-public] >+---*/ >+ >+ >+var baseCtorCalled = 0; >+var fieldInitCalled = 0; >+class Base { >+ constructor() { >+ ++baseCtorCalled; >+ } >+} >+ >+var C = class extends Base { >+ field = ++fieldInitCalled; >+ constructor() { >+ assert.sameValue(baseCtorCalled, 0); >+ assert.sameValue(fieldInitCalled, 0); >+ super(); >+ assert.sameValue(baseCtorCalled, 1); >+ assert.sameValue(fieldInitCalled, 1); >+ assert.throws(ReferenceError, () => super()); >+ } >+}; >+ >+new C(); >+ >+assert.sameValue(baseCtorCalled, 2); >+assert.sameValue(fieldInitCalled, 1); >diff --git a/JSTests/test262/test/language/expressions/generators/generator-created-after-decl-inst.js b/JSTests/test262/test/language/expressions/generators/generator-created-after-decl-inst.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c7c198f23399c21e20248011200fe13fd504a2eb >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/generators/generator-created-after-decl-inst.js >@@ -0,0 +1,24 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-generator-function-definitions-runtime-semantics-evaluatebody >+description: > >+ The generator object is created after FunctionDeclarationInstantiation. >+info: | >+ 14.4.10 Runtime Semantics: EvaluateBody >+ >+ 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList). >+ 2. Let G be ? OrdinaryCreateFromConstructor(functionObject, "%GeneratorPrototype%", >+ « [[GeneratorState]], [[GeneratorContext]] »). >+ 3. Perform GeneratorStart(G, FunctionBody). >+ ... >+ >+features: [generators] >+---*/ >+ >+var g = function*(a = (g.prototype = null)) {} >+var oldPrototype = g.prototype; >+var it = g(); >+ >+assert.notSameValue(Object.getPrototypeOf(it), oldPrototype); >diff --git a/JSTests/test262/test/language/expressions/greater-than-or-equal/bigint-and-incomparable-string.js b/JSTests/test262/test/language/expressions/greater-than-or-equal/bigint-and-incomparable-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0a0303814f1b7c6a9cb068aadb03d8194914ef45 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/greater-than-or-equal/bigint-and-incomparable-string.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(1n >= "0n", false, "1n >= '0n'"); >+assert.sameValue(1n >= "0.", false, "1n >= '0.'"); >+assert.sameValue(1n >= ".0", false, "1n >= '.0'"); >+assert.sameValue(1n >= "0/1", false, "1n >= '0/1'"); >+assert.sameValue(1n >= "z0", false, "1n >= 'z0'"); >+assert.sameValue(1n >= "0z", false, "1n >= '0z'"); >+assert.sameValue(1n >= "++0", false, "1n >= '++0'"); >+assert.sameValue(1n >= "--0", false, "1n >= '--0'"); >+assert.sameValue(1n >= "0e0", false, "1n >= '0e0'"); >+assert.sameValue(1n >= "Infinity", false, "1n >= 'Infinity'"); >+ >+assert.sameValue("1n" >= 0n, false, "'1n' >= 0n"); >+assert.sameValue("1." >= 0n, false, "'1.' >= 0n"); >+assert.sameValue(".1" >= 0n, false, "'.1' >= 0n"); >+assert.sameValue("1/1" >= 0n, false, "'1/1' >= 0n"); >+assert.sameValue("z1" >= 0n, false, "'z1' >= 0n"); >+assert.sameValue("1z" >= 0n, false, "'1z' >= 0n"); >+assert.sameValue("++1" >= 0n, false, "'++1' >= 0n"); >+assert.sameValue("--1" >= 0n, false, "'--1' >= 0n"); >+assert.sameValue("1e0" >= 0n, false, "'1e0' >= 0n"); >+assert.sameValue("Infinity" >= 0n, false, "'Infinity' >= 0n"); >diff --git a/JSTests/test262/test/language/expressions/greater-than-or-equal/bigint-and-string.js b/JSTests/test262/test/language/expressions/greater-than-or-equal/bigint-and-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..37aecb3ef949cba308c356d69e6a62ede7d851c2 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/greater-than-or-equal/bigint-and-string.js >@@ -0,0 +1,48 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(0n >= "0", true, "0n >= '0'"); >+assert.sameValue("0" >= 0n, true, "'0' >= 0n"); >+ >+assert.sameValue(0n >= "1", false, "0n >= '1'"); >+assert.sameValue("0" >= 1n, false, "'0' >= 1n"); >+ >+assert.sameValue(1n >= "0", true, "1n >= '0'"); >+assert.sameValue("1" >= 0n, true, "'1' >= 0n"); >+ >+assert.sameValue(0n >= "", true, "0n >= ''"); >+assert.sameValue("" >= 0n, true, "'' >= 0n"); >+ >+assert.sameValue(0n >= "1", false, "0n >= '1'"); >+assert.sameValue("" >= 1n, false, "'' >= 1n"); >+ >+assert.sameValue(1n >= "", true, "1n >= ''"); >+assert.sameValue("1" >= 0n, true, "'1' >= 0n"); >+ >+assert.sameValue(1n >= "1", true, "1n >= '1'"); >+assert.sameValue("1" >= 1n, true, "'1' >= 1n"); >+ >+assert.sameValue(1n >= "-1", true, "1n >= '-1'"); >+assert.sameValue("1" >= -1n, true, "'1' >= -1n"); >+ >+assert.sameValue(-1n >= "1", false, "-1n >= '1'"); >+assert.sameValue("-1" >= 1n, false, "'-1' >= 1n"); >+ >+assert.sameValue(-1n >= "-1", true, "-1n >= '-1'"); >+assert.sameValue("-1" >= -1n, true, "'-1' >= -1n"); >+ >+assert.sameValue(9007199254740993n >= "9007199254740992", true, >+ "9007199254740993n >= '9007199254740992'"); >+assert.sameValue("9007199254740993" >= 9007199254740992n, true, >+ "'9007199254740993' >= 9007199254740992n"); >+ >+assert.sameValue(-9007199254740992n >= "-9007199254740993", true, >+ "-9007199254740992n >= '-9007199254740993'"); >+assert.sameValue("-9007199254740992" >= -9007199254740993n, true, >+ "'-9007199254740992' >= -9007199254740993n"); >diff --git a/JSTests/test262/test/language/expressions/greater-than/bigint-and-boolean.js b/JSTests/test262/test/language/expressions/greater-than/bigint-and-boolean.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e7131154b0695049bd83e71cc53d61b2e8ec1ea7 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/greater-than/bigint-and-boolean.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Caio Lima. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and boolean values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(0n > false, false, "0n > false"); >+assert.sameValue(false > 0n, false, "false > 0n"); >+ >+assert.sameValue(0n > true, false, "0n > true"); >+assert.sameValue(true > 0n, true, "true > 0n"); >+ >+assert.sameValue(1n > false, true, "1n > false"); >+assert.sameValue(false > 1n, false, "false > 1n"); >+ >+assert.sameValue(1n > true, false, "1n > true"); >+assert.sameValue(true > 1n, false, "true > 1n"); >+ >+assert.sameValue(31n > true, true, "31n > true"); >+assert.sameValue(true > 31n, false, "true > 31n"); >+ >+assert.sameValue(-3n > true, false, "-3n > true"); >+assert.sameValue(true > -3n, true, "true > -3n"); >+ >+assert.sameValue(-3n > false, false, "-3n > false"); >+assert.sameValue(false > -3n, true, "false > -3n"); >+ >diff --git a/JSTests/test262/test/language/expressions/greater-than/bigint-and-incomparable-string.js b/JSTests/test262/test/language/expressions/greater-than/bigint-and-incomparable-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..57b0334c945a47e3f5b942e5f6f5789817e9296b >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/greater-than/bigint-and-incomparable-string.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(1n > "0n", false, "1n > '0n'"); >+assert.sameValue(1n > "0.", false, "1n > '0.'"); >+assert.sameValue(1n > ".0", false, "1n > '.0'"); >+assert.sameValue(1n > "0/1", false, "1n > '0/1'"); >+assert.sameValue(1n > "z0", false, "1n > 'z0'"); >+assert.sameValue(1n > "0z", false, "1n > '0z'"); >+assert.sameValue(1n > "++0", false, "1n > '++0'"); >+assert.sameValue(1n > "--0", false, "1n > '--0'"); >+assert.sameValue(1n > "0e0", false, "1n > '0e0'"); >+assert.sameValue(1n > "Infinity", false, "1n > 'Infinity'"); >+ >+assert.sameValue("1n" > 0n, false, "'1n' > 0n"); >+assert.sameValue("1." > 0n, false, "'1.' > 0n"); >+assert.sameValue(".1" > 0n, false, "'.1' > 0n"); >+assert.sameValue("1/1" > 0n, false, "'1/1' > 0n"); >+assert.sameValue("z1" > 0n, false, "'z1' > 0n"); >+assert.sameValue("1z" > 0n, false, "'1z' > 0n"); >+assert.sameValue("++1" > 0n, false, "'++1' > 0n"); >+assert.sameValue("--1" > 0n, false, "'--1' > 0n"); >+assert.sameValue("1e0" > 0n, false, "'1e0' > 0n"); >+assert.sameValue("Infinity" > 0n, false, "'Infinity' > 0n"); >diff --git a/JSTests/test262/test/language/expressions/greater-than/bigint-and-string.js b/JSTests/test262/test/language/expressions/greater-than/bigint-and-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..36649fdac9cc7f5f13fc1fbdff1740d21fcaf23c >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/greater-than/bigint-and-string.js >@@ -0,0 +1,48 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(0n > "0", false, "0n > '0'"); >+assert.sameValue("0" > 0n, false, "'0' > 0n"); >+ >+assert.sameValue(0n > "1", false, "0n > '1'"); >+assert.sameValue("0" > 1n, false, "'0' > 1n"); >+ >+assert.sameValue(1n > "0", true, "1n > '0'"); >+assert.sameValue("1" > 0n, true, "'1' > 0n"); >+ >+assert.sameValue(0n > "", false, "0n > ''"); >+assert.sameValue("" > 0n, false, "'' > 0n"); >+ >+assert.sameValue(0n > "1", false, "0n > '1'"); >+assert.sameValue("" > 1n, false, "'' > 1n"); >+ >+assert.sameValue(1n > "", true, "1n > ''"); >+assert.sameValue("1" > 0n, true, "'1' > 0n"); >+ >+assert.sameValue(1n > "1", false, "1n > '1'"); >+assert.sameValue("1" > 1n, false, "'1' > 1n"); >+ >+assert.sameValue(1n > "-1", true, "1n > '-1'"); >+assert.sameValue("1" > -1n, true, "'1' > -1n"); >+ >+assert.sameValue(-1n > "1", false, "-1n > '1'"); >+assert.sameValue("-1" > 1n, false, "'-1' > 1n"); >+ >+assert.sameValue(-1n > "-1", false, "-1n > '-1'"); >+assert.sameValue("-1" > -1n, false, "'-1' > -1n"); >+ >+assert.sameValue(9007199254740993n > "9007199254740992", true, >+ "9007199254740993n > '9007199254740992'"); >+assert.sameValue("9007199254740993" > 9007199254740992n, true, >+ "'9007199254740993' > 9007199254740992n"); >+ >+assert.sameValue(-9007199254740992n > "-9007199254740993", true, >+ "-9007199254740992n > '-9007199254740993'"); >+assert.sameValue("-9007199254740992" > -9007199254740993n, true, >+ "'-9007199254740992' > -9007199254740993n"); >diff --git a/JSTests/test262/test/language/expressions/less-than-or-equal/bigint-and-incomparable-string.js b/JSTests/test262/test/language/expressions/less-than-or-equal/bigint-and-incomparable-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..f606992fc65887aebe3785e0581edd55de78db83 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/less-than-or-equal/bigint-and-incomparable-string.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue("0n" <= 1n, false, "'0n' <= 1n"); >+assert.sameValue("0." <= 1n, false, "'0.' <= 1n"); >+assert.sameValue(".0" <= 1n, false, "'.0' <= 1n"); >+assert.sameValue("0/1" <= 1n, false, "'0/1' <= 1n"); >+assert.sameValue("z0" <= 1n, false, "'z0' <= 1n"); >+assert.sameValue("0z" <= 1n, false, "'0z' <= 1n"); >+assert.sameValue("++0" <= 1n, false, "'++0' <= 1n"); >+assert.sameValue("--0" <= 1n, false, "'--0' <= 1n"); >+assert.sameValue("0e0" <= 1n, false, "'0e0' <= 1n"); >+assert.sameValue("Infinity" <= 1n, false, "'Infinity' <= 1n"); >+ >+assert.sameValue(0n <= "1n", false, "0n <= '1n'"); >+assert.sameValue(0n <= "1.", false, "0n <= '1.'"); >+assert.sameValue(0n <= ".1", false, "0n <= '.1'"); >+assert.sameValue(0n <= "1/1", false, "0n <= '1/1'"); >+assert.sameValue(0n <= "z1", false, "0n <= 'z1'"); >+assert.sameValue(0n <= "1z", false, "0n <= '1z'"); >+assert.sameValue(0n <= "++1", false, "0n <= '++1'"); >+assert.sameValue(0n <= "--1", false, "0n <= '--1'"); >+assert.sameValue(0n <= "1e0", false, "0n <= '1e0'"); >+assert.sameValue(0n <= "Infinity", false, "0n <= 'Infinity'"); >diff --git a/JSTests/test262/test/language/expressions/less-than-or-equal/bigint-and-string.js b/JSTests/test262/test/language/expressions/less-than-or-equal/bigint-and-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..3d0176cf6cadc561b495ad0369399e56dd418b10 >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/less-than-or-equal/bigint-and-string.js >@@ -0,0 +1,48 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(0n <= "0", true, "0n <= '0'"); >+assert.sameValue("0" <= 0n, true, "'0' <= 0n"); >+ >+assert.sameValue(0n <= "1", true, "0n <= '1'"); >+assert.sameValue("0" <= 1n, true, "'0' <= 1n"); >+ >+assert.sameValue(1n <= "0", false, "1n <= '0'"); >+assert.sameValue("1" <= 0n, false, "'1' <= 0n"); >+ >+assert.sameValue(0n <= "", true, "0n <= ''"); >+assert.sameValue("" <= 0n, true, "'' <= 0n"); >+ >+assert.sameValue(0n <= "1", true, "0n <= '1'"); >+assert.sameValue("" <= 1n, true, "'' <= 1n"); >+ >+assert.sameValue(1n <= "", false, "1n <= ''"); >+assert.sameValue("1" <= 0n, false, "'1' <= 0n"); >+ >+assert.sameValue(1n <= "1", true, "1n <= '1'"); >+assert.sameValue("1" <= 1n, true, "'1' <= 1n"); >+ >+assert.sameValue(1n <= "-1", false, "1n <= '-1'"); >+assert.sameValue("1" <= -1n, false, "'1' <= -1n"); >+ >+assert.sameValue(-1n <= "1", true, "-1n <= '1'"); >+assert.sameValue("-1" <= 1n, true, "'-1' <= 1n"); >+ >+assert.sameValue(-1n <= "-1", true, "-1n <= '-1'"); >+assert.sameValue("-1" <= -1n, true, "'-1' <= -1n"); >+ >+assert.sameValue(9007199254740993n <= "9007199254740992", false, >+ "9007199254740993n <= '9007199254740992'"); >+assert.sameValue("9007199254740993" <= 9007199254740992n, false, >+ "'9007199254740993' <= 9007199254740992n"); >+ >+assert.sameValue(-9007199254740992n <= "-9007199254740993", false, >+ "-9007199254740992n <= '-9007199254740993'"); >+assert.sameValue("-9007199254740992" <= -9007199254740993n, false, >+ "'-9007199254740992' <= -9007199254740993n"); >diff --git a/JSTests/test262/test/language/expressions/less-than/bigint-and-boolean.js b/JSTests/test262/test/language/expressions/less-than/bigint-and-boolean.js >new file mode 100644 >index 0000000000000000000000000000000000000000..1bead8de9b100109632d8513fced7bcc7669b43c >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/less-than/bigint-and-boolean.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Caio Lima. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and boolean values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(0n < false, false, "0n < false"); >+assert.sameValue(false < 0n, false, "false < 0n"); >+ >+assert.sameValue(0n < true, true, "0n < true"); >+assert.sameValue(true < 0n, false, "true < 0n"); >+ >+assert.sameValue(1n < false, false, "1n < false"); >+assert.sameValue(false < 1n, true, "false < 1n"); >+ >+assert.sameValue(1n < true, false, "1n < true"); >+assert.sameValue(true < 1n, false, "true < 1n"); >+ >+assert.sameValue(31n < true, false, "31n < true"); >+assert.sameValue(true < 31n, true, "true < 31n"); >+ >+assert.sameValue(-3n < true, true, "-3n < true"); >+assert.sameValue(true < -3n, false, "true < -3n"); >+ >+assert.sameValue(-3n < false, true, "-3n < false"); >+assert.sameValue(false < -3n, false, "false < -3n"); >+ >diff --git a/JSTests/test262/test/language/expressions/less-than/bigint-and-incomparable-string.js b/JSTests/test262/test/language/expressions/less-than/bigint-and-incomparable-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c48e9fb5567e64fd988fb1d279ca205f46484c7b >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/less-than/bigint-and-incomparable-string.js >@@ -0,0 +1,30 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue("0n" < 1n, false, "'0n' < 1n"); >+assert.sameValue("0." < 1n, false, "'0.' < 1n"); >+assert.sameValue(".0" < 1n, false, "'.0' < 1n"); >+assert.sameValue("0/1" < 1n, false, "'0/1' < 1n"); >+assert.sameValue("z0" < 1n, false, "'z0' < 1n"); >+assert.sameValue("0z" < 1n, false, "'0z' < 1n"); >+assert.sameValue("++0" < 1n, false, "'++0' < 1n"); >+assert.sameValue("--0" < 1n, false, "'--0' < 1n"); >+assert.sameValue("0e0" < 1n, false, "'0e0' < 1n"); >+assert.sameValue("Infinity" < 1n, false, "'Infinity' < 1n"); >+ >+assert.sameValue(0n < "1n", false, "0n < '1n'"); >+assert.sameValue(0n < "1.", false, "0n < '1.'"); >+assert.sameValue(0n < ".1", false, "0n < '.1'"); >+assert.sameValue(0n < "1/1", false, "0n < '1/1'"); >+assert.sameValue(0n < "z1", false, "0n < 'z1'"); >+assert.sameValue(0n < "1z", false, "0n < '1z'"); >+assert.sameValue(0n < "++1", false, "0n < '++1'"); >+assert.sameValue(0n < "--1", false, "0n < '--1'"); >+assert.sameValue(0n < "1e0", false, "0n < '1e0'"); >+assert.sameValue(0n < "Infinity", false, "0n < 'Infinity'"); >diff --git a/JSTests/test262/test/language/expressions/less-than/bigint-and-string.js b/JSTests/test262/test/language/expressions/less-than/bigint-and-string.js >new file mode 100644 >index 0000000000000000000000000000000000000000..858466685382804a4d8d46762579219b371e921a >--- /dev/null >+++ b/JSTests/test262/test/language/expressions/less-than/bigint-and-string.js >@@ -0,0 +1,48 @@ >+// Copyright (C) 2018 Igalia, S.L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+description: Relational comparison of BigInt and string values >+esid: sec-abstract-relational-comparison >+features: [BigInt] >+---*/ >+ >+assert.sameValue(0n < "0", false, "0n < '0'"); >+assert.sameValue("0" < 0n, false, "'0' < 0n"); >+ >+assert.sameValue(0n < "1", true, "0n < '1'"); >+assert.sameValue("0" < 1n, true, "'0' < 1n"); >+ >+assert.sameValue(1n < "0", false, "1n < '0'"); >+assert.sameValue("1" < 0n, false, "'1' < 0n"); >+ >+assert.sameValue(0n < "", false, "0n < ''"); >+assert.sameValue("" < 0n, false, "'' < 0n"); >+ >+assert.sameValue(0n < "1", true, "0n < '1'"); >+assert.sameValue("" < 1n, true, "'' < 1n"); >+ >+assert.sameValue(1n < "", false, "1n < ''"); >+assert.sameValue("1" < 0n, false, "'1' < 0n"); >+ >+assert.sameValue(1n < "1", false, "1n < '1'"); >+assert.sameValue("1" < 1n, false, "'1' < 1n"); >+ >+assert.sameValue(1n < "-1", false, "1n < '-1'"); >+assert.sameValue("1" < -1n, false, "'1' < -1n"); >+ >+assert.sameValue(-1n < "1", true, "-1n < '1'"); >+assert.sameValue("-1" < 1n, true, "'-1' < 1n"); >+ >+assert.sameValue(-1n < "-1", false, "-1n < '-1'"); >+assert.sameValue("-1" < -1n, false, "'-1' < -1n"); >+ >+assert.sameValue(9007199254740993n < "9007199254740992", false, >+ "9007199254740993n < '9007199254740992'"); >+assert.sameValue("9007199254740993" < 9007199254740992n, false, >+ "'9007199254740993' < 9007199254740992n"); >+ >+assert.sameValue(-9007199254740992n < "-9007199254740993", false, >+ "-9007199254740992n < '-9007199254740993'"); >+assert.sameValue("-9007199254740992" < -9007199254740993n, false, >+ "'-9007199254740992' < -9007199254740993n"); >diff --git a/JSTests/test262/test/language/expressions/object/method-definition/generator-super-prop-param.js b/JSTests/test262/test/language/expressions/object/method-definition/generator-super-prop-param.js >index 08369140251b1976c803b93ccc1418b344bae8c5..ed54b06a0a692b55b7cdf2c32e4dde314488db32 100644 >--- a/JSTests/test262/test/language/expressions/object/method-definition/generator-super-prop-param.js >+++ b/JSTests/test262/test/language/expressions/object/method-definition/generator-super-prop-param.js >@@ -3,11 +3,11 @@ > > /*--- > info: | >- GeneratorMethod can reference SuperProperty in arg >+ GeneratorMethod can reference SuperProperty in default parameters > es6id: 14.4.1 > author: Sam Mikes > description: GeneratorMethod uses SuperProperty (allowed) >-features: [ default-arg, generators, super ] >+features: [ default-parameters, generators, super ] > ---*/ > > var obj = { >diff --git a/JSTests/test262/test/language/function-code/block-decl-onlystrict.js b/JSTests/test262/test/language/function-code/block-decl-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..39342a4d19ee47700fabc594165da62be89d2220 >--- /dev/null >+++ b/JSTests/test262/test/language/function-code/block-decl-onlystrict.js >@@ -0,0 +1,38 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-functiondeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Block statement >+ in function code containing a function declaration >+info: | >+ B.3.3.1 Changes to FunctionDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err1, err2; >+ >+(function() { >+ try { >+ f; >+ } catch (exception) { >+ err1 = exception; >+ } >+ >+ { >+ function f() { } >+ } >+ >+ try { >+ f; >+ } catch (exception) { >+ err2 = exception; >+ } >+}()); >+ >+assert.sameValue(err1.constructor, ReferenceError); >+assert.sameValue(err2.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/function-code/block-decl-strict.js b/JSTests/test262/test/language/function-code/block-decl-strict.js >deleted file mode 100644 >index 573176b80d0382ec91a94e2baa462407f00499df..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/function-code/block-decl-strict.js >+++ /dev/null >@@ -1,36 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.1 >-flags: [onlyStrict] >-info: | >- Block statement in function code containing a function declaration >- >- B.3.3.1 Changes to FunctionDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err1, err2; >- >-(function() { >- try { >- f; >- } catch (exception) { >- err1 = exception; >- } >- >- { >- function f() { } >- } >- >- try { >- f; >- } catch (exception) { >- err2 = exception; >- } >-}()); >- >-assert.sameValue(err1.constructor, ReferenceError); >-assert.sameValue(err2.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/function-code/switch-case-decl-onlystrict.js b/JSTests/test262/test/language/function-code/switch-case-decl-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..045605f8b6d4558a40fb5a72aa1231d9f06659f4 >--- /dev/null >+++ b/JSTests/test262/test/language/function-code/switch-case-decl-onlystrict.js >@@ -0,0 +1,39 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-functiondeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `case` clause of a `switch` statement in function code >+info: | >+ B.3.3.1 Changes to FunctionDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err1, err2; >+ >+(function() { >+ try { >+ f; >+ } catch (exception) { >+ err1 = exception; >+ } >+ >+ switch (1) { >+ case 1: >+ function f() { } >+ } >+ >+ try { >+ f; >+ } catch (exception) { >+ err2 = exception; >+ } >+}()); >+ >+assert.sameValue(err1.constructor, ReferenceError); >+assert.sameValue(err2.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/function-code/switch-case-decl-strict.js b/JSTests/test262/test/language/function-code/switch-case-decl-strict.js >deleted file mode 100644 >index 783da6cceb65d0f8857c97478f1d703605e94a0e..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/function-code/switch-case-decl-strict.js >+++ /dev/null >@@ -1,38 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.1 >-flags: [onlyStrict] >-info: | >- Function declaration in the `case` clause of a `switch` statement in >- function code >- >- B.3.3.1 Changes to FunctionDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err1, err2; >- >-(function() { >- try { >- f; >- } catch (exception) { >- err1 = exception; >- } >- >- switch (1) { >- case 1: >- function f() { } >- } >- >- try { >- f; >- } catch (exception) { >- err2 = exception; >- } >-}()); >- >-assert.sameValue(err1.constructor, ReferenceError); >-assert.sameValue(err2.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/function-code/switch-dflt-decl-onlystrict.js b/JSTests/test262/test/language/function-code/switch-dflt-decl-onlystrict.js >new file mode 100644 >index 0000000000000000000000000000000000000000..9b589616559e190ce46fdd9b4ee189bd8cfd951a >--- /dev/null >+++ b/JSTests/test262/test/language/function-code/switch-dflt-decl-onlystrict.js >@@ -0,0 +1,39 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-web-compat-functiondeclarationinstantiation >+description: > >+ AnnexB extension not honored in strict mode, Function declaration >+ in the `default` clause of a `switch` statement in function code >+info: | >+ B.3.3.1 Changes to FunctionDeclarationInstantiation >+ >+ 1. If strict is false, then >+ ... >+ >+flags: [onlyStrict] >+---*/ >+ >+var err1, err2; >+ >+(function() { >+ try { >+ f; >+ } catch (exception) { >+ err1 = exception; >+ } >+ >+ switch (1) { >+ default: >+ function f() { } >+ } >+ >+ try { >+ f; >+ } catch (exception) { >+ err2 = exception; >+ } >+}()); >+ >+assert.sameValue(err1.constructor, ReferenceError); >+assert.sameValue(err2.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/function-code/switch-dflt-decl-strict.js b/JSTests/test262/test/language/function-code/switch-dflt-decl-strict.js >deleted file mode 100644 >index 0b5369db24ee85d4791a3c484fbf575e91170b2d..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/function-code/switch-dflt-decl-strict.js >+++ /dev/null >@@ -1,38 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-description: AnnexB extension not honored in strict mode >-es6id: B.3.3.1 >-flags: [onlyStrict] >-info: | >- Function declaration in the `default` clause of a `switch` statement in >- function code >- >- B.3.3.1 Changes to FunctionDeclarationInstantiation >- >- 1. If strict is false, then >----*/ >- >-var err1, err2; >- >-(function() { >- try { >- f; >- } catch (exception) { >- err1 = exception; >- } >- >- switch (1) { >- default: >- function f() { } >- } >- >- try { >- f; >- } catch (exception) { >- err2 = exception; >- } >-}()); >- >-assert.sameValue(err1.constructor, ReferenceError); >-assert.sameValue(err2.constructor, ReferenceError); >diff --git a/JSTests/test262/test/language/line-terminators/S7.3_A2.3.js b/JSTests/test262/test/language/line-terminators/S7.3_A2.3.js >deleted file mode 100644 >index fb26e7e7a7133c940835c462cf6bc8a3630978a7..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/line-terminators/S7.3_A2.3.js >+++ /dev/null >@@ -1,12 +0,0 @@ >-// Copyright 2009 the Sputnik authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-info: LINE SEPARATOR (U+2028) within strings is not allowed >-es5id: 7.3_A2.3 >-description: Insert LINE SEPARATOR (\u2028) into string >----*/ >- >-assert.throws(SyntaxError, function() { >- eval("'\u2028str\u2028ing\u2028'"); >-}); >diff --git a/JSTests/test262/test/language/line-terminators/S7.3_A2.4.js b/JSTests/test262/test/language/line-terminators/S7.3_A2.4.js >deleted file mode 100644 >index 582a84f6429e5744ddeae8f78a1a1dad1bff4049..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/line-terminators/S7.3_A2.4.js >+++ /dev/null >@@ -1,13 +0,0 @@ >-// Copyright 2009 the Sputnik authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >- >-/*--- >-info: PARAGRAPH SEPARATOR (U+2029) within strings is not allowed >-es5id: 7.3_A2.4 >-description: Insert PARAGRAPH SEPARATOR (\u2029) into string >----*/ >- >-// CHECK#1 >-assert.throws(SyntaxError, function() { >- eval("'\u2029str\u2029ing\u2029'"); >-}); >diff --git a/JSTests/test262/test/language/literals/regexp/invalid-optional-lookbehind.js b/JSTests/test262/test/language/literals/regexp/invalid-optional-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0e46d6b2517d9d94b7a8ce88f398d17d87cfe4f3 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/invalid-optional-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<=.)?/; >diff --git a/JSTests/test262/test/language/literals/regexp/invalid-optional-negative-lookbehind.js b/JSTests/test262/test/language/literals/regexp/invalid-optional-negative-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b972bc6764f91be978b909650bc7d2909d5ab3cd >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/invalid-optional-negative-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<!.)?/; >diff --git a/JSTests/test262/test/language/literals/regexp/invalid-range-lookbehind.js b/JSTests/test262/test/language/literals/regexp/invalid-range-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..2019433e8270dabbbb2714aa40cb02a0e47cbce8 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/invalid-range-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<=.){2,3}/; >diff --git a/JSTests/test262/test/language/literals/regexp/invalid-range-negative-lookbehind.js b/JSTests/test262/test/language/literals/regexp/invalid-range-negative-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c02122bbb1154b416900d7b1f1eb8aa012dadbe6 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/invalid-range-negative-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<!.){2,3}/; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-optional-lookahead.js b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-lookahead.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c1d64c2c70d9b90156e0bef357bcf16eff425fe7 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-lookahead.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+es6id: B.1.4 >+description: Quantifiable assertions disallowed with `u` flag >+info: | >+ The `u` flag precludes quantifiable assertions (even when Annex B is >+ honored) >+ >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?=.)?/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-optional-lookbehind.js b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d36b4e0c9d727e531c7d7a6630b6c0d1ff50336e >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<=.)?/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-optional-negative-lookahead.js b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-negative-lookahead.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e12dcae6e6bd257d177fac2bc57f69d23080ac6b >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-negative-lookahead.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+es6id: B.1.4 >+description: Quantifiable assertions disallowed with `u` flag >+info: | >+ The `u` flag precludes quantifiable assertions (even when Annex B is >+ honored) >+ >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?!.)?/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-optional-negative-lookbehind.js b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-negative-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6697fa05fa6e1c92e037bfa8ea00df140b5e84ed >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-optional-negative-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<!.)?/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js b/JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js >deleted file mode 100644 >index c1d64c2c70d9b90156e0bef357bcf16eff425fe7..0000000000000000000000000000000000000000 >--- a/JSTests/test262/test/language/literals/regexp/u-invalid-quantifiable-assertion.js >+++ /dev/null >@@ -1,20 +0,0 @@ >-// Copyright (C) 2016 the V8 project authors. All rights reserved. >-// This code is governed by the BSD license found in the LICENSE file. >-/*--- >-esid: sec-regular-expressions-patterns >-es6id: B.1.4 >-description: Quantifiable assertions disallowed with `u` flag >-info: | >- The `u` flag precludes quantifiable assertions (even when Annex B is >- honored) >- >- Term[U] :: >- [~U] QuantifiableAssertion Quantifier >-negative: >- phase: parse >- type: SyntaxError >----*/ >- >-throw "Test262: This statement should not be evaluated."; >- >-/.(?=.)?/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-range-lookahead.js b/JSTests/test262/test/language/literals/regexp/u-invalid-range-lookahead.js >new file mode 100644 >index 0000000000000000000000000000000000000000..1c6efb12c76105e02f40bff5843ffc4daac0f3e3 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-range-lookahead.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+es6id: B.1.4 >+description: Quantifiable assertions disallowed with `u` flag >+info: | >+ The `u` flag precludes quantifiable assertions (even when Annex B is >+ honored) >+ >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?=.){2,3}/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-range-lookbehind.js b/JSTests/test262/test/language/literals/regexp/u-invalid-range-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a6908486981f5ab66187722598e4fb6a8e0044f8 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-range-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<=.){2,3}/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-range-negative-lookahead.js b/JSTests/test262/test/language/literals/regexp/u-invalid-range-negative-lookahead.js >new file mode 100644 >index 0000000000000000000000000000000000000000..18d3c1b126c534b9143fd207dc0f57eb36b09f0d >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-range-negative-lookahead.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2016 the V8 project authors. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+es6id: B.1.4 >+description: Quantifiable assertions disallowed with `u` flag >+info: | >+ The `u` flag precludes quantifiable assertions (even when Annex B is >+ honored) >+ >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?!.){2,3}/u; >diff --git a/JSTests/test262/test/language/literals/regexp/u-invalid-range-negative-lookbehind.js b/JSTests/test262/test/language/literals/regexp/u-invalid-range-negative-lookbehind.js >new file mode 100644 >index 0000000000000000000000000000000000000000..7bb80a24990f1f11939ec72b1c65924c4780def2 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/regexp/u-invalid-range-negative-lookbehind.js >@@ -0,0 +1,20 @@ >+// Copyright (C) 2018 Igalia S. L. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+/*--- >+esid: sec-regular-expressions-patterns >+description: Lookbehinds are not treated as a QuantifiableAssertion >+info: | >+ Term[U] :: >+ [~U] QuantifiableAssertion Quantifier >+ >+ QuantifiableAssertion[N]:: >+ ( ? = Disjunction[~U, ?N] ) >+ ( ? ! Disjunction[~U, ?N] ) >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+/.(?<!.){2,3}/u; >diff --git a/JSTests/test262/test/language/literals/string/line-separator-eval.js b/JSTests/test262/test/language/literals/string/line-separator-eval.js >new file mode 100644 >index 0000000000000000000000000000000000000000..c8f4b33cbcd707603f8782ebaa2e9eab2e90f83e >--- /dev/null >+++ b/JSTests/test262/test/language/literals/string/line-separator-eval.js >@@ -0,0 +1,17 @@ >+// Copyright (C) 2018 Richard Gibson. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-literals-string-literals >+description: > >+ U+2028 LINE SEPARATOR can appear in string literals (eval code). >+info: | >+ 11.8.4 String Literals >+ >+ All code points may appear literally in a string literal except for the >+ closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), >+ and U+000A (LINE FEED). >+features: [json-superset] >+---*/ >+ >+assert.sameValue(eval("'\u2028'"), "\u2028"); >diff --git a/JSTests/test262/test/language/literals/string/line-separator.js b/JSTests/test262/test/language/literals/string/line-separator.js >new file mode 100644 >index 0000000000000000000000000000000000000000..359b8977fcd4ac971e8a2ec107b2e8da05762642 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/string/line-separator.js >@@ -0,0 +1,18 @@ >+// Copyright (C) 2018 Richard Gibson. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-literals-string-literals >+description: > >+ U+2028 LINE SEPARATOR can appear in string literals. >+info: | >+ 11.8.4 String Literals >+ >+ All code points may appear literally in a string literal except for the >+ closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), >+ and U+000A (LINE FEED). >+features: [json-superset] >+---*/ >+ >+// U+2028 in strings; UTF8(0x2028) = 0xE2 0x80 0xA8 >+assert.sameValue("â¨", "\u2028"); >diff --git a/JSTests/test262/test/language/literals/string/paragraph-separator-eval.js b/JSTests/test262/test/language/literals/string/paragraph-separator-eval.js >new file mode 100644 >index 0000000000000000000000000000000000000000..18e8df3a3f3d67ad2a6cd1b441aa842c7e4ed765 >--- /dev/null >+++ b/JSTests/test262/test/language/literals/string/paragraph-separator-eval.js >@@ -0,0 +1,17 @@ >+// Copyright (C) 2018 Richard Gibson. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-literals-string-literals >+description: > >+ U+2029 PARAGRAPH SEPARATOR can appear in string literals (eval code). >+info: | >+ 11.8.4 String Literals >+ >+ All code points may appear literally in a string literal except for the >+ closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), >+ and U+000A (LINE FEED). >+features: [json-superset] >+---*/ >+ >+assert.sameValue(eval("'\u2029'"), "\u2029"); >diff --git a/JSTests/test262/test/language/literals/string/paragraph-separator.js b/JSTests/test262/test/language/literals/string/paragraph-separator.js >new file mode 100644 >index 0000000000000000000000000000000000000000..5e0ab447606fff3c092c84e5307f80c416be62be >--- /dev/null >+++ b/JSTests/test262/test/language/literals/string/paragraph-separator.js >@@ -0,0 +1,18 @@ >+// Copyright (C) 2018 Richard Gibson. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-literals-string-literals >+description: > >+ U+2029 PARAGRAPH SEPARATOR can appear in string literals. >+info: | >+ 11.8.4 String Literals >+ >+ All code points may appear literally in a string literal except for the >+ closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), >+ and U+000A (LINE FEED). >+features: [json-superset] >+---*/ >+ >+// U+2029 in strings; UTF8(0x2029) = 0xE2 0x80 0xA9 >+assert.sameValue("â©", "\u2029"); >diff --git a/JSTests/test262/test/language/module-code/early-strict-mode.js b/JSTests/test262/test/language/module-code/early-strict-mode.js >index f510ff8186fd6a47eff47affd36d3624d16ccfb1..d06a404080b4043fb594dae8c2407966b75a182f 100644 >--- a/JSTests/test262/test/language/module-code/early-strict-mode.js >+++ b/JSTests/test262/test/language/module-code/early-strict-mode.js >@@ -12,5 +12,4 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-$ERROR('This statement should not be executed.'); > var public; >diff --git a/JSTests/test262/test/language/statements/async-generator/generator-created-after-decl-inst.js b/JSTests/test262/test/language/statements/async-generator/generator-created-after-decl-inst.js >new file mode 100644 >index 0000000000000000000000000000000000000000..4ca30a528ec6758ef613ec4f0a4cebba0a12bbe9 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/async-generator/generator-created-after-decl-inst.js >@@ -0,0 +1,24 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-asyncgenerator-definitions-evaluatebody >+description: > >+ The generator object is created after FunctionDeclarationInstantiation. >+info: | >+ 14.5.10 Runtime Semantics: EvaluateBody >+ >+ 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList). >+ 2. Let generator be ? OrdinaryCreateFromConstructor(functionObject, "%AsyncGeneratorPrototype%", >+ « [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]] »). >+ 3. Perform ! AsyncGeneratorStart(generator, FunctionBody). >+ ... >+ >+features: [async-iteration] >+---*/ >+ >+async function* g(a = (g.prototype = null)) {} >+var oldPrototype = g.prototype; >+var it = g(); >+ >+assert.notSameValue(Object.getPrototypeOf(it), oldPrototype); >diff --git a/JSTests/test262/test/language/statements/break/S12.8_A8_T1.js b/JSTests/test262/test/language/statements/break/S12.8_A8_T1.js >index 6f8284e7df7f4cc35075d7c10a167b9de41180ef..5691a0427aeb10a230ca70cfebf78ffcf1b85d7f 100644 >--- a/JSTests/test262/test/language/statements/break/S12.8_A8_T1.js >+++ b/JSTests/test262/test/language/statements/break/S12.8_A8_T1.js >@@ -14,19 +14,9 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-var x=0,y=0; >- > try{ >- LABEL1 : do { >- x++; >- throw "gonna leave it"; >- y++; >- } while(0); >- $ERROR('#1: throw "gonna leave it" lead to throwing exception'); > } catch(e){ > break LABEL2; > LABEL2 : do { >- x++; >- y++; > } while(0); > } >diff --git a/JSTests/test262/test/language/statements/break/S12.8_A8_T2.js b/JSTests/test262/test/language/statements/break/S12.8_A8_T2.js >index afb8b71426f0e781d52ad3ca84c2f4eed1c2f3f6..4a9aa5e902a4966793de9ce98ac7d288078cc881 100644 >--- a/JSTests/test262/test/language/statements/break/S12.8_A8_T2.js >+++ b/JSTests/test262/test/language/statements/break/S12.8_A8_T2.js >@@ -14,19 +14,9 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-var x=0,y=0; >- > try{ >- LABEL1 : do { >- x++; >- throw "gonna leave it"; >- y++; >- } while(0); >- $ERROR('#1: throw "gonna leave it" lead to throwing exception'); > } catch(e){ > break; > LABEL2 : do { >- x++; >- y++; > } while(0); > } >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-await-escaped-module.js b/JSTests/test262/test/language/statements/class/class-name-ident-await-escaped-module.js >new file mode 100644 >index 0000000000000000000000000000000000000000..5c1eb1c465c5dc2e59b2eb36e2ee38940d84a9f9 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-await-escaped-module.js >@@ -0,0 +1,23 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` with escape sequence is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module >+ and the StringValue of IdentifierName is "await". >+negative: >+ phase: parse >+ type: SyntaxError >+flags: [module] >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class aw\u0061it {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-await-escaped.js b/JSTests/test262/test/language/statements/class/class-name-ident-await-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..b1f28aaaac613f8552249061c95d3c3f1d047dea >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-await-escaped.js >@@ -0,0 +1,17 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` with escape sequence is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module >+ and the StringValue of IdentifierName is "await". >+---*/ >+ >+class aw\u0061it {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-await-module.js b/JSTests/test262/test/language/statements/class/class-name-ident-await-module.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ec6af342eea1089ae48653dbf36f206ae8267ce2 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-await-module.js >@@ -0,0 +1,22 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ IdentifierReference : await >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module. >+negative: >+ phase: parse >+ type: SyntaxError >+flags: [module] >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class await {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-await.js b/JSTests/test262/test/language/statements/class/class-name-ident-await.js >new file mode 100644 >index 0000000000000000000000000000000000000000..0237382e7e4ceaf01e300aa269ac25b0beaba033 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-await.js >@@ -0,0 +1,16 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `await` is a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ IdentifierReference : await >+ >+ It is a Syntax Error if the goal symbol of the syntactic grammar is Module. >+---*/ >+ >+class await {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-let-escaped.js b/JSTests/test262/test/language/statements/class/class-name-ident-let-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..eb54d475299c2310b9466239b71d75c891ad3a8d >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-let-escaped.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `let` with escape sequence is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class l\u0065t {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-let.js b/JSTests/test262/test/language/statements/class/class-name-ident-let.js >new file mode 100644 >index 0000000000000000000000000000000000000000..62da2542afe38b5fe8146245edabc69e1de2b410 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-let.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `let` is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class let {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-static-escaped.js b/JSTests/test262/test/language/statements/class/class-name-ident-static-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..fe1e1e7960e786003c2cf48077229bf8f4e51606 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-static-escaped.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `static` with escape sequence is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class st\u0061tic {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-static.js b/JSTests/test262/test/language/statements/class/class-name-ident-static.js >new file mode 100644 >index 0000000000000000000000000000000000000000..43b7c9ca9b9fc6796cdaee32e387ec651a61240c >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-static.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `static` is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class static {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-yield-escaped.js b/JSTests/test262/test/language/statements/class/class-name-ident-yield-escaped.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e2992b51d30726b41b0d5c8c5449e2b203e8b3a2 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-yield-escaped.js >@@ -0,0 +1,27 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `yield` with escape sequence is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ Identifier : IdentifierName but not ReservedWord >+ >+ It is a Syntax Error if this phrase is contained in strict mode code and the >+ StringValue of IdentifierName is: "implements", "interface", "let", "package", >+ "private", "protected", "public", "static", or "yield". >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class yi\u0065ld {} >diff --git a/JSTests/test262/test/language/statements/class/class-name-ident-yield.js b/JSTests/test262/test/language/statements/class/class-name-ident-yield.js >new file mode 100644 >index 0000000000000000000000000000000000000000..6ef516599299cf60aa2e966b1a58aabca6f6cad6 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/class/class-name-ident-yield.js >@@ -0,0 +1,25 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-class-definitions >+description: > >+ `yield` is not a valid class-name identifier. >+info: | >+ 12.1.1 Static Semantics: Early Errors >+ >+ IdentifierReference : yield >+ >+ It is a Syntax Error if the code matched by this production is contained in strict mode code. >+ >+ 10.2.1 Strict Mode Code >+ >+ All parts of a ClassDeclaration or a ClassExpression are strict mode code. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+class yield {} >diff --git a/JSTests/test262/test/language/statements/continue/S12.7_A8_T1.js b/JSTests/test262/test/language/statements/continue/S12.7_A8_T1.js >index 829e536143f49c0d940a0ad1b54a56e43cd72e2b..3e79fc9610b8a1ef8b149113ff947512930c5b71 100644 >--- a/JSTests/test262/test/language/statements/continue/S12.7_A8_T1.js >+++ b/JSTests/test262/test/language/statements/continue/S12.7_A8_T1.js >@@ -14,19 +14,9 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-var x=0,y=0; >- > try{ >- LABEL1 : do { >- x++; >- throw "gonna leave it"; >- y++; >- } while(0); >- $ERROR('#1: throw "gonna leave it" lead to throwing exception'); > } catch(e){ > continue LABEL2; > LABEL2 : do { >- x++; >- y++; > } while(0); > }; >diff --git a/JSTests/test262/test/language/statements/continue/S12.7_A8_T2.js b/JSTests/test262/test/language/statements/continue/S12.7_A8_T2.js >index f52cc83afc4fd0d1ffd17d7615372774ac2fe399..2141f33c291d9b2424b659997b36e58ce61f8b74 100644 >--- a/JSTests/test262/test/language/statements/continue/S12.7_A8_T2.js >+++ b/JSTests/test262/test/language/statements/continue/S12.7_A8_T2.js >@@ -12,19 +12,7 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-var x=0,y=0; >- > try{ >- LABEL1 : do { >- x++; >- throw "gonna leave it"; >- y++; >- } while(0); >- $ERROR('#1: throw "gonna leave it" lead to throwing exception'); > } catch(e){ > continue; >- LABEL2 : do { >- x++; >- y++; >- } while(0); > }; >diff --git a/JSTests/test262/test/language/statements/generators/generator-created-after-decl-inst.js b/JSTests/test262/test/language/statements/generators/generator-created-after-decl-inst.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a0f49f9790bb7d33cd0924f9bbc04299884bde77 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/generators/generator-created-after-decl-inst.js >@@ -0,0 +1,24 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-generator-function-definitions-runtime-semantics-evaluatebody >+description: > >+ The generator object is created after FunctionDeclarationInstantiation. >+info: | >+ 14.4.10 Runtime Semantics: EvaluateBody >+ >+ 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList). >+ 2. Let G be ? OrdinaryCreateFromConstructor(functionObject, "%GeneratorPrototype%", >+ « [[GeneratorState]], [[GeneratorContext]] »). >+ 3. Perform GeneratorStart(G, FunctionBody). >+ ... >+ >+features: [generators] >+---*/ >+ >+function* g(a = (g.prototype = null)) {} >+var oldPrototype = g.prototype; >+var it = g(); >+ >+assert.notSameValue(Object.getPrototypeOf(it), oldPrototype); >diff --git a/JSTests/test262/test/language/statements/try/early-catch-duplicates.js b/JSTests/test262/test/language/statements/try/early-catch-duplicates.js >index b4c5afb28240e281fcd6231f6adccd13d416b893..e34d2148046cc919fee9c543e7dcec24c074a4ff 100644 >--- a/JSTests/test262/test/language/statements/try/early-catch-duplicates.js >+++ b/JSTests/test262/test/language/statements/try/early-catch-duplicates.js >@@ -13,6 +13,4 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-$ERROR('This code should not be executed.'); >- > try { } catch ([x, x]) {} >diff --git a/JSTests/test262/test/language/statements/try/early-catch-function.js b/JSTests/test262/test/language/statements/try/early-catch-function.js >new file mode 100644 >index 0000000000000000000000000000000000000000..f51c16701a2fdf33128d331ba87f890eeb8eaec5 >--- /dev/null >+++ b/JSTests/test262/test/language/statements/try/early-catch-function.js >@@ -0,0 +1,25 @@ >+// Copyright (C) 2018 André Bargull. All rights reserved. >+// This code is governed by the BSD license found in the LICENSE file. >+ >+/*--- >+esid: sec-try-statement-static-semantics-early-errors >+description: > >+ Redeclaration of CatchParameter with directly nested FunctionDeclaration in function context. >+info: | >+ 13.15.1 Static Semantics: Early Errors >+ >+ It is a Syntax Error if any element of the BoundNames of CatchParameter also >+ occurs in the LexicallyDeclaredNames of Block. >+negative: >+ phase: parse >+ type: SyntaxError >+---*/ >+ >+throw "Test262: This statement should not be evaluated."; >+ >+function f() { >+ try { >+ } catch (e) { >+ function e(){} >+ } >+} >diff --git a/JSTests/test262/test/language/statements/try/early-catch-lex.js b/JSTests/test262/test/language/statements/try/early-catch-lex.js >index f04cb5e6d74d4d704e74e903cfe992403a8da22c..68e7e6921226fe95a8957b92a0404ec963a6dd1b 100644 >--- a/JSTests/test262/test/language/statements/try/early-catch-lex.js >+++ b/JSTests/test262/test/language/statements/try/early-catch-lex.js >@@ -14,6 +14,4 @@ features: [let] > > throw "Test262: This statement should not be evaluated."; > >-$ERROR('This code should not be executed.'); >- > try { } catch (x) { let x; } >diff --git a/JSTests/test262/test/language/statements/try/early-catch-var.js b/JSTests/test262/test/language/statements/try/early-catch-var.js >index c74c036a9ddd3bec23e64f6a88c0e4eb62413529..45e3feb22a71dfa486e255b663fadad29a8377eb 100644 >--- a/JSTests/test262/test/language/statements/try/early-catch-var.js >+++ b/JSTests/test262/test/language/statements/try/early-catch-var.js >@@ -18,6 +18,4 @@ negative: > > throw "Test262: This statement should not be evaluated."; > >-$ERROR('This code should not be executed.'); >- > try { } catch (x) { for (var x of []) {} } >diff --git a/JSTests/test262/test262-Revision.txt b/JSTests/test262/test262-Revision.txt >index 98dc89efbdd746b46e00c0ef6c28992f6d0c2626..78382f58c412ad63412f63915e7bfd545360b671 100644 >--- a/JSTests/test262/test262-Revision.txt >+++ b/JSTests/test262/test262-Revision.txt >@@ -1,2 +1,2 @@ >-test262 remote url: https://github.com/tc39/test262.git >-test262 revision: 845407e0b6a9d7c97fef632a66f2f90fce7ae1f4 >+test262 remote url: git@github.com:tc39/test262.git >+test262 revision: c38bf8ba2335bed22e20169377c808699986eb4d
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185482
:
339997
|
340014
|
340024
|
340026
|
340040
|
340117
| 340124