You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rendering a compiled template with an array of custom class instances, this line butchers the input class instance replacing it with a plain object with all custom class behaviour (getters, setters, methods etc) removed. This breaks my app.
Please remove all destructive use of Util.extends() on the input data - leave the input data as it is.
Some pseudocode to illustrate my case. Please let me know if you need anything else.
classCar{wheels=[]maxSpeedcolourconstructor(data){this.maxSpeed=data.maxSpeedthis.colour=data.colour}hasFourWheels(){}}constcars=[newCar({maxSpeed: 40,colour: 'silver'}),newCar({maxSpeed: 30,colour: 'white'})]handlebars.registerHelper({customHelper: function(){/* Fails as the input data is no longer a `Car` instance */if(this.hasFourWheels()){// do something}}})/* myTemplate includes use of the `customHelper` helper. */constcompiled=handlebars.compile(myTemplate)/* throws an error */compiled(cars)
The text was updated successfully, but these errors were encountered:
When rendering a compiled template with an array of custom class instances, this line butchers the input class instance replacing it with a plain object with all custom class behaviour (getters, setters, methods etc) removed. This breaks my app.
Please remove all destructive use of
Util.extends()
on the input data - leave the input data as it is.Some pseudocode to illustrate my case. Please let me know if you need anything else.
The text was updated successfully, but these errors were encountered: