Skip to content

Update function with differend templates #21

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Call (new EJS(options)).update(element) twice with differend templates and 
elements

What is the expected output? What do you see instead?
Expected different functions that updates only template which has been called 
by. Instead of this all functions try to update last template which has call 
update function.

What version of the product are you using? On what operating system?
1.0 Window 7 x86 Chrome  20

Please provide any additional information below.
I think problem with closure. Variable _template replaced by 'this' value of 
last object that call function update;
Fix (lines 102-105):

return (function(_template){
    return function(object){
        EJS.prototype.update.call(_template, element, object);
    };
}(this));

Original issue reported on code.google.com by OzOn1...@gmail.com on 17 Apr 2012 at 12:26

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions