elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

generates invalid javascript for unicode characters in range \xd800..\xdbff #187

Closed robx closed 6 years ago

robx commented 6 years ago

Might well be related to #186, but this one is not a crash. It seems to affect the full range, though I didn't check all characters.

$ elm-repl --version
0.18.0

> "\xd800"
/s/elm-edn/repl-temp-000.js:3177
var _robx$elm_edn$Repl$d_e_l_t_r_o_n_3_0_3_0 = d_e_l_t_r_o_n_3_0_3_0 = '␧;
                                                                       ^^^

SyntaxError: Invalid or unexpected token
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
process-bot commented 6 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

robx commented 6 years ago

Similar problems with \x2028 and \x2029.

robx commented 6 years ago

duplicate of https://github.com/elm-lang/elm-compiler/issues/1623