Fix js lint warnings
authorCheng Zhao <zcbenz@gmail.com>
Sat, 28 May 2016 13:46:15 +0000 (22:46 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 28 May 2016 13:46:15 +0000 (22:46 +0900)
lib/renderer/api/ipc-renderer.js
lib/renderer/chrome-api.js

index 1081475..66c40d3 100644 (file)
@@ -20,7 +20,7 @@ ipcRenderer.sendToHost = function (...args) {
 
 ipcRenderer.sendTo = function (webContentsId, channel, ...args) {
   if (typeof webContentsId !== 'number') {
-    throw new TypeError(`First argument has to be webContentsId`)
+    throw new TypeError('First argument has to be webContentsId')
   }
 
   ipcRenderer.send('ELECTRON_BROWSER_SEND_TO', false, webContentsId, channel, ...args)
@@ -28,7 +28,7 @@ ipcRenderer.sendTo = function (webContentsId, channel, ...args) {
 
 ipcRenderer.sendToAll = function (webContentsId, channel, ...args) {
   if (typeof webContentsId !== 'number') {
-    throw new TypeError(`First argument has to be webContentsId`)
+    throw new TypeError('First argument has to be webContentsId')
   }
 
   ipcRenderer.send('ELECTRON_BROWSER_SEND_TO', true, webContentsId, channel, ...args)
index 19bf69f..e582f5f 100644 (file)
@@ -119,14 +119,13 @@ exports.injectTo = function (extensionId, context) {
     sendMessage (...args) {
       // Parse the optional args.
       let targetExtensionId = extensionId
-      let message, options, responseCallback
+      let message
       if (args.length === 1) {
         message = args[0]
       } else if (args.length === 2) {
         [targetExtensionId, message] = args
       } else {
-        console.error('responseCallback is not supported')
-        [targetExtensionId, message, options, responseCallback] = args
+        console.error('options and responseCallback are not supported')
       }
 
       ipcRenderer.send('CHROME_RUNTIME_SENDMESSAGE', targetExtensionId, message)