Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make execjs lazy #11

Closed
wants to merge 1 commit into from

4 participants

Yehuda Katz Terence Lee Sam Stephenson Joshua Peek
Yehuda Katz

Let's make execjs lazy here so that it's only pulled in (and thus a JS engine is required) only when JavaScript is actually executed.

Terence Lee

+1

Sam Stephenson
Collaborator

@wycats would you mind chiming in on sstephenson/execjs#21?

Joshua Peek
Owner

This isn't happening at the coffee-script level. The change will be made to execjs.

Joshua Peek josh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 10, 2011
  1. Yehuda Katz

    Make execjs lazy

    wycats authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/coffee_script.rb
6 lib/coffee_script.rb
View
@@ -1,4 +1,3 @@
-require 'execjs'
require 'coffee_script/source'
module CoffeeScript
@@ -28,7 +27,10 @@ def self.bare_option
end
def self.context
- @context ||= ExecJS.compile(contents)
+ @context ||= begin
+ require 'execjs'
+ ExecJS.compile(contents)
+ end
end
end
Something went wrong with that request. Please try again.