Removed more code that supported browsers we no longer run on
This commit is contained in:
@@ -2577,18 +2577,6 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
this.sample = sample;
|
||||
}
|
||||
|
||||
function getPrototype(obj) {
|
||||
if (Object.getPrototypeOf) {
|
||||
return Object.getPrototypeOf(obj);
|
||||
}
|
||||
|
||||
if (obj.constructor.prototype == obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return obj.constructor.prototype;
|
||||
}
|
||||
|
||||
function hasProperty(obj, property) {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
@@ -2598,7 +2586,7 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return hasProperty(getPrototype(obj), property);
|
||||
return hasProperty(Object.getPrototypeOf(obj), property);
|
||||
}
|
||||
|
||||
ObjectContaining.prototype.asymmetricMatch = function(other, matchersUtil) {
|
||||
|
||||
@@ -268,15 +268,13 @@ describe('PrettyPrinter', function() {
|
||||
});
|
||||
|
||||
it('should stringify immutable circular objects', function() {
|
||||
if (Object.freeze) {
|
||||
var pp = jasmineUnderTest.makePrettyPrinter();
|
||||
var frozenObject = { foo: { bar: 'baz' } };
|
||||
frozenObject.circular = frozenObject;
|
||||
frozenObject = Object.freeze(frozenObject);
|
||||
expect(pp(frozenObject)).toEqual(
|
||||
"Object({ foo: Object({ bar: 'baz' }), circular: <circular reference: Object> })"
|
||||
);
|
||||
}
|
||||
var pp = jasmineUnderTest.makePrettyPrinter();
|
||||
var frozenObject = { foo: { bar: 'baz' } };
|
||||
frozenObject.circular = frozenObject;
|
||||
frozenObject = Object.freeze(frozenObject);
|
||||
expect(pp(frozenObject)).toEqual(
|
||||
"Object({ foo: Object({ bar: 'baz' }), circular: <circular reference: Object> })"
|
||||
);
|
||||
});
|
||||
|
||||
it('should stringify RegExp objects properly', function() {
|
||||
|
||||
@@ -110,16 +110,7 @@ describe('ObjectContaining', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||
|
||||
var prototypeObject = { foo: 'fooVal' };
|
||||
var obj;
|
||||
|
||||
if (Object.create) {
|
||||
obj = Object.create(prototypeObject);
|
||||
} else {
|
||||
function Foo() {}
|
||||
Foo.prototype = prototypeObject;
|
||||
Foo.prototype.constructor = Foo;
|
||||
obj = new Foo();
|
||||
}
|
||||
var obj = Object.create(prototypeObject);
|
||||
|
||||
expect(containing.asymmetricMatch(obj, matchersUtil)).toBe(true);
|
||||
});
|
||||
|
||||
@@ -3,18 +3,6 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
this.sample = sample;
|
||||
}
|
||||
|
||||
function getPrototype(obj) {
|
||||
if (Object.getPrototypeOf) {
|
||||
return Object.getPrototypeOf(obj);
|
||||
}
|
||||
|
||||
if (obj.constructor.prototype == obj) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return obj.constructor.prototype;
|
||||
}
|
||||
|
||||
function hasProperty(obj, property) {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
@@ -24,7 +12,7 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return hasProperty(getPrototype(obj), property);
|
||||
return hasProperty(Object.getPrototypeOf(obj), property);
|
||||
}
|
||||
|
||||
ObjectContaining.prototype.asymmetricMatch = function(other, matchersUtil) {
|
||||
|
||||
Reference in New Issue
Block a user