summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/node_modules/acorn/bin/without_eval
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/node_modules/acorn/bin/without_eval')
-rwxr-xr-xdeps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/node_modules/acorn/bin/without_eval48
1 files changed, 0 insertions, 48 deletions
diff --git a/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/node_modules/acorn/bin/without_eval b/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/node_modules/acorn/bin/without_eval
deleted file mode 100755
index 4331e7070c..0000000000
--- a/deps/npm/node_modules/readable-stream/node_modules/inline-process-browser/node_modules/falafel/node_modules/acorn/bin/without_eval
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env node
-
-var fs = require("fs")
-
-var acornSrc = fs.readFileSync(require.resolve("../dist/acorn"), "utf8")
-var acorn = require("../dist/acorn"), walk = require("../dist/walk")
-
-var ast = acorn.parse(acornSrc)
-var touchups = [], uses = []
-
-var makePred
-
-walk.simple(ast, {
- FunctionDeclaration: function(node) {
- if (node.id.name == "makePredicate") {
- makePred = node
- touchups.push({text: "// Removed to create an eval-free library", from: node.start, to: node.end})
- }
- },
- ObjectExpression: function(node) {
- node.properties.forEach(function(prop) {
- if (prop.value.type == "CallExpression" &&
- prop.value.callee.name == "makePredicate")
- uses.push(prop.value)
- })
- }
-})
-
-var results = []
-var dryRun = acornSrc.slice(0, makePred.end) + "; makePredicate = (function(mp) {" +
- "return function(words) { var r = mp(words); predicates.push(r); return r }})(makePredicate);" +
- acornSrc.slice(makePred.end)
-;(new Function("predicates", dryRun))(results)
-
-uses.forEach(function (node, i) {
- touchups.push({text: results[i].toString(), from: node.start, to: node.end})
-})
-
-var result = "", pos = 0
-touchups.sort(function(a, b) { return a.from - b.from })
-touchups.forEach(function(touchup) {
- result += acornSrc.slice(pos, touchup.from)
- result += touchup.text
- pos = touchup.to
-})
-result += acornSrc.slice(pos)
-
-process.stdout.write(result)