Skip to content

Instantly share code, notes, and snippets.

@brendandahl
Created August 16, 2012 22:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendandahl/3373993 to your computer and use it in GitHub Desktop.
Save brendandahl/3373993 to your computer and use it in GitHub Desktop.
Check Messages Between Web Workers
var path = [];
function check(obj) {
if (typeof obj === 'object') {
for (key in obj) {
if (!obj.hasOwnProperty)
continue;
if (!obj.hasOwnProperty(key))
continue;
var nextObj = obj[key];
if (nextObj instanceof Dict || nextObj instanceof XRef) {
console.log('Bad object key: ' + key);
console.log('Bad object path: ' + path);
debugger;
error('Found object ' + nextObj);
}
path.push(key);
check(obj[key]);
path.pop();
}
}
}
check(obj);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment