can-reflect
Advanced tools
Comparing version 1.0.0-pre.1 to 1.0.0-pre.2
{ | ||
"name": "can-reflect", | ||
"version": "1.0.0-pre.1", | ||
"version": "1.0.0-pre.2", | ||
"description": "reflection on unknown data types", | ||
@@ -5,0 +5,0 @@ "homepage": "http://canjs.com", |
@@ -109,1 +109,7 @@ var QUnit = require('steal-qunit'); | ||
}); | ||
QUnit.test("isPromise", function() { | ||
QUnit.ok(!typeReflections.isPromise({}), "Object is not a promise"); | ||
QUnit.ok(!typeReflections.isPromise({ catch: function(){}, then: function(){} }), "function with then and catch is not a Promise"); | ||
QUnit.ok(typeReflections.isPromise( new Promise(function(){})), "a new Promise() is a Promise"); | ||
}); |
@@ -159,3 +159,6 @@ var canSymbol = require("can-symbol"); | ||
obj.next.length === 0; | ||
}, | ||
isPromise: function(obj){ | ||
return (obj instanceof Promise || (Object.prototype.toString.call(obj) === '[object Promise]')); | ||
} | ||
}; |
40712
998