File: bigint-and-boolean.js

package info (click to toggle)
qt6-declarative 6.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 308,920 kB
  • sloc: cpp: 775,911; javascript: 514,247; xml: 10,855; python: 2,806; ansic: 2,253; java: 810; sh: 262; makefile: 41; php: 27
file content (33 lines) | stat: -rw-r--r-- 1,501 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (C) 2017 Josh Wolfe. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: Non-strict inequality comparison of BigInt and Boolean values
esid: sec-abstract-equality-comparison
info: |
  8. If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y.
  9. If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).
  ...
  12. If Type(x) is BigInt and Type(y) is Number, or if Type(x) is Number and Type(y) is BigInt,
    ...
    b. If the mathematical value of x is equal to the mathematical value of y, return true, otherwise return false.

features: [BigInt]
---*/

assert.sameValue(-1n != false, true, "-1n != false");
assert.sameValue(false != -1n, true, "false != -1n");
assert.sameValue(-1n != true, true, "-1n != true");
assert.sameValue(true != -1n, true, "true != -1n");
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, true, "true != 0n");
assert.sameValue(1n != false, true, "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(2n != false, true, "2n != false");
assert.sameValue(false != 2n, true, "false != 2n");
assert.sameValue(2n != true, true, "2n != true");
assert.sameValue(true != 2n, true, "true != 2n");