File tree Expand file tree Collapse file tree 3 files changed +15
-23
lines changed Expand file tree Collapse file tree 3 files changed +15
-23
lines changed Original file line number Diff line number Diff line change @@ -456,7 +456,9 @@ export type CompatConfig = Partial<
456
456
MODE ?: 2 | 3
457
457
}
458
458
459
- export const globalCompatConfig : CompatConfig = { }
459
+ export const globalCompatConfig : CompatConfig = {
460
+ MODE : 2
461
+ }
460
462
461
463
export function configureCompat ( config : CompatConfig ) {
462
464
if ( __DEV__ ) {
Original file line number Diff line number Diff line change @@ -55,22 +55,17 @@ function compileToFunction(
55
55
extend (
56
56
{
57
57
hoistStatic : true ,
58
- onError ( err ) {
59
- if ( __DEV__ ) {
60
- onError ( err )
61
- } else {
62
- /* istanbul ignore next */
63
- throw err
64
- }
65
- } ,
66
- onWarn : __DEV__ ? onError : NOOP
58
+ onError : __DEV__ ? onError : undefined ,
59
+ onWarn : __DEV__ ? e => onError ( e , true ) : NOOP
67
60
} as CompilerOptions ,
68
61
options
69
62
)
70
63
)
71
64
72
- function onError ( err : CompilerError ) {
73
- const message = `Template compilation error: ${ err . message } `
65
+ function onError ( err : CompilerError , asWarning = false ) {
66
+ const message = asWarning
67
+ ? err . message
68
+ : `Template compilation error: ${ err . message } `
74
69
const codeFrame =
75
70
err . loc &&
76
71
generateCodeFrame (
Original file line number Diff line number Diff line change @@ -49,22 +49,17 @@ function compileToFunction(
49
49
extend (
50
50
{
51
51
hoistStatic : true ,
52
- onError ( err ) {
53
- if ( __DEV__ ) {
54
- onError ( err )
55
- } else {
56
- /* istanbul ignore next */
57
- throw err
58
- }
59
- } ,
60
- onWarn : __DEV__ ? onError : NOOP
52
+ onError : __DEV__ ? onError : undefined ,
53
+ onWarn : __DEV__ ? e => onError ( e , true ) : NOOP
61
54
} as CompilerOptions ,
62
55
options
63
56
)
64
57
)
65
58
66
- function onError ( err : CompilerError ) {
67
- const message = `Template compilation error: ${ err . message } `
59
+ function onError ( err : CompilerError , asWarning = false ) {
60
+ const message = asWarning
61
+ ? err . message
62
+ : `Template compilation error: ${ err . message } `
68
63
const codeFrame =
69
64
err . loc &&
70
65
generateCodeFrame (
You can’t perform that action at this time.
0 commit comments