Skip to content

Commit

Permalink
Widget: Fix boolean option when under use strict
Browse files Browse the repository at this point in the history
Fix for `options === true` when using jQuery UI under `use strict`,
which throws:
```
Uncaught TypeError: Cannot create property 'complete' on boolean 'true'
```
on line:
```js
options.complete = callback;
```

Closes gh-1931
  • Loading branch information
Interghost authored and mgol committed Oct 6, 2020
1 parent 6bf3804 commit 2434dfd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
options = options || {};
if ( typeof options === "number" ) {
options = { duration: options };
} else if ( options === true ) {
options = {};
}

hasOptions = !$.isEmptyObject( options );
Expand Down

0 comments on commit 2434dfd

Please sign in to comment.