Permalink
Browse files

Add MrubyJs::setup_global method

  • Loading branch information...
1 parent 7fda196 commit dbe5c02acef7d3dad0d44f64509948a8b86e9a64 @xxuejie committed Nov 9, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 mrblib/mrubyjs.rb
View
@@ -20,6 +20,13 @@ def self.call_proc(p)
end
end
+ def self.setup_global
+ Kernel.define_method(:window) do
+ MrubyJs.window
+ end
+ Kernel.alias_method(:global, :window)
+ end
+
class JsObject
def call(name, *args)
get_func(name).invoke(*args)

2 comments on commit dbe5c02

Owner

xxuejie replied Nov 9, 2013

@joshnuss Enjoy!

Contributor

joshnuss replied Nov 9, 2013

@xxuejie Thanks Dude

Please sign in to comment.