Last active
December 26, 2015 08:19
-
-
Save while0pass/7121603 to your computer and use it in GitHub Desktop.
Find circular references in an object to be json-strinified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZZZ = document.createElement('script'); | |
ZZZ.src = '//yandex.st/dojo/1.9.1/dojo/dojo.js'; | |
document.body.appendChild(ZZZ); | |
// In firebug one can use ``include`` command instead: | |
// include('//yandex.st/dojo/1.9.1/dojo/dojo.js'); | |
require(["dojox/json/ref"], function(){ | |
window.ZZZ = dojox.json.ref.toJson(ko.toJS(objectWithCircularReferences)); | |
}); | |
// Then one can look for "$ref" substring in global ZZZ variable that would | |
// locate circular references. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment