-
Notifications
You must be signed in to change notification settings - Fork 478
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
using dust.isArray in place of Array.isArray #241
Conversation
@jairodemorais, you sure know much better your way around this code than me. =:o) Sorry for the delay but had to test it at the office, where I had Internet Explorer and the original use case. It worked with no problems. I will now try closing my (#235) pull request (if I can) since this is a better replacement. |
@paulogaspar7 thanks for testing it. ASA my partners approve the change I will merge it. |
Cool, thanks man! |
@@ -1,4 +1,4 @@ | |||
(function(dust) { | |||
var comp = (function(dust) { |
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.
what does this variable "comp" mean? , why not use a more descriptive name, if it refers to the compiler version
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.
The compiler function was executed immediately when you require ./compiler. this function receive the dust object as param. In the browser case, the dust object is obtained with the getGlobal function but in nodejs we don't have access to the dust object. So I have assigned the compiler function to a variable, comp, and if dust is being executed from browser I call it but if dust is being executed in node, I return the function, so the server can call it with the dust object.
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.
do you prefer calling it compiler? I can change it easily.
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.
one more q: is this only relevant to node? or anything that works with server side?
I assume that latter?
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 is just for node, because the server file is just included when exports and process are different from "undefined"
if (typeof exports !== "undefined") {
if (typeof process !== "undefined") {
require('./server')(dust);
}
module.exports = dust;
}
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.
why woud not it apply for rhino or nashhorn?
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.
Because Exports is undefined in Rhino.
I don't know in Nashorn.
I didn't know that we were maintaining dust compatible with it.
using dust.isArray in place of Array.isArray
can we rename it to dustCompiler instead of comp? |
yes let me do it now. |
I send a new PR with the name change. |
No description provided.