| 1 |
// Copyright (C) 2017 Josh Wolfe. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
description: Unsigned right shift always throws for BigInt values |
| 6 |
esid: sec-numeric-types-bigint-unsignedRightShift |
| 7 |
info: | |
| 8 |
BigInt::unsignedRightShift (x, y) |
| 9 |
|
| 10 |
The abstract operation BigInt::unsignedRightShift with two arguments x and y of type BigInt: |
| 11 |
|
| 12 |
1. Throw a TypeError exception. |
| 13 |
|
| 14 |
features: [BigInt] |
| 15 |
---*/ |
| 16 |
|
| 17 |
assert.throws(TypeError, function() { 0n >>> 0n; }, "bigint >>> bigint throws a TypeError"); |
| 18 |
assert.throws(TypeError, function() { 5n >>> 1n; }, "bigint >>> bigint throws a TypeError"); |
| 19 |
assert.throws(TypeError, function() { 5n >>> 2n; }, "bigint >>> bigint throws a TypeError"); |
| 20 |
assert.throws(TypeError, function() { 5n >>> 3n; }, "bigint >>> bigint throws a TypeError"); |
| 21 |
assert.throws(TypeError, function() { 5n >>> -1n; }, "bigint >>> bigint throws a TypeError"); |
| 22 |
assert.throws(TypeError, function() { 5n >>> -2n; }, "bigint >>> bigint throws a TypeError"); |
| 23 |
assert.throws(TypeError, function() { 5n >>> -3n; }, "bigint >>> bigint throws a TypeError"); |
| 24 |
assert.throws(TypeError, function() { 0n >>> 128n; }, "bigint >>> bigint throws a TypeError"); |
| 25 |
assert.throws(TypeError, function() { 0n >>> -128n; }, "bigint >>> bigint throws a TypeError"); |
| 26 |
assert.throws(TypeError, function() { 582n >>> 0n; }, "bigint >>> bigint throws a TypeError"); |
| 27 |
assert.throws(TypeError, function() { 582n >>> 127n; }, "bigint >>> bigint throws a TypeError"); |
| 28 |
assert.throws(TypeError, function() { 582n >>> 128n; }, "bigint >>> bigint throws a TypeError"); |
| 29 |
assert.throws(TypeError, function() { 582n >>> 129n; }, "bigint >>> bigint throws a TypeError"); |
| 30 |
assert.throws(TypeError, function() { 582n >>> -128n; }, "bigint >>> bigint throws a TypeError"); |
| 31 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> 64n; }, "bigint >>> bigint throws a TypeError"); |
| 32 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> 32n; }, "bigint >>> bigint throws a TypeError"); |
| 33 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> 16n; }, "bigint >>> bigint throws a TypeError"); |
| 34 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> 0n; }, "bigint >>> bigint throws a TypeError"); |
| 35 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> -16n; }, "bigint >>> bigint throws a TypeError"); |
| 36 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> -32n; }, "bigint >>> bigint throws a TypeError"); |
| 37 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> -64n; }, "bigint >>> bigint throws a TypeError"); |
| 38 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> -127n; }, "bigint >>> bigint throws a TypeError"); |
| 39 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> -128n; }, "bigint >>> bigint throws a TypeError"); |
| 40 |
assert.throws(TypeError, function() { 405972677036361916727469983882855107238581880n >>> -129n; }, "bigint >>> bigint throws a TypeError"); |
| 41 |
assert.throws(TypeError, function() { -5n >>> 1n; }, "bigint >>> bigint throws a TypeError"); |
| 42 |
assert.throws(TypeError, function() { -5n >>> 2n; }, "bigint >>> bigint throws a TypeError"); |
| 43 |
assert.throws(TypeError, function() { -5n >>> 3n; }, "bigint >>> bigint throws a TypeError"); |
| 44 |
assert.throws(TypeError, function() { -5n >>> -1n; }, "bigint >>> bigint throws a TypeError"); |
| 45 |
assert.throws(TypeError, function() { -5n >>> -2n; }, "bigint >>> bigint throws a TypeError"); |
| 46 |
assert.throws(TypeError, function() { -5n >>> -3n; }, "bigint >>> bigint throws a TypeError"); |
| 47 |
assert.throws(TypeError, function() { -1n >>> 128n; }, "bigint >>> bigint throws a TypeError"); |
| 48 |
assert.throws(TypeError, function() { -1n >>> 0n; }, "bigint >>> bigint throws a TypeError"); |
| 49 |
assert.throws(TypeError, function() { -1n >>> -128n; }, "bigint >>> bigint throws a TypeError"); |
| 50 |
assert.throws(TypeError, function() { -582n >>> 0n; }, "bigint >>> bigint throws a TypeError"); |
| 51 |
assert.throws(TypeError, function() { -582n >>> 127n; }, "bigint >>> bigint throws a TypeError"); |
| 52 |
assert.throws(TypeError, function() { -582n >>> 128n; }, "bigint >>> bigint throws a TypeError"); |
| 53 |
assert.throws(TypeError, function() { -582n >>> 129n; }, "bigint >>> bigint throws a TypeError"); |
| 54 |
assert.throws(TypeError, function() { -582n >>> -128n; }, "bigint >>> bigint throws a TypeError"); |
| 55 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> 64n; }, "bigint >>> bigint throws a TypeError"); |
| 56 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> 32n; }, "bigint >>> bigint throws a TypeError"); |
| 57 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> 16n; }, "bigint >>> bigint throws a TypeError"); |
| 58 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> 0n; }, "bigint >>> bigint throws a TypeError"); |
| 59 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> -16n; }, "bigint >>> bigint throws a TypeError"); |
| 60 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> -32n; }, "bigint >>> bigint throws a TypeError"); |
| 61 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> -64n; }, "bigint >>> bigint throws a TypeError"); |
| 62 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> -127n; }, "bigint >>> bigint throws a TypeError"); |
| 63 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> -128n; }, "bigint >>> bigint throws a TypeError"); |
| 64 |
assert.throws(TypeError, function() { -405972677036361916727469983882855107238581880n >>> -129n; }, "bigint >>> bigint throws a TypeError"); |