Skip to content

Instantly share code, notes, and snippets.

@tj
Created January 4, 2011 22:33
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tj/765580 to your computer and use it in GitHub Desktop.
Save tj/765580 to your computer and use it in GitHub Desktop.
require.registerExtension('.js', function(js){
return js.replace(/^ *\/\/debug: */gm, '');
});
if (options.debug) require('./debug');
while (iAmParsingStuff) {
//debug: console.log('state -> %s', this.state)
}
@tj
Copy link
Author

tj commented Jan 6, 2011

nah, it only has an effect when required so it doesnt really matter, and it would only affect the initial boot

@tj
Copy link
Author

tj commented Jan 6, 2011

oh, you meant the extra function calls? it depends. writing a streaming parser an extra function call or two could add up quite a bit if you parse 50kb, that could be 50k calls that you dont want :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment