-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client Side Debugging #279
Conversation
@prashn64 how do we unit test these changes? |
@vybs one idea I just had was to set the logger to syncronous, run the code, and then we can look at the errorList's most recent element to see if it matches our expectation. This would likely be put in coreTests. |
@@ -16,24 +16,94 @@ function getGlobal(){ | |||
|
|||
(function(dust) { | |||
|
|||
if(!dust) { | |||
if(window.console && window.console.error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break in v8 and node where window is not defined.
in dustjs-helpers we just did:
/* make a safe version of console if it is not available
* currently supporting:
* _console.log
* */
var _console = (typeof console !== 'undefined')? console: {
log: function(){
/* a noop*/
}
};
Some feedback and questions:
|
|
var log = Logger.getLogger('dust');
log.info("This log instance only affects dust");
info = function(message) {
this.log('INFO', message);
},
debug = function(message) {
this.log('DEBUG', message);
},
log = function(level, message) {
// Do actual logging
} |
…ject passed to a dust.render callback with debug information
${SRC}/parser.js >> ${FULL_DEBUG} | ||
@@echo ${FULL_DEBUG} built | ||
|
||
node utils/debug_strip ${FULL_DEBUG} ${FULL} | ||
@@echo ${FULL} built | ||
|
||
min: dust | ||
@@echo minifying... | ||
@@echo "$$HEADER" > ${CORE_MIN} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something is redundant here. you're pushing CORE into CORE_MIN below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok, it's just minifying the core. What I did find is the HEADER has always been overwritten by the minifier, so I'm fixing that in the next commit.
…trailing newlines
Per discussions, this may be a bit premature. Revert "Merge pull request #279 from prashn64/master" until the api for debugging is more settled.
issue #137
Based on Jimmy's notes:
https://github.com/jimmyhchan/dustjs/blob/debugger/lib/dust.js