Michael Klement
ae4535d639
Fix: support for consumers of the REPL *module* being able to opt into using the global context via option .useGlobal.
...
Note that, at least for now, CoffeeScript's own REPL *CLI* still uses a
non-global context, rendering modules such as `color`, which attempt to
modify the prototypes of JavaScript primitives, ineffective. By
contrast, node's own CLI does use the global context.
2013-09-03 16:41:27 -04:00
a3gis
c5120c7980
fix exit code when using --nodejs option
2013-09-02 16:11:22 -05:00
Jason Walton
3ad332d5d4
Issue #3092 : Fix column numbers in sourcemaps to not be essentially random.
2013-08-06 16:25:23 -04:00
Mal Graty
3c2f0d174e
Use coffee binary of coffee that overrode fork
...
This solves two potential problems when it comes to forking:
1) Forking will now work correctly even when `coffee` is not installed
globally.
2) Forking when using a locally installed version of `coffee` will fork
using that version, and not fallback to a globally installed version.
Fixes #2957
2013-08-02 23:10:45 +01:00
Jeremy Ashkenas
8cf6f62ea4
Merge pull request #3100 from epidemian/issue3023
...
Fix #3023 , Change how error messages are shown
2013-08-02 13:05:37 -07:00
Demian Ferreiro
9e716b310d
Avoid using a getter for the compiler error's "stack" property
...
Instead, set the "stack" property manually when the error gets updated on re-throws.
2013-08-02 01:52:36 -03:00
David Chambers
f5f99b3022
recompile
2013-08-01 14:14:12 -07:00
FredyC
e644f7244d
Using original existence check with mkdirp call on failure
2013-08-01 17:03:32 +02:00
FredyC
457cdfde26
Fixed deep directory creation for command line utility
2013-08-01 11:17:27 +02:00
Demian Ferreiro
2b4a37296f
Override the SyntaxError's "stack" property instead of deleting it
...
This makes the "stack" property more useful when it's shown on other Node.js applications that compile CoffeeScript (e.g. testing libraries) and should fix #3023 . A minimal example:
$ node -e 'require("coffee-script").compile("class class")'
/usr/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:41
throw err;
^
[stdin]:1:7: error: unexpected CLASS
class class
^^^^^
2013-07-31 09:24:43 -03:00
Demian Ferreiro
3f9cdcf1fa
Change how error messages are shown
...
Instead of throwing the syntax errors with their source file location and needing to then catch them and call a `prettyErrorMessage` function in order to get the formatted error message, now syntax errors know how to pretty-print themselves (their `toString` method gets overridden).
An intermediate `catch` & re-`throw` is needed at the level of `CoffeeScript.compile` and friends. But the benefit of this approach is that now libraries that use the `CoffeeScript` object directly don't need to bother catching the possible compilation errors and calling a special function in order to get the nice error messages; they can just print the error itself (or let it bubble up) and the error will know how to pretty-print itself.
2013-07-31 08:27:49 -03:00
Demian Ferreiro
51c625205b
Update compiled JS
2013-07-30 01:06:41 -03:00
Marc Häfner
25c6001a6c
Speed up updateLocationDataIfMissing.
...
* Avoid excessive search for missing `locationData`
* Fix `locationData` for `ELSE IF`.
2013-06-21 02:47:29 +02:00
Marc Häfner
4fd5e9a3ab
Better handling of initial indent at file start.
...
* Detect initial indentation before the first token and enforce it.
* Don't add `INDENT` token (or the matching `OUTDENT, TERMINATOR`).
2013-06-14 00:28:45 +02:00
Michael Ficarra
ba7cb3ab69
fix #3029
2013-06-13 13:38:13 -05:00
Michael Ficarra
054443c46e
rebuild #3029
2013-06-13 13:35:40 -05:00
Demian Ferreiro
3c880bf601
Move a try/catch from compile to loadFile
...
This try/catch should only be necessary for dynamically loaded files. Also added a lengthier explanation of why this try/catch is needed.
2013-06-09 02:54:34 -03:00
Demian Ferreiro
8e90aaefc1
Merge branch 'master' into issue2849
...
Conflicts:
lib/coffee-script/coffee-script.js
src/coffee-script.coffee
2013-06-09 02:40:53 -03:00
Jeremy Ashkenas
84b8b5ccee
CoffeeScript 1.6.3
2013-06-02 09:37:45 +04:00
Jeremy Ashkenas
3298c9caad
merge
2013-06-02 09:10:16 +04:00
Jeremy Ashkenas
7089b02a74
Merging in a monkey-patching of Module::load, unfortunately.
2013-06-02 09:03:54 +04:00
Jeremy Ashkenas
bd451800bf
Merge pull request #3000 from sgentle/require-extensions
...
Patch module.prototype.load to enable multiple extensions like .coffee.md
2013-06-01 21:44:02 -07:00
Michael Ficarra
0f5ae54014
Merge pull request #2930 from marchaefner/Issue1057
...
Fixes #1057 : Allow catch/finally in single line functions.
2013-05-31 14:56:04 -07:00
Sam Gentle
012e3c019c
fix style problems part 3
2013-05-26 15:59:49 +10:00
Nami-Doc
b3ffd25339
Disallowed for own in
2013-05-26 00:29:26 +02:00
Sam Gentle
30b2af820a
Early exit + refactor findExtension
2013-05-26 02:17:34 +10:00
Sam Gentle
2fd956d8d4
fix style problems
2013-05-26 00:10:07 +10:00
Sam Gentle
d46a44ac48
Patch node module loader to handle multiple extensions - fixes #2928 & #2855
2013-05-25 23:22:27 +10:00
In-Ho Yi
b54db2ea07
keep track of source map information for require()d coffee files
2013-04-29 17:06:22 +10:00
Marc Häfner
05b74f3743
Merge remote-tracking branch 'refs/remotes/upstream/master'
2013-04-29 05:27:13 +02:00
Michael Ficarra
174cd7eaa0
rebuild for some unneccessary parentheses changes
...
rebuild of 3921e3db34
2013-04-28 22:09:46 -05:00
Marc Häfner
40d2761bd8
Fixes #2916 -- implicit calls with preceding herecomment
2013-04-28 10:30:03 +02:00
Nami-Doc
7be996c010
code cleanup
2013-04-28 00:56:44 +02:00
Nami-Doc
e8fae286be
remove --lint. #2894 : rebuild and fix docs
2013-04-27 19:35:32 +02:00
Michal Srb
7b9699c5fa
Fix #1437 . Unneeded ref in existential assignment.
2013-04-22 21:58:49 +02:00
Jeremy Ashkenas
8a59558e2d
Merge pull request #2946 from Nami-Doc/issue2944
...
Fix #2944
2013-04-21 08:15:15 -07:00
Nami-Doc
5162472f16
Fix REPL when env.HOME isn't available - #2945
2013-04-21 16:03:30 +02:00
Nami-Doc
1917bb69ed
Fix #2944
2013-04-21 12:33:00 +02:00
Michael Ficarra
3b38153759
Merge pull request #2940 from jiangmiao/issue2908
...
Fixes #2908 , add "\n" between pure literal header and function body.
2013-04-20 12:03:25 -07:00
Robert Martin
71aea4b862
Fix bug in REPL where history file was closed late.
...
The history file was set to close on process exit, when it
should close on REPL exit. Listening to the process exit
event causes a warning when more than 10 CoffeeScript REPL
instances are opened in the same program, which happens in
the test.
2013-04-20 14:49:54 -04:00
Michael Ficarra
c785e00a15
Merge pull request #2929 from lucasb-eyer/master
...
Keep a single-line herecomment as a single-line js comment.
2013-04-15 13:12:43 -07:00
lucasb-eyer
ccc7c4404d
Keep the js comment on a single line if the herecomment is on a single line.
2013-04-15 21:45:55 +02:00
Marc Häfner
69d66a1d4d
Fixes #1057 : Allow catch/finally in single line functions.
...
* Don't end single-line functions at `catch` or `finally`.
* Remove unused `IMPLICIT_BLOCK` and superfluous test for `IF`.
2013-04-15 20:20:52 +02:00
Marc Häfner
af81f6de70
Fix error reporting for invalid object key.
2013-04-12 18:10:26 +02:00
Marc Häfner
cf07fcb4b1
#2900 -- parameter-less catch clause.
...
Plus some minor cleanup after f8c6b494aa
2013-04-12 17:50:45 +02:00
Jeremy Ashkenas
740a7bcb45
Merge pull request #2914 from danielgtaylor/repl-history
...
repl history implementation improvements
2013-04-07 21:47:16 -07:00
Daniel G. Taylor
0e2d2ea637
Move lastLine setter into conditional block to prevent .commands and blank lines from setting lastLine
2013-04-07 11:28:59 -07:00
Daniel G. Taylor
feaea49eac
Replace large comprehension with much simpler code; fix comment to reference maxSize instead of previous 10KB limit; only pop a history entry if the file size is actually bigger than maxSize; only add items to the history if they are different from the last item by storing the last line and loading it on startup.
2013-04-06 22:10:08 -07:00
Jeremy Ashkenas
170f311101
Merge branch 'master' of https://github.com/jashkenas/coffee-script
2013-04-06 09:31:30 +08:00
Jeremy Ashkenas
0cadcdc097
Fix regression with executable class bodies and prototypal attachment.
2013-04-06 09:31:24 +08:00