feat(core): validate directives names (#326)
This commit is contained in:
committed by
Evan You
parent
60961ef5b6
commit
2238925fbe
@@ -13,7 +13,7 @@ import {
|
||||
callWithAsyncErrorHandling
|
||||
} from './errorHandling'
|
||||
import { AppContext, createAppContext, AppConfig } from './apiApp'
|
||||
import { Directive } from './directives'
|
||||
import { Directive, validateDirectiveName } from './directives'
|
||||
import { applyOptions, ComponentOptions } from './apiOptions'
|
||||
import {
|
||||
EMPTY_OBJ,
|
||||
@@ -256,6 +256,12 @@ export function setupStatefulComponent(
|
||||
validateComponentName(name, instance.appContext.config)
|
||||
}
|
||||
}
|
||||
if (Component.directives) {
|
||||
const names = Object.keys(Component.directives)
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
validateDirectiveName(names[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
// 0. create render proxy property access cache
|
||||
instance.accessCache = {}
|
||||
|
||||
Reference in New Issue
Block a user