summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/prototype/includes/this-is-not-tuple.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/Tuple/prototype/includes/this-is-not-tuple.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/non262/Tuple/prototype/includes/this-is-not-tuple.js b/js/src/tests/non262/Tuple/prototype/includes/this-is-not-tuple.js
new file mode 100644
index 0000000000..00679f2a73
--- /dev/null
+++ b/js/src/tests/non262/Tuple/prototype/includes/this-is-not-tuple.js
@@ -0,0 +1,17 @@
+// |reftest| skip-if(!this.hasOwnProperty("Tuple"))
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Throws a TypeError exception when `this` cannot be coerced to Tuple
+---*/
+
+var includes = Tuple.prototype.includes;
+
+assertThrowsInstanceOf(() => includes.call(undefined, 42), TypeError,
+ "this is undefined");
+
+assertThrowsInstanceOf(() => includes.call(null, 42), TypeError,
+ "this is null");
+
+reportCompare(0, 0);