Skip to content

Commit

Permalink
Add an assertion that the error is thrown.
Browse files Browse the repository at this point in the history
Filed #331 to track the Opera 11.6 failure.
  • Loading branch information
ljharb committed Apr 11, 2015
1 parent 0ed3476 commit 8342927
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,13 @@ describe('Object', function () {
});

ifExtensionsPreventable('does not have pending exceptions', function () {
'use strict';
// Firefox 37 still has "pending exception" logic in its Object.assign implementation,
// which is 72% slower than our shim, and Firefox 40's native implementation.
var thrower = Object.preventExtensions({ 1: 2 });
try { Object.assign(thrower, 'xy'); } catch (e) {}
var error;
try { Object.assign(thrower, 'xy'); } catch (e) { error = e; }
expect(error).to.be.an.instanceOf(TypeError);
expect(thrower).to.have.property(1, 2);
});
});
Expand Down

0 comments on commit 8342927

Please sign in to comment.