From 26683389ea2df30f7b3f9c2522f0ea7197c0bc9b Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Thu, 19 Jul 2018 16:00:00 +0200 Subject: [PATCH] chore: Replace post-processed warning message with single-line string literal (#152) --- src/browser-polyfill.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/browser-polyfill.js b/src/browser-polyfill.js index b7619fd..e94fe0d 100644 --- a/src/browser-polyfill.js +++ b/src/browser-polyfill.js @@ -8,12 +8,7 @@ if (typeof browser === "undefined") { const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received."; - const SEND_RESPONSE_DEPRECATION_WARNING = ` - Returning a Promise is the preferred way to send a reply from an - onMessage/onMessageExternal listener, as the sendResponse will be - removed from the specs (See - https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/onMessage) - `.replace(/\s+/g, " ").trim(); + const SEND_RESPONSE_DEPRECATION_WARNING = "Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)"; // Wrapping the bulk of this polyfill in a one-time-use function is a minor // optimization for Firefox. Since Spidermonkey does not fully parse the