With the current proposal it is not possible to get the raw string,
including the place holders and everything.

One possible use case: It is often common to want to have the textual
content of an expression to provide better output for unit testing.
Today, this is often done using global evals which requires global
variables everywhere.

For example we could add an expressions property to the parameter.

test`a $b c ${d} e`

could be desugared t to something like:

const unguessableCallSiteId1234 = Object.freeze({
  raw: Object.freeze(["a ", " c ", " e"]),
  cooked: Object.freeze(["a ", " c ", " e"]),
  expressions: Object.freeze(["$b", "${d}"])
});

test(unguessableCallSiteId1234)

-- 
erik
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to