Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions extras/iced-coffee-script-108.0.10-min.js

Large diffs are not rendered by default.

8,887 changes: 8,887 additions & 0 deletions extras/iced-coffee-script-108.0.10.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions extras/iced-coffee-script-108.0.11-min.js

Large diffs are not rendered by default.

8,887 changes: 8,887 additions & 0 deletions extras/iced-coffee-script-108.0.11.js

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions lib/coffee-script/coffee-script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/coffee-script/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "iced-coffee-script",
"description": "IcedCoffeeScript",
"author": "Jeremy Ashkenas + Maxwell Krohn",
"version": "108.0.10",
"version": "108.0.11",
"keywords": [
"javascript",
"language",
Expand Down Expand Up @@ -40,6 +40,7 @@
"browserify": "^4.1.8"
},
"dependencies": {
"iced-runtime": ">=0.0.1"
"iced-runtime": ">=0.0.1",
"mkdirp": "^0.5.1"
}
}
11 changes: 8 additions & 3 deletions src/coffee-script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ iced_transform = require('./iced').transform
iced_runtime = require 'iced-runtime'

# The current CoffeeScript version number.
exports.VERSION = '108.0.10'
exports.VERSION = '108.0.11'

exports.FILE_EXTENSIONS = ['.coffee', '.litcoffee', '.coffee.md', '.iced', '.liticed', '.iced.md']

Expand Down Expand Up @@ -132,11 +132,16 @@ exports.eval = (code, options = {}) ->
return unless code = code.trim()
Script = vm.Script
if Script
# Node API compatibility
createContext = vm.Script.createContext ? vm.createContext
isContext = vm.isContext ? (ctx) ->
options.sandbox instanceof createContext().constructor

if options.sandbox?
if options.sandbox instanceof Script.createContext().constructor
if isContext options.sandbox
sandbox = options.sandbox
else
sandbox = Script.createContext()
sandbox = createContext()
sandbox[k] = v for own k, v of options.sandbox
sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox
else
Expand Down
2 changes: 2 additions & 0 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ exports.Call = class Call extends Base
answer = answer.concat fun
answer = answer.concat @makeCode(".apply(#{ref}, "), splatArgs, @makeCode(")")

icedToSlot : () -> @error "function call cannot be a slot for defer"

#### Extends

# Node to extend an object's prototype with an ancestor object.
Expand Down
2 changes: 1 addition & 1 deletion test/error_messages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ unless global.testingBrowser
^^
"""
finally
fs.unlink 'test/syntax-error.coffee'
fs.unlinkSync 'test/syntax-error.coffee'


test "#1096: unexpected generated tokens", ->
Expand Down
3 changes: 2 additions & 1 deletion test/eval.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ if vm = require? 'vm'
eq fhqwhgads, 'global superpower!'

test "CoffeeScript.eval can run in, and modify, a Script context sandbox", ->
sandbox = vm.Script.createContext()
createContext = vm.Script.createContext ? vm.createContext # Node API change
sandbox = createContext()
sandbox.foo = 'bar'
code = '''
global.foo = 'not bar!'
Expand Down
8 changes: 8 additions & 0 deletions test/iced.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -845,3 +845,11 @@ atest "await expression assertions 1", (cb) ->
else 20
'''
cb true, {}

atest "await expression errors", (cb) ->
# forgetting `,` between `err` and `result` makes it a function
# call, which is invalid iced slot. make sure the error mentions
# that.
code = "await foo defer err result"
throws (-> CoffeeScript.compile code), /function call cannot be a slot/
cb true, {}
1 change: 0 additions & 1 deletion test/repl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ testRepl "existential assignment of previously declared variable", (input, outpu

testRepl "keeps running after runtime error", (input, output) ->
input.emitLine 'a = b'
eq 0, output.lastWrite().indexOf 'ReferenceError: b is not defined'
input.emitLine 'a'
eq 'undefined', output.lastWrite()

Expand Down