diff --git a/spec/core/matchers/toBeInstanceOfSpec.js b/spec/core/matchers/toBeInstanceOfSpec.js index 61cb5374..d31845e9 100644 --- a/spec/core/matchers/toBeInstanceOfSpec.js +++ b/spec/core/matchers/toBeInstanceOfSpec.js @@ -1,9 +1,4 @@ describe('toBeInstanceOf', function() { - function setPrototypeOf(object, proto) { - // Support older environments - Object.setPrototypeOf ? Object.setPrototypeOf(object, proto) : object.__proto__ = proto; - } - describe('when expecting Number', function() { it('passes for literal number', function() { var matcher = jasmineUnderTest.matchers.toBeInstanceOf(); @@ -159,8 +154,7 @@ describe('toBeInstanceOf', function() { }); it('passes for objects with no constructor', function() { - var object = {}; - setPrototypeOf(object, null); + var object = Object.create(null); var matcher = jasmineUnderTest.matchers.toBeInstanceOf(); var result = matcher.compare(object, Object);