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

Delta Between Two Patch Sets: jshydra.js

Issue 29345403: Issue 4088 - JSHydra-generated module scopes shouldn't be called immediately (Closed)
Left Patch Set: Automatically load some modules if specified Created May 31, 2016, 1:46 p.m.
Right Patch Set: Renamed callback Created May 31, 2016, 2:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « autotest/test_abprewrite_module.js.expected ('k') | scripts/abprewrite.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 23 matching lines...) Expand all
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 43
44 if (typeof done_processing == "function") 44 if (typeof post_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(); 45 post_processing();
46 })(this.arguments || this.scriptArgs); 46 })(this.arguments || this.scriptArgs);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld