Permalink
Browse files

Fix build in IE8 (IE8 doesn't support Object.freeze)

  • Loading branch information...
1 parent 33e4f5e commit 311263a3dfb277117f5d811044d35ce35c38772e Greg Cobb and Luan Santos committed Mar 12, 2014
Showing with 6 additions and 4 deletions.
  1. +6 −4 spec/core/PrettyPrintSpec.js
@@ -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() {

0 comments on commit 311263a

Please sign in to comment.