chore: remove babelParserDefaultPlugins

The version of @babel/parser we are using now has these plugins enabled by default.
This commit is contained in:
Evan You
2021-10-07 19:32:59 -04:00
parent ed0071ac1a
commit 646e694f0a
7 changed files with 10 additions and 43 deletions

View File

@@ -24,13 +24,7 @@ import {
walkIdentifiers
} from '../babelUtils'
import { advancePositionWithClone, isSimpleIdentifier } from '../utils'
import {
isGloballyWhitelisted,
makeMap,
babelParserDefaultPlugins,
hasOwn,
isString
} from '@vue/shared'
import { isGloballyWhitelisted, makeMap, hasOwn, isString } from '@vue/shared'
import { createCompilerError, ErrorCodes } from '../errors'
import {
Node,
@@ -244,7 +238,7 @@ export function processExpression(
: `(${rawExp})${asParams ? `=>{}` : ``}`
try {
ast = parse(source, {
plugins: [...context.expressionPlugins, ...babelParserDefaultPlugins]
plugins: context.expressionPlugins
}).program
} catch (e: any) {
context.onError(

View File

@@ -42,14 +42,7 @@ import {
WITH_MEMO,
OPEN_BLOCK
} from './runtimeHelpers'
import {
isString,
isObject,
hyphenate,
extend,
babelParserDefaultPlugins,
NOOP
} from '@vue/shared'
import { isString, isObject, hyphenate, extend, NOOP } from '@vue/shared'
import { PropsExpression } from './transforms/transformElement'
import { parseExpression } from '@babel/parser'
import { Expression } from '@babel/types'
@@ -167,7 +160,7 @@ export const isMemberExpressionNode = __BROWSER__
: (path: string, context: TransformContext): boolean => {
try {
let ret: Expression = parseExpression(path, {
plugins: [...context.expressionPlugins, ...babelParserDefaultPlugins]
plugins: context.expressionPlugins
})
if (ret.type === 'TSAsExpression' || ret.type === 'TSTypeAssertion') {
ret = ret.expression