], function( QUnit, $ ) {
QUnit.test( "$.widget.extend()", function( assert ) {
- assert.expect( 27 );
+ assert.expect( 28 );
var ret, empty, optionsWithLength, optionsWithDate, myKlass, customObject, optionsWithCustomObject, nullUndef,
target, recursive, obj, input, output,
assert.deepEqual( input, output, "don't clone arrays" );
input.key[ 0 ] = 10;
assert.deepEqual( input, output, "don't clone arrays" );
+
+ input = Object.create( null );
+ input.foo = "f";
+ output = $.widget.extend( {}, input );
+ assert.deepEqual( input, output, "Object with no prototype" );
} );
} );
}( function( $ ) {
var widgetUuid = 0;
+var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
var widgetSlice = Array.prototype.slice;
$.cleanData = ( function( orig ) {
for ( ; inputIndex < inputLength; inputIndex++ ) {
for ( key in input[ inputIndex ] ) {
value = input[ inputIndex ][ key ];
- if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+ if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {
// Clone objects
if ( $.isPlainObject( value ) ) {