Skip to content
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

remove the globals and isolate parser and compiler #382

Merged
merged 5 commits into from
Dec 24, 2013

Conversation

jimmyhchan
Copy link
Contributor

A bunch of cleanup. The jshint fixes revealed there are a bunch of globals

  • put parser before compiler
  • isolate parser compiler
  • remove getGlobal
    etc.

if (typeof exports === 'object') {
module.exports = factory(require('./parser').parse, require('./dust'));
} else {
var compiler = factory(root.dust.parse, root.dust);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like var compiler is local variable not used anywhere. Do we need to define it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. good catch. It meant it as a self documenting thing to show that if we require('./lib/compiler') in Node (line 4) we decorate the dust object as well as module.exports a compiler object. This is similar on the browser. When we include the lib/compiler file we are decorating the dust object with compiler methods but then we throwout the compiler reference.

There's some symmetry that helped me try to clean up the dependency soup here but it is not necessary... though I find it hard to get rid of it

@kate2753
Copy link
Contributor

Looks good to me as long as this still works in Rhino.

Right now all of the unit tests run in node, we also have client side testing. But as far as I know no Rhino testing. Maybe we could set up some testing in Rhino as well (not as part of this PR but perhaps as a separate issue).

kate2753 added a commit that referenced this pull request Dec 24, 2013
remove the globals and isolate parser and compiler
@kate2753 kate2753 merged commit f373e75 into linkedin:master Dec 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants