-
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
Back compatible compiler #420
Conversation
coreTests = require('./jasmine-test/spec/coreTests'), | ||
coreSetup = require('./core').coreSetup; | ||
|
||
//make dust a global |
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'm not sure how the changes in this file relate to this PR. Were these changes included intentionally?
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 was intentional change for 2.2.x branch. Unit tests with server.js were broken there. So fixing them as part of this commit as well. Now all of the unit tests pass (node test/server.js, node test/jasmine-test/server/specRunner.js and running jasmine client SpecRunner.html in a browser).
I've also added comments in server.js, so merging up to 2.3.x also shows up as few changes there.
I believe you need to go back to the 2.2.6 branch and generate the dist files. |
ok, makes sense to me. code looks good. |
Looks good to me. |
Make the compiler backwards compatible with runtime versions prior to 2.2.x
In Dust 2.2.0 we've introduced backward incompatible change to the compiler (using
Context.prototype._get
instead ofContext.prototype.get
andContext.prototype.getPath
)._get
method was added to Dust 2.2.0 runtime. With that change, templates compiled in 2.2.0 and newer can not be rendered with Dust runtimes prior to 2.2.0.This pull request makes sure that older Dust runtimes (before 2.2.0) can render templates compiled with Dust 2.2.6 and beyond and 2.3.4 and beyond.
I am switching compiler from
_get
toget
. This way older runtimes will use old implementation ofget
method. Newer runtimes will use new implementation ofget
method which calls_get
under the hood.Patching 2.2.x and 2.3.x versions