Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

MooTools doesn't load -- object.prototype is undefined #15

Open
tysontate opened this Issue · 1 comment

1 participant

@tysontate
require 'rubygems'
require 'harmony'
h = Harmony::Page.new
h.load 'http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools.js'

Gives me:

Johnson::Error: object.prototype is undefined

at top level    in untitled document at line 43
at top level    in untitled document at line 43
at top level    in untitled document at line 1432
method evaluate_compiled_script in runtime.rb at line 49
method evaluate in runtime.rb at line 53
method extended in runtime.rb at line 189
method call in js_land_proxy.rb at line 16
method __send__ in js_land_proxy.rb at line 16
method send_with_possible_block in js_land_proxy.rb at line 16
method call_function_property   in ruby_land_proxy.rb at line 110
at top level    in env.js at line 105
method method_missing   in ruby_land_proxy.rb at line 110
method load in page.rb at line 76
method each in page.rb at line 75
method load in page.rb at line 75
at top level    in untitled at line 4
@tysontate

One workaround appears to be to change the lines near #42 in mootools-core.js from:
if (legacy && initialize) object.prototype = legacy.prototype;
object.prototype.constructor = object;

To:

if (legacy && initialize) object.prototype = legacy.prototype;
if (!object.prototype) object.prototype = {};
object.prototype.constructor = object;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.