Skip to content

Commit

Permalink
MC-41987: Fix jQuery.isFunction() (#39)
Browse files Browse the repository at this point in the history
* MC-41987: Fix jQuery.isFunction()
    - Replace isFunction()

* MC-41987: Fix jQuery.isFunction()
    - Replace isFunction()
  • Loading branch information
jcuerdo authored May 20, 2021
1 parent 3734a9e commit 84a457b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ define([
closed: function () {
var doc = self.iframe.get(0).document;

if (doc && $.isFunction(doc.execCommand)) {
if (doc && typeof doc.execCommand === 'function') {
//IE9 break script loading but not execution on iframe removing
doc.execCommand('stop');
self.iframe.remove();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ define([
customAttributesObject;

$.each(addrs, function (key) {
if (addrs.hasOwnProperty(key) && !$.isFunction(addrs[key])) {
if (addrs.hasOwnProperty(key) && typeof addrs[key] !== 'function') {
output[self.toUnderscore(key)] = addrs[key];
}
});
Expand Down
4 changes: 2 additions & 2 deletions lib/web/mage/backend/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ define([
* @param {HTMLElement} element
*/
highlight: function (element) {
if ($.validator.defaults.highlight && $.isFunction($.validator.defaults.highlight)) {
if ($.validator.defaults.highlight && typeof $.validator.defaults.highlight === 'function') {
$.validator.defaults.highlight.apply(this, arguments);
}
$(element).trigger('highlight.validate');
Expand All @@ -109,7 +109,7 @@ define([
* @param {HTMLElement} element
*/
unhighlight: function (element) {
if ($.validator.defaults.unhighlight && $.isFunction($.validator.defaults.unhighlight)) {
if ($.validator.defaults.unhighlight && typeof $.validator.defaults.unhighlight === 'function') {
$.validator.defaults.unhighlight.apply(this, arguments);
}
$(element).trigger('unhighlight.validate');
Expand Down

0 comments on commit 84a457b

Please sign in to comment.