Commit 3108244
authored
Fix stack trace (#4428)
* Revert aee27fb
* Patch Jison’s output so that it requires `fs` only if we’re truly in a CommonJS/Node environment, not a browser environment that may happen to have globals named `require` and `exports` (as would be the case if require.js is being used). Fixes #4391.
* Temporary fix for exceptions getting thrown when trying to generate a stack trace for a file that has been deleted since compilation; fixes #3890, but not well. A better solution would not try to recompile the file when trying to retrieve its stack trace.
* Save the test REPL history in the system temp folder, not in the CoffeeScript project folder
* Rewrite `getSourceMap` to never read a file from disk, and therefore not throw IO-related exceptions; source maps are either retrieved from memory, or the related source code is retrieved from memory to generate a new source map. Fixes #3890 the proper way.
* Add test to verify that stack traces reference the correct line number. Closes #4418.
* Get the parser working in the browser compiler again; rather than detecting a CommonJS environment generally, just check for `fs` before trying to use it
* Follow Node’s standard of 4-space indentation of stack trace data
* Better .gitignore
* Fix caching of compiled code and source maps; add more tests to verify correct line numbers in stack traces
* Better fallback value for the parser source
* Fix the stack traces and tests when running in a browser
* Update the browser compiler so that @murrayju doesn’t have any extra work to do to test this branch1 parent d0ed2de commit 3108244
File tree
9 files changed
+733
-369
lines changed- docs/v1
- browser-compiler
- lib/coffee-script
- src
- test
9 files changed
+733
-369
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | | - | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | | - | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2882 | 2882 | | |
2883 | 2883 | | |
2884 | 2884 | | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
2885 | 2895 | | |
2886 | 2896 | | |
2887 | 2897 | | |
| |||
3470 | 3480 | | |
3471 | 3481 | | |
3472 | 3482 | | |
| 3483 | + | |
3473 | 3484 | | |
3474 | 3485 | | |
3475 | 3486 | | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
3476 | 3498 | | |
3477 | 3499 | | |
3478 | 3500 | | |
| |||
3490 | 3512 | | |
3491 | 3513 | | |
3492 | 3514 | | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
3493 | 3566 | | |
3494 | 3567 | | |
3495 | 3568 | | |
| |||
3844 | 3917 | | |
3845 | 3918 | | |
3846 | 3919 | | |
3847 | | - | |
| 3920 | + | |
3848 | 3921 | | |
3849 | 3922 | | |
3850 | 3923 | | |
| |||
4596 | 4669 | | |
4597 | 4670 | | |
4598 | 4671 | | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
4599 | 4679 | | |
4600 | 4680 | | |
4601 | 4681 | | |
| |||
9227 | 9307 | | |
9228 | 9308 | | |
9229 | 9309 | | |
9230 | | - | |
| 9310 | + | |
9231 | 9311 | | |
9232 | 9312 | | |
9233 | 9313 | | |
| |||
9823 | 9903 | | |
9824 | 9904 | | |
9825 | 9905 | | |
| 9906 | + | |
9826 | 9907 | | |
| 9908 | + | |
9827 | 9909 | | |
9828 | 9910 | | |
9829 | 9911 | | |
| |||
9851 | 9933 | | |
9852 | 9934 | | |
9853 | 9935 | | |
9854 | | - | |
| 9936 | + | |
9855 | 9937 | | |
9856 | 9938 | | |
9857 | 9939 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments