wip: invert compiler compat behavior default during tests
This commit is contained in:
parent
bbf708dbe9
commit
ad97bbab85
@ -102,7 +102,9 @@ export function checkCompatEnabled(
|
|||||||
loc: SourceLocation | null,
|
loc: SourceLocation | null,
|
||||||
...args: any[]
|
...args: any[]
|
||||||
): boolean {
|
): 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) {
|
if (__DEV__ && enabled) {
|
||||||
warnDeprecation(key, context, loc, ...args)
|
warnDeprecation(key, context, loc, ...args)
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,9 @@ export function defaultOnError(error: CompilerError) {
|
|||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|
||||||
export function defaultOnWarn(msg: string | CompilerError) {
|
export function defaultOnWarn(msg: CompilerError) {
|
||||||
__DEV__ &&
|
throw new Error('foo')
|
||||||
console.warn(`[Vue warn]`, typeof msg === 'string' ? msg : msg.message)
|
__DEV__ && console.warn(`[Vue warn]`, msg.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createCompilerError<T extends number>(
|
export function createCompilerError<T extends number>(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user