1
0
Fork 0
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:
Michael Ficarra 2012-03-02 22:49:51 -05:00
parent 7c1f4b38f4
commit 44e1ccec7e
2 changed files with 2 additions and 1 deletions

View file

@ -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));
};

View file

@ -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