Rick Waldron wrote:
Per Anthony's OP:

"My particular application is that I want to use a template system to construct SQL queries in a modular way. For this particular application I want programmatic control over when and how the expansion happens and won't have the escaped template expressions in scope at the point where the template string literal appears. "


Which cannot be solved in the way you've suggested, as the program won't have any kind of static knowledge of the template form itself.

Right. This is why we see `with` (and direct `eval`) still used for template processing. An alternative would generate a function taking formal parameters named by the dictionary's properties, and calling it with the corresponding values in the same order (Object.getOwnPropertyNames). Fun!

/be

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to