aboutsummaryrefslogtreecommitdiff
path: root/lib/utils.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-02-06 18:46:25 +0000
committerGitHub <noreply@github.com>2020-02-06 18:46:25 +0000
commit551420132c357467a747cae12be39c2662ce56f1 (patch)
treec3eac8ac64078004a2d2cbfba29fc33c648339ba /lib/utils.js
parentb0040ba6540232687204d125eff021adf11c4efa (diff)
downloadtracifyjs-551420132c357467a747cae12be39c2662ce56f1.tar.gz
tracifyjs-551420132c357467a747cae12be39c2662ce56f1.zip
export missing API for AST manipulation (#3707)
Diffstat (limited to 'lib/utils.js')
-rw-r--r--lib/utils.js20
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) {