Fix no-implicit-coercion errors in front_end/

[email protected]

No-Presubmit: True
Bug: 1082789
Change-Id: Ic77884bf7e9b5dc74053915b3b10699368841b66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595268
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Jack Franklin <[email protected]>
diff --git a/front_end/extensions/ExtensionAPI.js b/front_end/extensions/ExtensionAPI.js
index 22c0e9b..ba3fe9a 100644
--- a/front_end/extensions/ExtensionAPI.js
+++ b/front_end/extensions/ExtensionAPI.js
@@ -309,7 +309,7 @@
 
       // Only send command if we either removed an existing handler or added handler and had none before.
       if (hadHandler === !callback) {
-        extensionServer.sendRequest({command: commands.SetOpenResourceHandler, 'handlerPresent': !!callback});
+        extensionServer.sendRequest({command: commands.SetOpenResourceHandler, 'handlerPresent': Boolean(callback)});
       }
     },
 
@@ -534,7 +534,7 @@
         id: id,
         icon: iconPath,
         tooltip: tooltipText,
-        disabled: !!disabled
+        disabled: Boolean(disabled)
       };
       extensionServer.sendRequest(request);
       return new Button(id);
@@ -601,8 +601,13 @@
 
   ButtonImpl.prototype = {
     update: function(iconPath, tooltipText, disabled) {
-      const request =
-          {command: commands.UpdateButton, id: this._id, icon: iconPath, tooltip: tooltipText, disabled: !!disabled};
+      const request = {
+        command: commands.UpdateButton,
+        id: this._id,
+        icon: iconPath,
+        tooltip: tooltipText,
+        disabled: Boolean(disabled)
+      };
       extensionServer.sendRequest(request);
     }
   };
@@ -861,7 +866,7 @@
      * @return {boolean}
      */
     hasHandler: function(command) {
-      return !!this._handlers[command];
+      return Boolean(this._handlers[command]);
     },
 
     registerHandler: function(command, handler) {