lib/h8/coffee.rb in h8-0.4.5 vs lib/h8/coffee.rb in h8-0.4.8

- old
+ new

@@ -16,28 +16,28 @@ # # This method IS THREAD SAFE, it shares single # compiler instance across all threads with a mutex. def self.eval src, ** kwargs @@mutex.synchronize { - (@@compiler ||= Coffee.new).eval src, ** kwargs + (@@compiler ||= Coffee.new).eval src, **kwargs } end # Compile coffeescript and return javascript. Keyword parameters are # passed to H8::Context#eval - like time limits and so on. # # This method IS THREAD SAFE, though it shares single # compiler instance across all threads with a mutex. def self.compile src, ** kwargs @@mutex.synchronize { - (@@compiler ||= Coffee.new).compile src, ** kwargs + (@@compiler ||= Coffee.new).compile src, **kwargs } end # Create compiler instance. def initialize - @context = H8::Context.new + @context = H8::Context.new noglobals: true @context.eval read_script 'coffee-script.js' eval read_script('globals.coffee') end # compile coffeescript source and return compiled javascript @@ -67,8 +67,7 @@ def read_script name @@cache[name] ||= open(File.join(@@base, name), 'r').read end end - end