author | Jason Orendorff <jorendorff@mozilla.com> |
Tue, 14 Aug 2018 13:35:50 -0500 | |
changeset 432434 | d206778940ef0d89ecf8f2fe74e09c1d04f42128 |
parent 432433 | 66a2d0d0f6ed7ea7cc0060e3005016aeb66cc575 |
child 432435 | ea2aeead3f94478cf4870681945cced6383eca81 |
push id | 34476 |
push user | ncsoregi@mozilla.com |
push date | Mon, 20 Aug 2018 22:00:28 +0000 |
treeherder | mozilla-central@d0d2e0f4b33c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | anba |
bugs | 1483380 |
milestone | 63.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/js/src/tests/test262/GIT-INFO +++ b/js/src/tests/test262/GIT-INFO @@ -1,7 +1,5 @@ -commit e9a5a7f918c0f9c4a9f1224d25a6d55147953225 -Author: test262-automation <40212386+test262-automation@users.noreply.github.com> -Date: Tue Jul 3 15:59:58 2018 -0400 +commit 60b9467630a7b4899058e3ad74eb88c3ecb08a40 +Author: Kevin Gibbons <bakkot@gmail.com> +Date: Fri Aug 10 23:16:46 2018 -0700 - [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time) (#1620) - - * [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time) + Two more simple tests
new file mode 100644 --- /dev/null +++ b/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,SharedArrayBuffer is not enabled unconditionally +// Copyright (C) 2017 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-atomics.notify +description: > + Test range checking of Atomics.notify on arrays that allow atomic operations +info: | + Atomics.notify( typedArray, index, count ) + + 1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). + .. + +includes: [testAtomics.js] +features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray] +---*/ + +const i32a = new Int32Array( + new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) +); + +testWithAtomicsOutOfBoundsIndices(function(IdxGen) { + assert.throws(RangeError, function() { + Atomics.notify(i32a, IdxGen(i32a), 0); + }, '`Atomics.notify(i32a, IdxGen(i32a), 0)` throws RangeError'); +}); + +reportCompare(0, 0);
new file mode 100644 --- /dev/null +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')||!this.hasOwnProperty('SharedArrayBuffer')) -- Atomics,BigInt,SharedArrayBuffer is not enabled unconditionally +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-atomics.notify +description: > + Test range checking of Atomics.notify on arrays that allow atomic operations +info: | + Atomics.notify( typedArray, index, count ) + + 1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). + .. + +includes: [testAtomics.js] +features: [ArrayBuffer, Atomics, BigInt, DataView, SharedArrayBuffer, Symbol, TypedArray] +---*/ + +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8) +); + +testWithAtomicsOutOfBoundsIndices(function(IdxGen) { + assert.throws(RangeError, function() { + Atomics.notify(i64a, IdxGen(i64a), 0); + }, '`Atomics.notify(i64a, IdxGen(i64a), 0)` throws RangeError'); +}); + +reportCompare(0, 0);
new file mode 100644 --- /dev/null +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-bigint64-typedarray-throws.js @@ -0,0 +1,37 @@ +// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('BigInt')) -- Atomics,BigInt is not enabled unconditionally +// Copyright (C) 2018 Amal Hussein. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-atomics.notify +description: > + Throws a TypeError if typedArray arg is not an BigInt64Array +info: | + Atomics.notify( typedArray, index, count ) + + 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true). + ... + 5.If onlyInt32 is true, then + If typeName is not "BigInt64Array", throw a TypeError exception. +features: [Atomics, BigInt, TypedArray] +---*/ + +const i64a = new BigUint64Array( + new SharedArrayBuffer(BigUint64Array.BYTES_PER_ELEMENT * 8) +); + +const poisoned = { + valueOf: function() { + throw new Test262Error('should not evaluate this code'); + } +}; + +assert.throws(TypeError, function() { + Atomics.wait(i64a, 0, 0); +}, '`Atomics.wait(i64a, 0, 0)` throws TypeError'); + +assert.throws(TypeError, function() { + Atomics.wait(i64a, poisoned, poisoned); +}, '`Atomics.wait(i64a, poisoned, poisoned)` throws TypeError'); + +reportCompare(0, 0);