1- import { ProtoWatchGroup , WatchGroup } from './watch_group ' ;
1+ import { ProtoRecordRange , RecordRange } from './record_range ' ;
22import { FIELD , isPresent , isBlank , int , StringWrapper , FunctionWrapper , BaseException } from 'facade/lang' ;
33import { ListWrapper , MapWrapper } from 'facade/collection' ;
44import { ClosureMap } from 'change_detection/parser/closure_map' ;
@@ -17,7 +17,7 @@ export const PROTO_RECORD_PROPERTY = 'property';
1717 * real world numbers show that it does not provide significant benefits.
1818 */
1919export class ProtoRecord {
20- @FIELD ( 'final watchGroup:wg.ProtoWatchGroup ' )
20+ @FIELD ( 'final recordRange:ProtoRecordRange ' )
2121 @FIELD ( 'final context:Object' )
2222 @FIELD ( 'final funcOrValue:Object' )
2323 @FIELD ( 'final arity:int' )
@@ -26,13 +26,13 @@ export class ProtoRecord {
2626 @FIELD ( 'next:ProtoRecord' )
2727 @FIELD ( 'prev:ProtoRecord' )
2828 @FIELD ( 'recordInConstruction:Record' )
29- constructor ( watchGroup : ProtoWatchGroup ,
29+ constructor ( recordRange : ProtoRecordRange ,
3030 recordType :string ,
3131 funcOrValue ,
3232 arity :int ,
3333 dest ) {
3434
35- this . watchGroup = watchGroup ;
35+ this . recordRange = recordRange ;
3636 this . recordType = recordType ;
3737 this . funcOrValue = funcOrValue ;
3838 this . arity = arity ;
@@ -61,7 +61,7 @@ export class ProtoRecord {
6161 * - Keep this object as lean as possible. (Lean in number of fields)
6262 */
6363export class Record {
64- @FIELD ( 'final watchGroup:WatchGroup ' )
64+ @FIELD ( 'final recordRange:RecordRange ' )
6565 @FIELD ( 'final protoRecord:ProtoRecord' )
6666 @FIELD ( 'next:Record' )
6767 @FIELD ( 'prev:Record' )
@@ -86,8 +86,8 @@ export class Record {
8686 // Otherwise it is the context used by WatchGroupDispatcher.
8787 @FIELD ( 'dest' )
8888
89- constructor ( watchGroup : WatchGroup , protoRecord :ProtoRecord , formatters :Map ) {
90- this . watchGroup = watchGroup ;
89+ constructor ( recordRange : RecordRange , protoRecord :ProtoRecord , formatters :Map ) {
90+ this . recordRange = recordRange ;
9191 this . protoRecord = protoRecord ;
9292
9393 this . next = null ;
@@ -140,8 +140,8 @@ export class Record {
140140 }
141141 }
142142
143- static createMarker ( wg : WatchGroup ) {
144- var r = new Record ( wg , null , null ) ;
143+ static createMarker ( rr : RecordRange ) {
144+ var r = new Record ( rr , null , null ) ;
145145 r . disabled = true ;
146146 return r ;
147147 }
@@ -166,7 +166,7 @@ export class Record {
166166 this . dest . updateContext ( this . currentValue ) ;
167167 }
168168 } else {
169- this . watchGroup . dispatcher . onRecordChange ( this , this . protoRecord . dest ) ;
169+ this . recordRange . dispatcher . onRecordChange ( this , this . protoRecord . dest ) ;
170170 }
171171 }
172172
@@ -183,11 +183,11 @@ export class Record {
183183 return FunctionWrapper . apply ( this . context , this . args ) ;
184184
185185 case MODE_STATE_INVOKE_PURE_FUNCTION :
186- this . watchGroup . disableRecord ( this ) ;
186+ this . recordRange . disableRecord ( this ) ;
187187 return FunctionWrapper . apply ( this . funcOrValue , this . args ) ;
188188
189189 case MODE_STATE_CONST :
190- this . watchGroup . disableRecord ( this ) ;
190+ this . recordRange . disableRecord ( this ) ;
191191 return this . funcOrValue ;
192192
193193 case MODE_STATE_MARKER :
@@ -206,18 +206,18 @@ export class Record {
206206
207207 updateArg ( value , position :int ) {
208208 this . args [ position ] = value ;
209- this . watchGroup . enableRecord ( this ) ;
209+ this . recordRange . enableRecord ( this ) ;
210210 }
211211
212212 updateContext ( value ) {
213213 this . context = value ;
214- if ( ! this . isMarkerRecord ) {
215- this . watchGroup . enableRecord ( this ) ;
214+ if ( ! this . isMarkerRecord ) {
215+ this . recordRange . enableRecord ( this ) ;
216216 }
217217 }
218218
219219 get isMarkerRecord ( ) {
220- return isBlank ( this . protoRecord ) ;
220+ return this . mode == MODE_STATE_MARKER ;
221221 }
222222}
223223
0 commit comments