On Oct 28, 2014, at 4:39 PM, Antony Courtney <[email protected]> wrote:
> Thanks for the quick reply. > > My impression from reading the draft spec and looking at slide 28 of > Domenic's excellent presentation > ( http://www.slideshare.net/domenicdenicola/es6-the-awesome-parts ) > > is that with your example: > … > safe_html `<${x}>hello, ${u}</${x}>` > if this were run in a context where x is 'strong', and u is 'world', then > what would be equivalent to calling: > > safe_html( > { raw: ['<', '>hello, ', '<', '>'], > cooked: ['<', '>hello, ', '<', '>'] > }, > 'strong', > 'world', > 'strong' > ); This isn’t quite right. It should be: safe_html( Object.freeze(Object.defineOwnProperty(['<', '>hello, ', '<', '>’], ‘raw’, {value: ['<', '>hello, ', '<', '>’]}), 'strong', 'world', 'strong' ); See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-gettemplatecallsite This above example still isn’t perfect because it does not canonicalize the call site object. Allen
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

