summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/undefined-this-and-primitive-arg-returns-false.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/undefined-this-and-primitive-arg-returns-false.js')
-rw-r--r--js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/undefined-this-and-primitive-arg-returns-false.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/undefined-this-and-primitive-arg-returns-false.js b/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/undefined-this-and-primitive-arg-returns-false.js
new file mode 100644
index 0000000000..fea05bce50
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/undefined-this-and-primitive-arg-returns-false.js
@@ -0,0 +1,25 @@
+// Copyright (C) 2019 Alexey Shvayka. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.prototype.isprototypeof
+description: >
+ The ordering of steps 1 and 2 preserves the behaviour specified by previous
+ editions of this specification for the case where V is not an object and
+ the this value is undefined or null.
+info: |
+ Object.prototype.isPrototypeOf ( V )
+
+ 1. If Type(V) is not Object, return false.
+ 2. Let O be ? ToObject(this value).
+features: [Symbol]
+---*/
+
+assert.sameValue(Object.prototype.isPrototypeOf.call(undefined, undefined), false);
+assert.sameValue(Object.prototype.isPrototypeOf.call(undefined, null), false);
+assert.sameValue(Object.prototype.isPrototypeOf.call(undefined, true), false);
+assert.sameValue(Object.prototype.isPrototypeOf.call(undefined, "str"), false);
+assert.sameValue(Object.prototype.isPrototypeOf.call(undefined, Symbol("desc")), false);
+assert.sameValue(Object.prototype.isPrototypeOf.call(undefined, 3.14), false);
+
+reportCompare(0, 0);