Permalink
Browse files

Merge pull request #1839 from michaelficarra/issue1832

fixes #1832: speed up `CoffeeScript.eval` in browser script
  • Loading branch information...
jashkenas committed Nov 9, 2011
2 parents 74501f6 + 11544f2 commit 97d1eedd5a4fe3babd2db0a4838341595be27447
Showing with 3 additions and 2 deletions.
  1. +1 −1 extras/coffee-script.js
  2. +2 −1 src/browser.coffee
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -4,8 +4,9 @@ CoffeeScript = require './coffee-script'
CoffeeScript.require = require
# Use standard JavaScript `eval` to eval code.
+global ?= this
CoffeeScript.eval = (code, options) ->
- eval CoffeeScript.compile code, options
+ global.eval CoffeeScript.compile code, options
# Running code does not provide access to this scope.
CoffeeScript.run = (code, options = {}) ->

0 comments on commit 97d1eed

Please sign in to comment.