Legacy browser compiler does not compile
scanline opened this issue · 1 comments
scanline commented
After digging through the source of CoffeeScript's online playground at https://coffeescript.org/#try
I realized it does nothing more than:
- importing https://coffeescript.org/browser-compiler-legacy/coffeescript.js
- loading the content of CodeMirror into the variable
coffee - finally invoking the compiler like
js = CoffeeScript.compile(coffee, { bare: !0, inlineMap: !0 })
If I try to replicate this in it's most simplest form e.g.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://coffeescript.org/browser-compiler-legacy/coffeescript.js"></script>
<script type="text/javascript">
let coffee = "alert 'Hello CoffeeScript!'"
let js = CoffeeScript.compile(coffee, {
bare: !0,
inlineMap: !0
});
</script>
</head>
</html>
I just get an error in the console saying:
Uncaught TypeError: child.updateLocationDataIfMissing is not a function
GeoffreyBooth commented
I can’t reproduce your error.
Note that your code doesn’t do anything. If you want the compiled CoffeeScript to run, add eval(js) or use CoffeeScript.run.