loc: SourceLocation | null,
...args: any[]
): boolean {
- const enabled = getCompatValue(key, context) !== false
+ const value = getCompatValue(key, context)
+ // during tests, only enable when value is explicitly true
+ const enabled = __TEST__ ? value === true : value !== false
if (__DEV__ && enabled) {
warnDeprecation(key, context, loc, ...args)
}
throw error
}
-export function defaultOnWarn(msg: string | CompilerError) {
- __DEV__ &&
- console.warn(`[Vue warn]`, typeof msg === 'string' ? msg : msg.message)
+export function defaultOnWarn(msg: CompilerError) {
+ throw new Error('foo')
+ __DEV__ && console.warn(`[Vue warn]`, msg.message)
}
export function createCompilerError<T extends number>(