mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
[CS2] Don’t require async/await support to run coffee (#4679)
* Get `coffee` command working again in Node 6, by converting the ‘await’ wrapper in the REPL to use a Promise instead of the ‘await’ keyword; add tests for REPL ‘await’ wrapper, including test to skip async tests if the runtime doesn’t support them * Code review * Let's support Node 6+ if we can
This commit is contained in:
@@ -44,9 +44,9 @@ replDefaults =
|
||||
result = runInContext js, context, filename
|
||||
# Await an async result, if necessary
|
||||
if isAsync
|
||||
result = await result
|
||||
cb null, result unless sawSIGINT
|
||||
sawSIGINT = false
|
||||
result.then (resolvedResult) ->
|
||||
cb null, resolvedResult unless sawSIGINT
|
||||
sawSIGINT = no
|
||||
else
|
||||
cb null, result
|
||||
catch err
|
||||
|
||||
Reference in New Issue
Block a user