From b3c0a7f71d0b351755b97858ad47de4e9a373606 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 21 Apr 2017 14:49:52 -0400 Subject: Widget: Handle `Object.create(null)` for options objects Fixes #15179 Closes gh-1809 --- ui/widget.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/widget.js b/ui/widget.js index f87675712..011396811 100644 --- a/ui/widget.js +++ b/ui/widget.js @@ -26,6 +26,7 @@ }( function( $ ) { var widgetUuid = 0; +var widgetHasOwnProperty = Array.prototype.hasOwnProperty; var widgetSlice = Array.prototype.slice; $.cleanData = ( function( orig ) { @@ -183,7 +184,7 @@ $.widget.extend = function( target ) { 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 ) ) { -- cgit v1.2.3