Skip to content

Commit

Permalink
Use ['load'] instead of .load to avoid conflicts with other #load met…
Browse files Browse the repository at this point in the history
…hod definitions

In Rails 3 master.load was giving exception "ArgumentError: wrong number of arguments (0 for 1)" - it seems that somehow different #load method definition was called before method_missing which handles dynamic properties.
  • Loading branch information
rsim committed May 17, 2010
1 parent 3a7335c commit 46706f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/envjs/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def self.extended object

inner.load = lambda { |*files|
files.each do |f|
master.load.call f, inner
master['load'].call f, inner
end
}

Expand Down Expand Up @@ -322,7 +322,7 @@ def self.extended object
outer[k] = v
end

master.load.call Envjs::EVENT_LOOP, global
master['load'].call Envjs::EVENT_LOOP, global

static = new_global

Expand All @@ -334,10 +334,10 @@ def self.extended object

# fake it ...
static["isInner"] = true
master.load.call Envjs::STATIC, static
master['load'].call Envjs::STATIC, static
master["static"] = static

master.load.call Envjs::ENVJS, inner
master['load'].call Envjs::ENVJS, inner

inner = nil
end
Expand Down

0 comments on commit 46706f1

Please sign in to comment.