Skip to main content

Search and Top Navigation

#8182 closed bug (notabug)

Opened March 13, 2012 10:01AM UTC

Closed March 13, 2012 12:59PM UTC

$.extend with modified object prototype

Reported by: markQuery Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.core Version: 1.8.18
Keywords: Cc:
Blocked by: Blocking:
Description

The code

$.extend( $.ui, {

// $.ui.plugin is deprecated. Use the proxy pattern instead.

plugin: {

add: function( module, option, set ) {

var proto = $.ui[ module ].prototype;

for ( var i in set ) {

Is using the for...in syntax. If the prototype of the Javascript object has been extended this breaks. Instead it should probably use for ( var j = 0; j < set.length; ++j )

Sorry I am not very familiar with Javascript or jQuery so it would be a lot of effort to make a test case. I'm seeing the problem on a private site.

Attachments (0)
Change History (1)

Changed March 13, 2012 12:59PM UTC by scottgonzalez comment:1

resolution: → invalid
status: newclosed

jQuery doesn't support modifying Object.prototype.