Created
August 16, 2012 22:00
-
-
Save brendandahl/3373993 to your computer and use it in GitHub Desktop.
Check Messages Between Web Workers
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
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