1
1
import { Node , Warning } from './interfaces' ;
2
- import Compiler from './compile/Compiler ' ;
2
+ import Component from './compile/Component ' ;
3
3
4
4
const now = ( typeof process !== 'undefined' && process . hrtime )
5
5
? ( ) => {
@@ -64,7 +64,7 @@ export default class Stats {
64
64
65
65
stop ( label ) {
66
66
if ( label !== this . currentTiming . label ) {
67
- throw new Error ( `Mismatched timing labels` ) ;
67
+ throw new Error ( `Mismatched timing labels (expected ${ this . currentTiming . label } , got ${ label } ) ` ) ;
68
68
}
69
69
70
70
this . currentTiming . end = now ( ) ;
@@ -73,14 +73,14 @@ export default class Stats {
73
73
this . currentChildren = this . currentTiming ? this . currentTiming . children : this . timings ;
74
74
}
75
75
76
- render ( compiler : Compiler ) {
76
+ render ( component : Component ) {
77
77
const timings = Object . assign ( {
78
78
total : now ( ) - this . startTime
79
79
} , collapseTimings ( this . timings ) ) ;
80
80
81
81
// TODO would be good to have this info even
82
82
// if options.generate is false
83
- const imports = compiler && compiler . imports . map ( node => {
83
+ const imports = component && component . imports . map ( node => {
84
84
return {
85
85
source : node . source . value ,
86
86
specifiers : node . specifiers . map ( specifier => {
@@ -96,11 +96,11 @@ export default class Stats {
96
96
}
97
97
} ) ;
98
98
99
- const hooks : Record < string , boolean > = compiler && {
100
- oncreate : ! ! compiler . templateProperties . oncreate ,
101
- ondestroy : ! ! compiler . templateProperties . ondestroy ,
102
- onstate : ! ! compiler . templateProperties . onstate ,
103
- onupdate : ! ! compiler . templateProperties . onupdate
99
+ const hooks : Record < string , boolean > = component && {
100
+ oncreate : ! ! component . templateProperties . oncreate ,
101
+ ondestroy : ! ! component . templateProperties . ondestroy ,
102
+ onstate : ! ! component . templateProperties . onstate ,
103
+ onupdate : ! ! component . templateProperties . onupdate
104
104
} ;
105
105
106
106
return {
0 commit comments