wip: compileScriptSetup
This commit is contained in:
@@ -22,10 +22,15 @@ import {
|
||||
parseJS,
|
||||
walkJS
|
||||
} from '../utils'
|
||||
import { isGloballyWhitelisted, makeMap } from '@vue/shared'
|
||||
import {
|
||||
isGloballyWhitelisted,
|
||||
makeMap,
|
||||
babelParserDefautPlugins
|
||||
} from '@vue/shared'
|
||||
import { createCompilerError, ErrorCodes } from '../errors'
|
||||
import { Node, Function, Identifier, ObjectProperty } from '@babel/types'
|
||||
import { validateBrowserExpression } from '../validateExpression'
|
||||
import { ParserPlugin } from '@babel/parser'
|
||||
|
||||
const isLiteralWhitelisted = /*#__PURE__*/ makeMap('true,false,null,this')
|
||||
|
||||
@@ -127,12 +132,7 @@ export function processExpression(
|
||||
ast = parseJS(source, {
|
||||
plugins: [
|
||||
...context.expressionPlugins,
|
||||
// by default we enable proposals slated for ES2020.
|
||||
// full list at https://babeljs.io/docs/en/next/babel-parser#plugins
|
||||
// this will need to be updated as the spec moves forward.
|
||||
'bigInt',
|
||||
'optionalChaining',
|
||||
'nullishCoalescingOperator'
|
||||
...(babelParserDefautPlugins as ParserPlugin[])
|
||||
]
|
||||
}).program
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user