Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Allow objects with no prototype to tested against object literals.
authorDomenicDenicola <domenic@domenicdenicola.com>
Tue, 1 Nov 2011 22:49:49 +0000 (18:49 -0400)
committerDomenicDenicola <domenic@domenicdenicola.com>
Tue, 1 Nov 2011 22:49:49 +0000 (18:49 -0400)
commit6f9ff2f49ac6ba001f96bbe83336b0b5b83724f8
tree4815262f09e29c608bc4ce8f5a377fc791618371
parentee156923cdb01820e35e6bb579d5cf6bf55736d4
Allow objects with no prototype to tested against object literals.

I often use objects created with `Object.create(null)` as dictionaries, since then they don't have pre-filled dictionary entries for e.g. `constructor`, `hasOwnProperty`, `isPrototypeOf`, etc. However, in my tests, it is quite useful to test the dictionaries I create against object literals (which have `Object.prototype` as their prototype).

This patch makes an exemption to the rule that two objects must have the same constructor, for the case where one has `null` prototype and the other `Object.prototype` as its prototype.
qunit/qunit.js
test/same.js

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