浏览代码

kernel: Promise existence checks.

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

+ 13 - 0
support/kernel-checks.js

@@ -46,4 +46,17 @@ define(function () {
                 return this;
             }).apply(true) === true;
     });
+    assert(function () {
+        return typeof Promise === "function";
+    });
+    assert(function () {
+        return typeof Promise.resolve === "function";
+    });
+    assert(function () {
+        return typeof Promise.reject === "function";
+    });
+    assert(function () {
+        return typeof new Promise(function () {
+            }).then === "function";
+    });
 });