Updating NPM dependencies
This commit is contained in:
16
node_modules/@babel/template/lib/parse.js
generated
vendored
16
node_modules/@babel/template/lib/parse.js
generated
vendored
@@ -18,13 +18,13 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
||||
const PATTERN = /^[_$A-Z0-9]+$/;
|
||||
|
||||
function parseAndBuildMetadata(formatter, code, opts) {
|
||||
const ast = parseWithCodeFrame(code, opts.parser);
|
||||
const {
|
||||
placeholderWhitelist,
|
||||
placeholderPattern,
|
||||
preserveComments,
|
||||
syntacticPlaceholders
|
||||
} = opts;
|
||||
const ast = parseWithCodeFrame(code, opts.parser, syntacticPlaceholders);
|
||||
t.removePropertiesDeep(ast, {
|
||||
preserveComments
|
||||
});
|
||||
@@ -54,6 +54,8 @@ function parseAndBuildMetadata(formatter, code, opts) {
|
||||
}
|
||||
|
||||
function placeholderVisitorHandler(node, ancestors, state) {
|
||||
var _state$placeholderWhi;
|
||||
|
||||
let name;
|
||||
|
||||
if (t.isPlaceholder(node)) {
|
||||
@@ -79,7 +81,7 @@ function placeholderVisitorHandler(node, ancestors, state) {
|
||||
throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
|
||||
}
|
||||
|
||||
if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && (!state.placeholderWhitelist || !state.placeholderWhitelist.has(name))) {
|
||||
if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && !((_state$placeholderWhi = state.placeholderWhitelist) == null ? void 0 : _state$placeholderWhi.has(name))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -145,13 +147,19 @@ function resolveAncestors(ast, ancestors) {
|
||||
};
|
||||
}
|
||||
|
||||
function parseWithCodeFrame(code, parserOpts) {
|
||||
function parseWithCodeFrame(code, parserOpts, syntacticPlaceholders) {
|
||||
const plugins = (parserOpts.plugins || []).slice();
|
||||
|
||||
if (syntacticPlaceholders !== false) {
|
||||
plugins.push("placeholders");
|
||||
}
|
||||
|
||||
parserOpts = Object.assign({
|
||||
allowReturnOutsideFunction: true,
|
||||
allowSuperOutsideMethod: true,
|
||||
sourceType: "module"
|
||||
}, parserOpts, {
|
||||
plugins: (parserOpts.plugins || []).concat("placeholders")
|
||||
plugins
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user