Skip to content

Commit

Permalink
Fix build in IE8 (IE8 doesn't support Object.freeze)
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Cobb and Luan Santos committed Mar 12, 2014
1 parent 33e4f5e commit 311263a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/core/PrettyPrintSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ describe("j$.pp", function () {
});

it("should stringify immutable circular objects", function(){
var frozenObject = {foo: {bar: 'baz'}};
frozenObject.circular = frozenObject;
frozenObject = Object.freeze(frozenObject);
expect(j$.pp(frozenObject)).toEqual("{ foo: { bar: 'baz' }, circular: <circular reference: Object> }");
if(Object.freeze){
var frozenObject = {foo: {bar: 'baz'}};
frozenObject.circular = frozenObject;
frozenObject = Object.freeze(frozenObject);
expect(j$.pp(frozenObject)).toEqual("{ foo: { bar: 'baz' }, circular: <circular reference: Object> }");
}
});

it("should truncate arrays that are longer than j$.MAX_PRETTY_PRINT_ARRAY_LENGTH", function() {
Expand Down

0 comments on commit 311263a

Please sign in to comment.