Skip to content

Instantly share code, notes, and snippets.

@while0pass
Last active December 26, 2015 08:19
Show Gist options
  • Save while0pass/7121603 to your computer and use it in GitHub Desktop.
Save while0pass/7121603 to your computer and use it in GitHub Desktop.
Find circular references in an object to be json-strinified.
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