rse / componentjs

ComponentJS -- Powerful run-time Component System for structuring HTML5-based Rich Clients
http://componentjs.com/
Other
85 stars 13 forks source link

Calling base() fails on Opera #23

Closed flosell closed 10 years ago

flosell commented 11 years ago

Calling base() inside a function that overrides a superclass-function on Opera (tested on Opera 12.16 on Linux and Opera 12.15 on windows) fails with Error: [ComponentJS]: ERROR: base: no base method found for method "null" in inheritance/mixin chain

This only happens if the debugger is closed.

The following fiddle demonstrates the behavior: http://jsfiddle.net/8qNUF/ We have two classes, baseClass and subclass which inherits create() from baseClass and overrides it with custom code and a call to base().

In Chrome (and Opera with active debugger), this behaves as expected, creating two alerts, 'subclass create' and 'base create'. In Opera without debugger, this only creates the 'subclass create'-alert. If you open the error-log afterwards, you'll notice the error quoted above.

I think I narrowed it down to the call _cs.annotation(func.caller, "clone") in resolve being called from clazz.prototype.base (var name = resolve(arguments.callee.caller, "name");) which behaves differently but couldn't yet figure out why

flosell commented 11 years ago

Debugged a bit more so I now have more hints but no solution: When comparing the behavior with and without debugger, it looks like arguments.callee.caller.caller is different: with debugger on (the case were everything works as expected) it is a function clone whereas without the debugger it is the calling function (create in subclass). My guess was that something is wrong with the clone-function, but I haven't found any differences yet...

rse commented 10 years ago

As Opera 12 is an ancient version (which was still based on their Presto engine) and since Opera 15 (which is now based on Chromium/Blink) a completely new world order exists in the Opera world, I close this old report. Please reopen it if the bug still exists in Opera version >= 15. Thanks.