Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: templates/modules.js.tmpl

Issue 29454678: Issue 5085 - Add edgeInfo.js template for edge specific builds (Closed)
Patch Set: fix regexp in edge tmpl, remove platformVersion from chrome tmpl Created June 7, 2017, 4:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« templates/edgeInfo.js.tmpl ('K') | « templates/edgeInfo.js.tmpl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {%- if args["module"] -%} 1 {%- if args["module"] -%}
2 if (typeof require != "function") 2 if (typeof require != "function")
3 { 3 {
4 var require = function(module) 4 var require = function(module)
5 { 5 {
6 if (!(module in require.scopes)) 6 if (!(module in require.scopes))
7 { 7 {
8 let scope = {exports: {}}; 8 let scope = {exports: {}};
9 require.scopes[module] = require.modules[module](scope, scope.exports); 9 require.scopes[module] = require.modules[module](scope, scope.exports);
10 } 10 }
11 return require.scopes[module]; 11 return require.scopes[module];
12 }; 12 };
13 require.modules = Object.create(null); 13 require.modules = Object.create(null);
14 require.scopes = Object.create(null); 14 require.scopes = Object.create(null);
15 } 15 }
16 16
17 {% if args["injectinfomodule"] %} 17 {% if args["injectinfomodule"] %}
18 require.modules["info"] = function(module, exports) 18 require.modules["info"] = function(module, exports)
19 { 19 {
20 {% if type == "gecko-webext" %} 20 {% if type == "gecko-webext" %}
21 {% include "geckoInfo.js.tmpl" %} 21 {% include "geckoInfo.js.tmpl" %}
22 {% elif type == "chrome" or type == "edge" %} 22 {% elif type == "chrome" %}
23 {% include "chromeInfo.js.tmpl" %} 23 {% include "chromeInfo.js.tmpl" %}
24 {% elif type == "edge" %}
25 {% include "edgeInfo.js.tmpl" %}
24 {% endif %} 26 {% endif %}
25 return module.exports; 27 return module.exports;
26 }; 28 };
27 {% endif %} 29 {% endif %}
28 30
29 {%- for module_name, script in modules -%} 31 {%- for module_name, script in modules -%}
30 require.modules[{{ module_name|json }}] = function(module, exports) 32 require.modules[{{ module_name|json }}] = function(module, exports)
31 { 33 {
32 {{ script }} 34 {{ script }}
33 return module.exports; 35 return module.exports;
34 }; 36 };
35 37
36 {% endfor -%} 38 {% endfor -%}
37 {%- set modules = dict(modules) -%} 39 {%- set modules = dict(modules) -%}
38 {%- for module_name in args["autoload"] -%} 40 {%- for module_name in args["autoload"] -%}
39 {%- if module_name in modules -%} 41 {%- if module_name in modules -%}
40 require({{ module_name|json }}); 42 require({{ module_name|json }});
41 {% endif %} 43 {% endif %}
42 {%- endfor -%} 44 {%- endfor -%}
43 {%- else -%} 45 {%- else -%}
44 {%- for module_name, script in modules -%} 46 {%- for module_name, script in modules -%}
45 {{ script }} 47 {{ script }}
46 {% endfor -%} 48 {% endfor -%}
47 {%- endif -%} 49 {%- endif -%}
OLDNEW
« templates/edgeInfo.js.tmpl ('K') | « templates/edgeInfo.js.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld