mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
eval
's options
argument should default to {}
, even in the browser
This commit is contained in:
parent
7c1f4b38f4
commit
44e1ccec7e
2 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
CoffeeScript.require = require;
|
||||
|
||||
CoffeeScript["eval"] = function(code, options) {
|
||||
if (options == null) options = {};
|
||||
if (options.bare == null) options.bare = true;
|
||||
return eval(CoffeeScript.compile(code, options));
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@ CoffeeScript = require './coffee-script'
|
|||
CoffeeScript.require = require
|
||||
|
||||
# Use standard JavaScript `eval` to eval code.
|
||||
CoffeeScript.eval = (code, options) ->
|
||||
CoffeeScript.eval = (code, options = {}) ->
|
||||
options.bare ?= on
|
||||
eval CoffeeScript.compile code, options
|
||||
|
||||
|
|
Loading…
Reference in a new issue