Skip to content

Fix for Dust path evaluation when used with Express 2.5.9 #8

Closed
wants to merge 1 commit into from

3 participants

@totherik

It may be broken in earlier versions, too, but in Express 2.5.9 res.locals isn't an object reference, but instead a getter. The action of pushing the getter method onto the context created a subtle bug where standard replacements worked, but paths did not. e.g. {foo} works, {foo.bar} fails.

The suggested fix should be backward compatible.

@totherik totherik It appears that the implementation of res.locals changed in express a…
…nd in newer versions it now refers to a getter method as opposed to a reference to the locals object. This error (pushing the getter function onto the context) prevented dust paths from being evaluated correctly, e.g. {foo} worked, but {foo.bar} did not.
478d1da
@davglass
Owner

@swider You want to look at merging this in or do you want me to close it?

@swider
swider commented May 30, 2012

This should get fixed, but I don't think this is the best way - go ahead and close it.

@davglass davglass closed this May 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.