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

Side by Side Diff: jshydra.js

Issue 29345403: Issue 4088 - JSHydra-generated module scopes shouldn't be called immediately (Closed)
Patch Set: Automatically load some modules if specified Created May 31, 2016, 1:46 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
« no previous file with comments | « autotest/test_abprewrite_module.js.expected ('k') | scripts/abprewrite.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var include = function(file) 1 var include = function(file)
2 { 2 {
3 if (typeof include.dirStack == "undefined") 3 if (typeof include.dirStack == "undefined")
4 include.dirStack = []; 4 include.dirStack = [];
5 5
6 if (include.dirStack.length && !/^([a-zA-Z]:)?[\/\\]/.test(file)) 6 if (include.dirStack.length && !/^([a-zA-Z]:)?[\/\\]/.test(file))
7 file = include.dirStack[include.dirStack.length - 1] + "/../" + file; 7 file = include.dirStack[include.dirStack.length - 1] + "/../" + file;
8 while (/\/[^.\/][^\/]*\/\.\.(?=\/)/.test(file)) 8 while (/\/[^.\/][^\/]*\/\.\.(?=\/)/.test(file))
9 file = file.replace(/\/[^.\/][^\/]*\/\.\.(?=\/)/, ""); 9 file = file.replace(/\/[^.\/][^\/]*\/\.\.(?=\/)/, "");
10 10
(...skipping 22 matching lines...) Expand all
33 scriptArgs.splice(i--, 2); 33 scriptArgs.splice(i--, 2);
34 } 34 }
35 } 35 }
36 36
37 if (!scriptArgs.length) 37 if (!scriptArgs.length)
38 throw Error("No script to execute"); 38 throw Error("No script to execute");
39 include(scriptArgs[0]); 39 include(scriptArgs[0]);
40 40
41 for (var i = 1; i < scriptArgs.length; i++) 41 for (var i = 1; i < scriptArgs.length; i++)
42 process_js(Reflect.parse(read(scriptArgs[i])), scriptArgs[i], scriptArg); 42 process_js(Reflect.parse(read(scriptArgs[i])), scriptArgs[i], scriptArg);
43
44 if (typeof done_processing == "function")
kzar 2016/05/31 14:43:15 Nit: Won't this function always exist? Also how ab
Wladimir Palant 2016/05/31 14:54:02 As is, JSHydra is a general-purpose tool - it can
kzar 2016/05/31 14:56:28 Fair enough.
45 done_processing();
43 })(this.arguments || this.scriptArgs); 46 })(this.arguments || this.scriptArgs);
OLDNEW
« no previous file with comments | « autotest/test_abprewrite_module.js.expected ('k') | scripts/abprewrite.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld