From 0d571f4859c76dc117310eb8ef695c3ebbfec298 Mon Sep 17 00:00:00 2001 From: Alexander Danilov Date: Tue, 27 Nov 2018 15:05:12 +0300 Subject: [PATCH] Add @@PLUGINSTART-USE-STRICT@@ Replacement The replacement is the standard PLUGINSTART code followed by "use strict";. by @hayeswise https://github.com/iitc-project/ingress-intel-total-conversion/pull/1187 #2 --- build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.py b/build.py index 2bc21c6f0..75aed2413 100755 --- a/build.py +++ b/build.py @@ -80,6 +80,8 @@ """ +pluginWrapperStartUseStrict = pluginWrapperStart.replace("{\n", "{\n\"use strict\";\n", 1) + pluginWrapperEnd = """ setup.info = plugin_info; //add the script info data to the function as a property if(!window.bootPlugins) window.bootPlugins = []; @@ -128,6 +130,7 @@ def doReplacements(script,updateUrl,downloadUrl,pluginName=None): script = re.sub('@@INJECTCODE@@',loadCode,script) script = script.replace('@@PLUGINSTART@@', pluginWrapperStart) + script = script.replace('@@PLUGINSTART-USE-STRICT@@', pluginWrapperStartUseStrict) script = script.replace('@@PLUGINEND@@', pluginWrapperEnd) script = re.sub('@@INCLUDERAW:([0-9a-zA-Z_./-]+)@@', loaderRaw, script)