Open mitchellwills opened 7 years ago
cc @Dominator008
FYI the running that code directly in Chrome 60 works as expected and the Typescript 2.3 ES5 transpile works as well
Looks like cookString may just need another case https://github.com/google/closure-compiler/blob/a4cb49131c9db49227f188f9ee25d418f82e3bd3/src/com/google/javascript/jscomp/Es6TemplateLiterals.java#L150
Might be worth revisiting to see if anything else is missing there
Using a tagged template literal with an escaped backslash causes both backslashes to be passed to the template function, instead of just the single backslash. The raw property contains both backslashes as expected.
For example
However, other escape sequences work as expected
https://closure-compiler-debugger.appspot.com/#input0%3Dfunction%2520test(...args)%2520%257B%250A%2520%2520console.log(args)%253B%250A%257D%250A%250Atest%2560%255C%255C.%2560%250Atest%2560%255Cn.%2560%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26MISSING_PROPERTIES%3D1%26TRANSPILE%3D1%26CHECK_TYPES%3D1%26CLOSURE_PASS%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1