Skip to main content

Bug Tracker

Side navigation

#12660 closed bug (notabug)

Opened October 05, 2012 01:53PM UTC

Closed October 05, 2012 04:27PM UTC

Animations raises TypeError when Object is prototyped.

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

When adding a function in the prototype property of Object, ie :

if (!Object.noopFunc) {
	Object.prototype.noopFunc = function(e) {
		return "noOp";

animations such as fadeOut raise an exception :

$("div").fadeOut(500, someCallback);

Uncaught TypeError: Object function (e) {
    return "noOp";
} has no method 'concat' 

Here is a sample traceback :

(anonymous function) jquery-1.8.2.js:8595
jQuery.extend.each jquery-1.8.2.js:605
createTweens jquery-1.8.2.js:8594
Animation jquery-1.8.2.js:8683
jQuery.fn.extend.animate.doAnimation jquery-1.8.2.js:9005
jQuery.extend.dequeue jquery-1.8.2.js:1894
jQuery.fn.extend.queue jquery-1.8.2.js:1937
jQuery.extend.each jquery-1.8.2.js:611
jQuery.fn.jQuery.each jquery-1.8.2.js:241
jQuery.fn.extend.queue jquery-1.8.2.js:1930
jQuery.fn.extend.animate jquery-1.8.2.js:9015
jQuery.each.jQuery.fn.(anonymous function) jquery-1.8.2.js:9100
myNiceEffectFunction jQueryBugOnObjectProrotype.html:17 jquery-1.8.2.js:974
jQuery.Callbacks.self.fireWith jquery-1.8.2.js:1082
jQuery.extend.ready jquery-1.8.2.js:406
Attachments (0)
Change History (4)

Changed October 05, 2012 01:56PM UTC by comment:1

See example here :

Changed October 05, 2012 02:13PM UTC by Christian Meixner <> comment:2

Do not modify Object.prototype!


jQuery does not support that.

Changed October 05, 2012 03:53PM UTC by anonymous comment:3

I understand your point, and I have found a workaround using "Object.defineProperty". Is it as bad, or is it better, giving the fact that the defined properties look now like native methodes?

Anyway, for me there is either a bug in jQuery or something missing in the documentation stating that this practice doens't work with jQuery. Do you agree ?

Changed October 05, 2012 04:27PM UTC by scottgonzalez comment:4

resolution: → notabug
status: newclosed