OLD | NEW |
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 Loading... |
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 })(arguments); | 43 })(this.arguments || this.scriptArgs); |
OLD | NEW |