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

This commit is contained in:
Greg Cobb and Luan Santos
2014-03-12 13:45:46 -07:00
parent 33e4f5efbe
commit 311263a3df

View File

@@ -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() {