Skip to content

Commit

Permalink
Add @@PLUGINSTART-USE-STRICT@@ Replacement
Browse files Browse the repository at this point in the history
The replacement is the standard PLUGINSTART code followed by "use strict";. by @hayeswise

iitc-project/ingress-intel-total-conversion#1187
#2
  • Loading branch information
modos189 committed Nov 27, 2018
1 parent 369ba7b commit 0d571f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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)
Expand Down

1 comment on commit 0d571f4

@johnd0e
Copy link
Contributor

@johnd0e johnd0e commented on 0d571f4 Jan 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this patch was premature:
iitc-project/ingress-intel-total-conversion#1186 (comment)

See #71

Please sign in to comment.