deep-equal
Advanced tools
+17
-2
@@ -40,4 +40,19 @@ var pSlice = Array.prototype.slice; | ||
| function isArguments(object) { | ||
| return Object.prototype.toString.call(object) == '[object Arguments]'; | ||
| var supportsArgumentsClass = (function(){ | ||
| return Object.prototype.toString.call(arguments) | ||
| }) == '[object Arguments]'; | ||
| if(supportsArgumentsClass) { | ||
| var isArguments = function(object) { | ||
| return Object.prototype.toString.call(object) == '[object Arguments]'; | ||
| } | ||
| } else { | ||
| var isArguments = function(object){ | ||
| return object && | ||
| typeof object == 'object' && | ||
| typeof object.length == 'number' && | ||
| Object.prototype.hasOwnProperty.call(object, 'callee') && | ||
| !Object.prototype.propertyIsEnumerable.call(object, 'callee') || | ||
| false; | ||
| } | ||
| } | ||
@@ -44,0 +59,0 @@ |
+1
-1
| { | ||
| "name" : "deep-equal", | ||
| "version" : "0.1.0", | ||
| "version" : "0.1.1", | ||
| "description" : "node's assert.deepEqual algorithm", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
+14
-0
@@ -33,1 +33,15 @@ var test = require('tape'); | ||
| }); | ||
| test('arguments class', function (t) { | ||
| t.deepEqual( | ||
| (function(){return arguments})(1,2,3), | ||
| (function(){return arguments})(1,2,3), | ||
| "compares arguments" | ||
| ) | ||
| t.notDeepEqual( | ||
| (function(){return arguments})(1,2,3), | ||
| [1,2,3], | ||
| "differenciates array and arguments" | ||
| ) | ||
| t.end(); | ||
| }); |
6677
13.61%145
22.88%