This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +14
-9
lines changed
1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -181,18 +181,23 @@ function $RootScopeProvider(){
181
181
child . $$asyncQueue = this . $$asyncQueue ;
182
182
child . $$postDigestQueue = this . $$postDigestQueue ;
183
183
} else {
184
- ChildScope = function ( ) { } ; // should be anonymous; This is so that when the minifier munges
185
- // the name it does not become random set of chars. This will then show up as class
186
- // name in the web inspector.
187
- ChildScope . prototype = this ;
188
- child = new ChildScope ( ) ;
189
- child . $id = nextUid ( ) ;
184
+ // Only create a child scope class if somebody asks for one,
185
+ // but cache it to allow the VM to optimize lookups.
186
+ if ( ! this . $$childScopeClass ) {
187
+ this . $$childScopeClass = function ( ) {
188
+ this . $$watchers = this . $$nextSibling =
189
+ this . $$childHead = this . $$childTail = null ;
190
+ this . $$listeners = { } ;
191
+ this . $$listenerCount = { } ;
192
+ this . $id = nextUid ( ) ;
193
+ this . $$childScopeClass = null ;
194
+ } ;
195
+ this . $$childScopeClass . prototype = this ;
196
+ }
197
+ child = new this . $$childScopeClass ( ) ;
190
198
}
191
199
child [ 'this' ] = child ;
192
- child . $$listeners = { } ;
193
- child . $$listenerCount = { } ;
194
200
child . $parent = this ;
195
- child . $$watchers = child . $$nextSibling = child . $$childHead = child . $$childTail = null ;
196
201
child . $$prevSibling = this . $$childTail ;
197
202
if ( this . $$childHead ) {
198
203
this . $$childTail . $$nextSibling = child ;
You can’t perform that action at this time.
0 commit comments