Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Code review of "Allow objects with no prototype to be tested against object literals."
authorPhilippe Rathé <prathe@gmail.com>
Sat, 5 Nov 2011 22:41:24 +0000 (18:41 -0400)
committerPhilippe Rathé <prathe@gmail.com>
Sat, 5 Nov 2011 22:41:24 +0000 (18:41 -0400)
test/same.js

index 3783275..3df073c 100644 (file)
@@ -139,13 +139,13 @@ test("Objects Basics.", function() {
 
     // Objects with no prototype, created via Object.create(null), are used e.g. as dictionaries.
     // Being able to test equivalence against object literals is quite useful.
-    if (Object.create) {
-        equals(QUnit.equiv(Object.create(null), {}), true, "empty object with no prototype VS empty object");
+    if (typeof Object.create === 'function') {
+        equals(QUnit.equiv(Object.create(null), {}), true, "empty object without prototype VS empty object");
 
         var nonEmptyWithNoProto = Object.create(null);
         nonEmptyWithNoProto.foo = "bar";
 
-        equals(QUnit.equiv(nonEmptyWithNoProto, { foo: "bar" }), true, "nonempty object with no prototype VS empty object");
+        equals(QUnit.equiv(nonEmptyWithNoProto, { foo: "bar" }), true, "object without prototype VS object");
     }
 });
 

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf