We are using the stripped down version of the qooxdoo javascript framework (http://www.qooxdoo.org) called qx-oo ( http://demo.qooxdoo.org/current/framework/qx-oo-noopt.js ). This is well crafted OO-part with inheritence, mixins, events and so forth.
The qooxdoo class definition mechanism checks the existence of an attribute called "extend" within the class definition arguments which are defined as an object with attributes.
qooxdoo decides on the absence or existence of the attribute "extend" if a class has only statics or if the class is used for instantiation.
Because of the defined "extend" attribute/function/method in Object.prototype.extend this mechanism breaks.
The attempt to remove Object.prototype.extend via delete is ignored.
Tests with standalone V8 on centos 6 showed that Object.prototype.extend is not defined there. So it is unique to the titanium android V8 derivate.
What is Object.prototype.extend used for? How can I remove it?
On iOS qooxdoo is usable without any problems.
4 Answers
Accepted Answer
Hey guys, Thanks for bringing this to my attention :)
We indeed added Object.prototype.extend, and use it for object merging/mixins. You can find the code for this in github
In retrospect, I agree with the general sentiment here -- we should move Object.prototype.extend to an internal namespace, so I've opened TIMOB-6684 to track the fix.
It isnt possible to prototype Ti-objects.
IMHO, extending "Object.prototype" (or any native prototype) is a bad practice in general. No matter that, in Titanium v8 implementation, function "extend" in "Object.prototype" should be considered as a bug since it's not defined in ECMAScript specification.
Wow! That was a fast fix! It is already in the continuous builds. See: https://github.com/appcelerator/titanium_mobile/commit/80547393e763f38e344c33504ad80326a61f546f
Thanks a lot to the guys at appcelerator (Marshall, Opie, dizzmonkey, ayeung) and to Ivan Skugor for strengthen my opinion here.
Best regards. Dietrich.
Your Answer
Think you can help? Login to answer this question!