diff options
author | Scott González <scott.gonzalez@gmail.com> | 2017-04-21 14:49:52 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2017-04-24 12:41:29 -0400 |
commit | b3c0a7f71d0b351755b97858ad47de4e9a373606 (patch) | |
tree | aa69ee7e6c9388007ee398978adf1f0bc2e175cd /tests | |
parent | ef2e9bab92ae898311baa295590cd487d9071319 (diff) | |
download | jquery-ui-b3c0a7f71d0b351755b97858ad47de4e9a373606.tar.gz jquery-ui-b3c0a7f71d0b351755b97858ad47de4e9a373606.zip |
Widget: Handle `Object.create(null)` for options objects
Fixes #15179
Closes gh-1809
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/widget/extend.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/unit/widget/extend.js b/tests/unit/widget/extend.js index 36575200b..b27d925f0 100644 --- a/tests/unit/widget/extend.js +++ b/tests/unit/widget/extend.js @@ -5,7 +5,7 @@ define( [ ], 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, @@ -108,6 +108,11 @@ QUnit.test( "$.widget.extend()", function( assert ) { 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" ); } ); } ); |