Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 Loading... | |
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); |
LEFT | RIGHT |