liujianguang / embeddedjavascript

Automatically exported from code.google.com/p/embeddedjavascript
Other
0 stars 0 forks source link

EJS transforms primitive values into objects #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
render : function(object, extra_helpers){
        object = object || {}
        this._extra_helpers = extra_helpers;
        var v = new EJS.Helpers(object, extra_helpers || {});
        return this.template.process.call(object, object,v);
    },

this should be:
render : function(object, extra_helpers){
        object = typeof object == "undefined" ? {} : object;
        this._extra_helpers = extra_helpers;
        var v = new EJS.Helpers(object, extra_helpers || {});
        return this.template.process.call(object, object,v);
    },

otherwise if object is 0 it will make a {} out of it

Original issue reported on code.google.com by mendri...@gmail.com on 23 May 2013 at 12:32