From 551420132c357467a747cae12be39c2662ce56f1 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 6 Feb 2020 18:46:25 +0000 Subject: export missing API for AST manipulation (#3707) --- lib/utils.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/utils.js') 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) { -- cgit v1.2.3