diff --git a/spec/core/PrettyPrintSpec.js b/spec/core/PrettyPrintSpec.js index f9734dd9..fba38473 100644 --- a/spec/core/PrettyPrintSpec.js +++ b/spec/core/PrettyPrintSpec.js @@ -26,6 +26,11 @@ describe("j$.pp", function () { expect(j$.pp(array1)).toEqual("[ 1, 2, [ ] ]"); }); + it("should not indicate circular references incorrectly", function() { + var array = [ [1] ]; + expect(j$.pp(array)).toEqual("[ [ 1 ] ]"); + }); + it("should stringify objects properly", function() { expect(j$.pp({foo: 'bar'})).toEqual("{ foo: 'bar' }"); expect(j$.pp({foo:'bar', baz:3, nullValue: null, undefinedValue: jasmine.undefined})).toEqual("{ foo: 'bar', baz: 3, nullValue: null, undefinedValue: undefined }"); diff --git a/src/core/util.js b/src/core/util.js index fa9ef13a..141891aa 100644 --- a/src/core/util.js +++ b/src/core/util.js @@ -33,7 +33,7 @@ getJasmineRequireObj().util = function() { util.arrayContains = function(array, search) { var i = array.length; while (i--) { - if (array[i] == search) { + if (array[i] === search) { return true; } }