mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixes #1832: speed up CoffeeScript.eval
in browser script
This commit is contained in:
parent
74501f643c
commit
11544f2717
2 changed files with 3 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
@ -4,8 +4,9 @@ CoffeeScript = require './coffee-script'
|
||||||
CoffeeScript.require = require
|
CoffeeScript.require = require
|
||||||
|
|
||||||
# Use standard JavaScript `eval` to eval code.
|
# Use standard JavaScript `eval` to eval code.
|
||||||
|
global ?= this
|
||||||
CoffeeScript.eval = (code, options) ->
|
CoffeeScript.eval = (code, options) ->
|
||||||
eval CoffeeScript.compile code, options
|
global.eval CoffeeScript.compile code, options
|
||||||
|
|
||||||
# Running code does not provide access to this scope.
|
# Running code does not provide access to this scope.
|
||||||
CoffeeScript.run = (code, options = {}) ->
|
CoffeeScript.run = (code, options = {}) ->
|
||||||
|
|
Loading…
Add table
Reference in a new issue