summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/hasOwn/toobject_undefined.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/test262/built-ins/Object/hasOwn/toobject_undefined.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/hasOwn/toobject_undefined.js b/js/src/tests/test262/built-ins/Object/hasOwn/toobject_undefined.js
new file mode 100644
index 0000000000..070ba2d6af
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Object/hasOwn/toobject_undefined.js
@@ -0,0 +1,17 @@
+// Copyright 2021 Jamie Kyle. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+ Let O be the result of calling ToObject passing the this value as
+ the argument.
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+assert.throws(TypeError, function() {
+ Object.hasOwn(undefined, 'foo');
+});
+
+reportCompare(0, 0);