Atomics: fix invalid index; print error

This commit is contained in:
Rick Waldron 2018-06-27 10:31:13 -04:00
parent be21156542
commit a1ff358a06
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ const poisoned = {
try { try {
$DETACHBUFFER(i32a.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null $DETACHBUFFER(i32a.buffer); // Detaching a non-shared ArrayBuffer sets the [[ArrayBufferData]] value to null
} catch (error) { } catch (error) {
$ERROR(`An unexpected error occurred when detaching ArrayBuffer: ${error.message}`); $ERROR(`An unexpected error occurred when detaching ArrayBuffer: ${error}`);
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -30,8 +30,8 @@ assert.throws(RangeError, function() {
Atomics.wake(i32a, Infinity, poisoned); Atomics.wake(i32a, Infinity, poisoned);
}, '`Atomics.wake(i32a, Infinity, poisoned)` throws RangeError'); }, '`Atomics.wake(i32a, Infinity, poisoned)` throws RangeError');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, 2, poisoned); Atomics.wake(i32a, 4, poisoned);
}, '`Atomics.wake(i32a, 2, poisoned)` throws RangeError'); }, '`Atomics.wake(i32a, 4, poisoned)` throws RangeError');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
Atomics.wake(i32a, 200, poisoned); Atomics.wake(i32a, 200, poisoned);
}, '`Atomics.wake(i32a, 200, poisoned)` throws RangeError'); }, '`Atomics.wake(i32a, 200, poisoned)` throws RangeError');