Merge branch 'rohit-equals-null-protoObjects'

This commit is contained in:
slackersoft
2014-12-20 16:48:01 -08:00
2 changed files with 25 additions and 1 deletions

View File

@@ -250,6 +250,30 @@ describe("matchersUtil", function() {
expect(j$.matchersUtil.equals(any1, any2)).toBe(true);
});
it("passes for null prototype objects with same properties", function () {
if (jasmine.getEnv().ieVersion < 9) { return; }
var objA = Object.create(null),
objB = Object.create(null);
objA.name = 'test';
objB.name = 'test';
expect(j$.matchersUtil.equals(objA, objB)).toBe(true);
});
it("fails for null prototype objects with different properties", function () {
if (jasmine.getEnv().ieVersion < 9) { return; }
var objA = Object.create(null),
objB = Object.create(null);
objA.name = 'test';
objB.test = 'name';
expect(j$.matchersUtil.equals(objA, objB)).toBe(false);
});
});
describe("contains", function() {

View File

@@ -197,7 +197,7 @@ getJasmineRequireObj().matchersUtil = function(j$) {
return result;
function has(obj, key) {
return obj.hasOwnProperty(key);
return Object.prototype.hasOwnProperty.call(obj, key);
}
function isFunction(obj) {