Commit 3bf5615
committed
use return 0,<exp> to try to deal with comments.
The problem is JavaScript's idiotic automatic semicolon insertion.
If you have an expression like
```js
return
2
```
That's just returns undefined. So, if the user enters
```
// hello
t
```
That gets converted to
```js
return // hello
t
```
We used to try to strip linefeeds and comments and it mostly worked
but the comment stripper was simple because who the F wants to write
a whole effing parser just to strip comments.
As a try, if we change the generated code to
```js
return 0,// hello
t
```
The automatic semicolon insertion doesn't happen and it correctly
returns t.1 parent d99fde3 commit 3bf5615
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
0 commit comments