wip: compiler deprecation config
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { SourceLocation } from './ast'
|
||||
|
||||
export interface CompilerError extends SyntaxError {
|
||||
code: number
|
||||
code: number | string
|
||||
loc?: SourceLocation
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ export function defaultOnError(error: CompilerError) {
|
||||
throw error
|
||||
}
|
||||
|
||||
export function defaultOnWarn(msg: string | CompilerError) {
|
||||
__DEV__ &&
|
||||
console.warn(`[Vue warn]`, typeof msg === 'string' ? msg : msg.message)
|
||||
}
|
||||
|
||||
export function createCompilerError<T extends number>(
|
||||
code: T,
|
||||
loc?: SourceLocation,
|
||||
|
||||
Reference in New Issue
Block a user