diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-02-06 18:46:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-06 18:46:25 +0000 |
commit | 551420132c357467a747cae12be39c2662ce56f1 (patch) | |
tree | c3eac8ac64078004a2d2cbfba29fc33c648339ba /lib/utils.js | |
parent | b0040ba6540232687204d125eff021adf11c4efa (diff) | |
download | tracifyjs-551420132c357467a747cae12be39c2662ce56f1.tar.gz tracifyjs-551420132c357467a747cae12be39c2662ce56f1.zip |
export missing API for AST manipulation (#3707)
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/utils.js b/lib/utils.js index 6ac68bbd..da82a140 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -113,8 +113,8 @@ function return_true() { return true; } function return_this() { return this; } function return_null() { return null; } -var MAP = (function() { - function MAP(a, f, backwards) { +var List = (function() { + function List(a, f, backwards) { var ret = [], top = [], i; function doit() { var val = f(a[i], i); @@ -149,14 +149,14 @@ var MAP = (function() { } return top.concat(ret); } - MAP.at_top = function(val) { return new AtTop(val) }; - MAP.splice = function(val) { return new Splice(val) }; - MAP.last = function(val) { return new Last(val) }; - var skip = MAP.skip = {}; - function AtTop(val) { this.v = val } - function Splice(val) { this.v = val } - function Last(val) { this.v = val } - return MAP; + List.at_top = function(val) { return new AtTop(val); }; + List.splice = function(val) { return new Splice(val); }; + List.last = function(val) { return new Last(val); }; + var skip = List.skip = {}; + function AtTop(val) { this.v = val; } + function Splice(val) { this.v = val; } + function Last(val) { this.v = val; } + return List; })(); function push_uniq(array, el) { |