mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-02 20:00:05 +02:00
update node modules
This commit is contained in:
12
node_modules/acorn-globals/index.js
generated
vendored
12
node_modules/acorn-globals/index.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var acorn = require('acorn');
|
||||
var walk = require('acorn/dist/walk');
|
||||
var walk = require('acorn-walk');
|
||||
|
||||
function isScope(node) {
|
||||
return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'ArrowFunctionExpression' || node.type === 'Program';
|
||||
@@ -53,7 +53,7 @@ function findGlobals(source, options) {
|
||||
if (node.id) {
|
||||
fn.locals[node.id.name] = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
var declarePattern = function (node, parent) {
|
||||
switch (node.type) {
|
||||
case 'Identifier':
|
||||
@@ -79,11 +79,11 @@ function findGlobals(source, options) {
|
||||
default:
|
||||
throw new Error('Unrecognized pattern type: ' + node.type);
|
||||
}
|
||||
}
|
||||
};
|
||||
var declareModuleSpecifier = function (node, parents) {
|
||||
ast.locals = ast.locals || {};
|
||||
ast.locals[node.local.name] = true;
|
||||
}
|
||||
};
|
||||
walk.ancestor(ast, {
|
||||
'VariableDeclaration': function (node, parents) {
|
||||
var parent = null;
|
||||
@@ -139,7 +139,7 @@ function findGlobals(source, options) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
node.parents = parents;
|
||||
node.parents = parents.slice();
|
||||
globals.push(node);
|
||||
}
|
||||
walk.ancestor(ast, {
|
||||
@@ -151,7 +151,7 @@ function findGlobals(source, options) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
node.parents = parents;
|
||||
node.parents = parents.slice();
|
||||
globals.push(node);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user