aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-output.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-20 18:49:42 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-20 18:49:42 -0800
commit7953c8c6b8911647de68b4f22206650672cbca0a (patch)
tree4af22fc77553d08912639de4ac3ee5bca0be9146 /tools/test-js-optimizer-output.js
parentfadc6186ffca35a64b2cedb761439ae316af2972 (diff)
refactoring and fixes for running more tests in new o1 and o2 modes
Diffstat (limited to 'tools/test-js-optimizer-output.js')
-rw-r--r--tools/test-js-optimizer-output.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-output.js b/tools/test-js-optimizer-output.js
index 4c5b073c..aa494a05 100644
--- a/tools/test-js-optimizer-output.js
+++ b/tools/test-js-optimizer-output.js
@@ -145,4 +145,23 @@ function hoisting() {
somethingElse();
}
}
+var FS = {
+ absolutePath: (function(relative, base) {
+ if (typeof relative !== "string") return null;
+ if (base === undefined) base = FS.currentPath;
+ if (relative && relative[0] == "/") base = "";
+ var full = base + "/" + relative;
+ var parts = full.split("/").reverse();
+ var absolute = [ "" ];
+ while (parts.length) {
+ var part = parts.pop();
+ if (part == "" || part == ".") {} else if (part == "..") {
+ if (absolute.length > 1) absolute.pop();
+ } else {
+ absolute.push(part);
+ }
+ }
+ return absolute.length == 1 ? "/" : absolute.join("/");
+ })
+};
// EMSCRIPTEN_GENERATED_FUNCTIONS: ["abc", "xyz", "xyz2", "expr", "loopy", "bits", "maths", "hoisting"]