浏览代码

Checks for Object.prototypeOf.

Herby Vojčík 6 年之前
父节点
当前提交
28bda92660
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      support/kernel-checks.js

+ 7 - 0
support/kernel-checks.js

@@ -15,6 +15,13 @@ define(function () {
     assert(function () {
         return !("hasOwnProperty" in Object.create(null));
     });
+    assert(function () {
+        return Object.getPrototypeOf(Object.create(null)) === null;
+    });
+    assert(function () {
+        var p = {};
+        return Object.getPrototypeOf(Object.create(p)) === p;
+    });
     assert(function () {
         return new Function("return this")().Object === Object;
     });