summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/values/this-val-non-obj-coercible.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/values/this-val-non-obj-coercible.js')
-rw-r--r--js/src/tests/test262/built-ins/Array/prototype/values/this-val-non-obj-coercible.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/values/this-val-non-obj-coercible.js b/js/src/tests/test262/built-ins/Array/prototype/values/this-val-non-obj-coercible.js
new file mode 100644
index 0000000000..843a6274ba
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Array/prototype/values/this-val-non-obj-coercible.js
@@ -0,0 +1,20 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-array.prototype.values
+description: >
+ `this` value not object coercible
+info: |
+ 1. Let O be ToObject(this value).
+ 2. ReturnIfAbrupt(O).
+---*/
+
+assert.throws(TypeError, function() {
+ Array.prototype.values.call(undefined);
+});
+
+assert.throws(TypeError, function() {
+ Array.prototype.values.call(null);
+});
+
+reportCompare(0, 0);