refactor(compiler): use symbols for runtime helpers
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
||||
import { parse } from 'acorn'
|
||||
import { walk } from 'estree-walker'
|
||||
import { TransformContext } from './transform'
|
||||
import { OPEN_BLOCK, CREATE_BLOCK, MERGE_PROPS } from './runtimeConstants'
|
||||
import { OPEN_BLOCK, CREATE_BLOCK, MERGE_PROPS } from './runtimeHelpers'
|
||||
import { isString, isFunction } from '@vue/shared'
|
||||
import { PropsExpression } from './transforms/transformElement'
|
||||
|
||||
@@ -217,3 +217,10 @@ export function injectProp(
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
export function toValidAssetId(
|
||||
name: string,
|
||||
type: 'component' | 'directive'
|
||||
): string {
|
||||
return `_${type}_${name.replace(/[^\w]/g, '')}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user