Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tysonmote opened this issue Sep 24, 2010 · 1 comment
Open

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

tysonmote opened this issue Sep 24, 2010 · 1 comment

Comments

@tysonmote
Copy link

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
@tysonmote
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant