chore(compiler-sfc): fix typo in compileScript (#5000)

Co-authored-by: meiziwen1 <meiziwen1@xdf.cn>
This commit is contained in:
Ziwen Mei 2021-11-26 17:21:35 +08:00 committed by GitHub
parent b6a8a451b8
commit 2d4f455434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ const isBuiltInDir = makeMap(
export interface SFCScriptCompileOptions { export interface SFCScriptCompileOptions {
/** /**
* Scope ID for prefixing injected CSS varialbes. * Scope ID for prefixing injected CSS variables.
* This must be consistent with the `id` passed to `compileStyle`. * This must be consistent with the `id` passed to `compileStyle`.
*/ */
id: string id: string
@ -107,7 +107,7 @@ export interface SFCScriptCompileOptions {
inlineTemplate?: boolean inlineTemplate?: boolean
/** /**
* Options for template compilation when inlining. Note these are options that * Options for template compilation when inlining. Note these are options that
* would normally be pased to `compiler-sfc`'s own `compileTemplate()`, not * would normally be passed to `compiler-sfc`'s own `compileTemplate()`, not
* options passed to `compiler-dom`. * options passed to `compiler-dom`.
*/ */
templateOptions?: Partial<SFCTemplateCompileOptions> templateOptions?: Partial<SFCTemplateCompileOptions>
@ -412,7 +412,7 @@ export function compileScript(
default: right default: right
} }
} else if (prop.value.type === 'Identifier') { } else if (prop.value.type === 'Identifier') {
// simple destucture // simple destructure
propsDestructuredBindings[propKey] = { propsDestructuredBindings[propKey] = {
local: prop.value.name local: prop.value.name
} }
@ -632,7 +632,7 @@ export function compileScript(
/** /**
* check defaults. If the default object is an object literal with only * check defaults. If the default object is an object literal with only
* static properties, we can directly generate more optimzied default * static properties, we can directly generate more optimized default
* declarations. Otherwise we will have to fallback to runtime merging. * declarations. Otherwise we will have to fallback to runtime merging.
*/ */
function hasStaticWithDefaults() { function hasStaticWithDefaults() {
@ -1542,7 +1542,7 @@ function walkObjectPattern(
} }
} else { } else {
// ...rest // ...rest
// argument can only be identifer when destructuring // argument can only be identifier when destructuring
const type = isConst ? BindingTypes.SETUP_CONST : BindingTypes.SETUP_LET const type = isConst ? BindingTypes.SETUP_CONST : BindingTypes.SETUP_LET
registerBinding(bindings, p.argument as Identifier, type) registerBinding(bindings, p.argument as Identifier, type)
} }
@ -1574,7 +1574,7 @@ function walkPattern(
: BindingTypes.SETUP_LET : BindingTypes.SETUP_LET
registerBinding(bindings, node, type) registerBinding(bindings, node, type)
} else if (node.type === 'RestElement') { } else if (node.type === 'RestElement') {
// argument can only be identifer when destructuring // argument can only be identifier when destructuring
const type = isConst ? BindingTypes.SETUP_CONST : BindingTypes.SETUP_LET const type = isConst ? BindingTypes.SETUP_CONST : BindingTypes.SETUP_LET
registerBinding(bindings, node.argument as Identifier, type) registerBinding(bindings, node.argument as Identifier, type)
} else if (node.type === 'ObjectPattern') { } else if (node.type === 'ObjectPattern') {