diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/non262/Tuple/isTuple/8.2.2.1.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/non262/Tuple/isTuple/8.2.2.1.js')
-rw-r--r-- | js/src/tests/non262/Tuple/isTuple/8.2.2.1.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/js/src/tests/non262/Tuple/isTuple/8.2.2.1.js b/js/src/tests/non262/Tuple/isTuple/8.2.2.1.js new file mode 100644 index 0000000000..9ac63ebc66 --- /dev/null +++ b/js/src/tests/non262/Tuple/isTuple/8.2.2.1.js @@ -0,0 +1,54 @@ +// |reftest| skip-if(!this.hasOwnProperty("Tuple")) +/* +8.2.2 +The Tuple constructor: +... +has the following properties: +... + +8.2.2.1 Tuple.isTuple ( arg ) +The isTuple function takes one argument arg, and performs the following steps: + +1. Return ! IsTuple(arg). +*/ + +var Tuple_isTuple = Tuple.isTuple; +assertEq(typeof Tuple_isTuple, "function"); + +assertEq(Tuple_isTuple(), false); +assertEq(Tuple_isTuple(Tuple.prototype), false); +assertEq(Tuple_isTuple([]), false); +assertEq(Tuple_isTuple(42), false); +assertEq(Tuple_isTuple(new Number(-50)), false); +assertEq(Tuple_isTuple(undefined), false); +assertEq(Tuple_isTuple(true), false); +assertEq(Tuple_isTuple(new Boolean(false)), false); +assertEq(Tuple_isTuple("hello"), false); +assertEq(Tuple_isTuple(new String("bye")), false); +assertEq(Tuple_isTuple({}), false); +assertEq(Tuple_isTuple(null), false); +assertEq(Tuple_isTuple(new RegExp()), false); +assertEq(Tuple_isTuple(JSON), false); +assertEq(Tuple_isTuple(Math), false); +assertEq(Tuple_isTuple(new Date()), false); +assertEq(Tuple_isTuple(new SyntaxError()), false); +var arg; +function fun() { arg = arguments; }(1, 2, 3); +assertEq(Tuple_isTuple(arg), false); +assertEq(Tuple_isTuple(this), false); +assertEq(Tuple_isTuple(function() {}), false); +var proto = Tuple.prototype; +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); +assertEq(Tuple_isTuple(child), false); +assertEq(Tuple_isTuple({0: 1, 1: 2, length: 2}), false); + +assertEq(Tuple_isTuple.call(1), false); +assertEq(Tuple_isTuple.call(#[1]), false); +assertEq(Tuple_isTuple.call(undefined, 1), false); +assertEq(Tuple_isTuple.call(undefined, undefined), false); +assertEq(Tuple_isTuple.call(undefined, #[1]), true); +assertEq(Tuple_isTuple.call(undefined, Object(#[1])), true); + +reportCompare(0, 0); |