Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add MrubyJs::setup_global method

  • Loading branch information...
commit dbe5c02acef7d3dad0d44f64509948a8b86e9a64 1 parent 7fda196
@xxuejie authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 mrblib/mrubyjs.rb
View
7 mrblib/mrubyjs.rb
@@ -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

@xxuejie
Owner

@joshnuss Enjoy!

@joshnuss

@xxuejie Thanks Dude

Please sign in to comment.
Something went wrong with that request. Please try again.