Skip to content

Commit b29b045

Browse files
committed
refactor(WTF): rename scopes to follow coding conventions
1 parent c349bbb commit b29b045

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

modules/angular2/src/core/compiler/view_manager.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class AppViewManager {
8484
return this._utils.getComponentInstance(hostView, boundElementIndex);
8585
}
8686

87-
_scope_createRootHostView: WtfScopeFn = wtfCreateScope('AppViewManager#createRootHostView()');
87+
_createRootHostViewScope: WtfScopeFn = wtfCreateScope('AppViewManager#createRootHostView()');
8888
/**
8989
* Load component view into existing element.
9090
*
@@ -141,7 +141,7 @@ export class AppViewManager {
141141
*/
142142
createRootHostView(hostProtoViewRef: ProtoViewRef, overrideSelector: string,
143143
injector: Injector): HostViewRef {
144-
var s = this._scope_createRootHostView();
144+
var s = this._createRootHostViewScope();
145145
var hostProtoView: viewModule.AppProtoView = internalProtoView(hostProtoViewRef);
146146
var hostElementSelector = overrideSelector;
147147
if (isBlank(hostElementSelector)) {
@@ -157,14 +157,14 @@ export class AppViewManager {
157157
return wtfLeave(s, hostView.ref);
158158
}
159159

160-
_scope_destroyRootHostView: WtfScopeFn = wtfCreateScope('AppViewManager#destroyRootHostView()');
160+
_destroyRootHostViewScope: WtfScopeFn = wtfCreateScope('AppViewManager#destroyRootHostView()');
161161
/**
162162
* Remove the View created with {@link AppViewManager#createRootHostView}.
163163
*/
164164
destroyRootHostView(hostViewRef: HostViewRef) {
165165
// Note: Don't put the hostView into the view pool
166166
// as it is depending on the element for which it was created.
167-
var s = this._scope_destroyRootHostView();
167+
var s = this._destroyRootHostViewScope();
168168
var hostView = internalView(<ViewRef>hostViewRef);
169169
this._renderer.detachFragment(hostView.renderFragment);
170170
this._renderer.dehydrateView(hostView.render);
@@ -174,15 +174,15 @@ export class AppViewManager {
174174
wtfLeave(s);
175175
}
176176

177-
_scope_createEmbeddedViewInContainer: WtfScopeFn =
177+
_createEmbeddedViewInContainerScope: WtfScopeFn =
178178
wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()');
179179
/**
180180
*
181181
* See {@link AppViewManager#destroyViewInContainer}.
182182
*/
183183
createEmbeddedViewInContainer(viewContainerLocation: ElementRef, atIndex: number,
184184
templateRef: TemplateRef): ViewRef {
185-
var s = this._scope_createEmbeddedViewInContainer();
185+
var s = this._createEmbeddedViewInContainerScope();
186186
var protoView = internalProtoView(templateRef.protoViewRef);
187187
if (protoView.type !== ViewType.EMBEDDED) {
188188
throw new BaseException('This method can only be called with embedded ProtoViews!');
@@ -191,7 +191,7 @@ export class AppViewManager {
191191
templateRef.elementRef, null));
192192
}
193193

194-
_scope_createHostViewInContainer: WtfScopeFn =
194+
_createHostViewInContainerScope: WtfScopeFn =
195195
wtfCreateScope('AppViewManager#createHostViewInContainer()');
196196
/**
197197
*
@@ -200,7 +200,7 @@ export class AppViewManager {
200200
createHostViewInContainer(viewContainerLocation: ElementRef, atIndex: number,
201201
protoViewRef: ProtoViewRef,
202202
imperativelyCreatedInjector: ResolvedBinding[]): HostViewRef {
203-
var s = this._scope_createHostViewInContainer();
203+
var s = this._createHostViewInContainerScope();
204204
var protoView = internalProtoView(protoViewRef);
205205
if (protoView.type !== ViewType.HOST) {
206206
throw new BaseException('This method can only be called with host ProtoViews!');
@@ -255,27 +255,27 @@ export class AppViewManager {
255255
}
256256
}
257257

258-
_scope_destroyViewInContainer = wtfCreateScope('AppViewMananger#destroyViewInContainer()');
258+
_destroyViewInContainerScope = wtfCreateScope('AppViewMananger#destroyViewInContainer()');
259259
/**
260260
*
261261
* See {@link AppViewManager#createViewInContainer}.
262262
*/
263263
destroyViewInContainer(viewContainerLocation: ElementRef, atIndex: number) {
264-
var s = this._scope_destroyViewInContainer();
264+
var s = this._destroyViewInContainerScope();
265265
var parentView = internalView(viewContainerLocation.parentView);
266266
var boundElementIndex = viewContainerLocation.boundElementIndex;
267267
this._destroyViewInContainer(parentView, boundElementIndex, atIndex);
268268
wtfLeave(s);
269269
}
270270

271-
_scope_attachViewInContainer = wtfCreateScope('AppViewMananger#attachViewInContainer()');
271+
_attachViewInContainerScope = wtfCreateScope('AppViewMananger#attachViewInContainer()');
272272
/**
273273
*
274274
* See {@link AppViewManager#detachViewInContainer}.
275275
*/
276276
attachViewInContainer(viewContainerLocation: ElementRef, atIndex: number,
277277
viewRef: ViewRef): ViewRef {
278-
var s = this._scope_attachViewInContainer();
278+
var s = this._attachViewInContainerScope();
279279
var view = internalView(viewRef);
280280
var parentView = internalView(viewContainerLocation.parentView);
281281
var boundElementIndex = viewContainerLocation.boundElementIndex;
@@ -290,13 +290,13 @@ export class AppViewManager {
290290
return wtfLeave(s, viewRef);
291291
}
292292

293-
_scope_detachViewInContainer = wtfCreateScope('AppViewMananger#detachViewInContainer()');
293+
_detachViewInContainerScope = wtfCreateScope('AppViewMananger#detachViewInContainer()');
294294
/**
295295
*
296296
* See {@link AppViewManager#attachViewInContainer}.
297297
*/
298298
detachViewInContainer(viewContainerLocation: ElementRef, atIndex: number): ViewRef {
299-
var s = this._scope_detachViewInContainer();
299+
var s = this._detachViewInContainerScope();
300300
var parentView = internalView(viewContainerLocation.parentView);
301301
var boundElementIndex = viewContainerLocation.boundElementIndex;
302302
var viewContainer = parentView.viewContainers[boundElementIndex];

modules/angular2/src/core/life_cycle/life_cycle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {wtfLeave, wtfCreateScope, WtfScopeFn} from '../profile/profile';
3232
*/
3333
@Injectable()
3434
export class LifeCycle {
35-
static _scope_tick: WtfScopeFn = wtfCreateScope('LifeCycle#tick()');
35+
static _tickScope: WtfScopeFn = wtfCreateScope('LifeCycle#tick()');
3636

3737
_changeDetector: ChangeDetector;
3838
_enforceNoNewChanges: boolean;
@@ -74,7 +74,7 @@ export class LifeCycle {
7474
throw new BaseException("LifeCycle.tick is called recursively");
7575
}
7676

77-
var s = LifeCycle._scope_tick();
77+
var s = LifeCycle._tickScope();
7878
try {
7979
this._runningTick = true;
8080
this._changeDetector.detectChanges();

modules/angular2/src/core/profile/profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function noopScope(arg0?: any, arg1?: any): any {
2525
*
2626
* Used to mark scope entry. The return value is used to leave the scope.
2727
*
28-
* final myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
28+
* var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
2929
*
3030
* someMethod() {
3131
* var s = myScope('Foo'); // 'Foo' gets stored in tracing UI

modules/angular2/src/core/render/dom/dom_renderer.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ export class DomRenderer extends Renderer {
5050
this._document = document;
5151
}
5252

53-
_scope_createRootHostView: WtfScopeFn = wtfCreateScope('DomRenderer#createRootHostView()');
53+
_createRootHostViewScope: WtfScopeFn = wtfCreateScope('DomRenderer#createRootHostView()');
5454
createRootHostView(hostProtoViewRef: RenderProtoViewRef, fragmentCount: number,
5555
hostElementSelector: string): RenderViewWithFragments {
56-
var s = this._scope_createRootHostView();
56+
var s = this._createRootHostViewScope();
5757
var hostProtoView = resolveInternalDomProtoView(hostProtoViewRef);
5858
var element = DOM.querySelector(this._document, hostElementSelector);
5959
if (isBlank(element)) {
@@ -63,9 +63,9 @@ export class DomRenderer extends Renderer {
6363
return wtfLeave(s, this._createView(hostProtoView, element));
6464
}
6565

66-
_scope_createView = wtfCreateScope('DomRenderer#createView()');
66+
_createViewScope = wtfCreateScope('DomRenderer#createView()');
6767
createView(protoViewRef: RenderProtoViewRef, fragmentCount: number): RenderViewWithFragments {
68-
var s = this._scope_createView();
68+
var s = this._createViewScope();
6969
var protoView = resolveInternalDomProtoView(protoViewRef);
7070
return wtfLeave(s, this._createView(protoView, null));
7171
}
@@ -109,9 +109,9 @@ export class DomRenderer extends Renderer {
109109
moveNodesAfterSibling(element, resolveInternalDomFragment(fragmentRef));
110110
}
111111

112-
_scope_detachFragment = wtfCreateScope('DomRenderer#detachFragment()');
112+
_detachFragmentScope = wtfCreateScope('DomRenderer#detachFragment()');
113113
detachFragment(fragmentRef: RenderFragmentRef) {
114-
var s = this._scope_detachFragment();
114+
var s = this._detachFragmentScope();
115115
var fragmentNodes = resolveInternalDomFragment(fragmentRef);
116116
for (var i = 0; i < fragmentNodes.length; i++) {
117117
DOM.remove(fragmentNodes[i]);
@@ -201,9 +201,9 @@ export class DomRenderer extends Renderer {
201201
DOM.setText(view.boundTextNodes[textNodeIndex], text);
202202
}
203203

204-
_scope_setEventDispatcher = wtfCreateScope('DomRenderer#setEventDispatcher()');
204+
_setEventDispatcherScope = wtfCreateScope('DomRenderer#setEventDispatcher()');
205205
setEventDispatcher(viewRef: RenderViewRef, dispatcher: any /*api.EventDispatcher*/): void {
206-
var s = this._scope_setEventDispatcher();
206+
var s = this._setEventDispatcherScope();
207207
var view = resolveInternalDomView(viewRef);
208208
view.eventDispatcher = dispatcher;
209209
wtfLeave(s);

modules/angular2/src/core/zone/ng_zone.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export interface NgZoneZone extends Zone { _innerZone: boolean; }
1515
* `Zone`. The default `onTurnDone` runs the Angular change detection.
1616
*/
1717
export class NgZone {
18-
_zone_run_scope: WtfScopeFn = wtfCreateScope(`NgZone#run()`);
19-
_zone_microtask: WtfScopeFn = wtfCreateScope(`NgZone#microtask()`);
18+
_runScope: WtfScopeFn = wtfCreateScope(`NgZone#run()`);
19+
_microtaskScope: WtfScopeFn = wtfCreateScope(`NgZone#microtask()`);
2020

2121
// Code executed in _mountZone does not trigger the onTurnDone.
2222
_mountZone;
@@ -141,7 +141,7 @@ export class NgZone {
141141
if (this._disabled) {
142142
return fn();
143143
} else {
144-
var s = this._zone_run_scope();
144+
var s = this._runScope();
145145
try {
146146
return this._innerZone.run(fn);
147147
} finally {
@@ -175,7 +175,7 @@ export class NgZone {
175175
}
176176

177177
_createInnerZone(zone, enableLongStackTrace) {
178-
var _zone_microtask = this._zone_microtask;
178+
var microtaskScope = this._microtaskScope;
179179
var ngZone = this;
180180
var errorHandling;
181181

@@ -228,7 +228,7 @@ export class NgZone {
228228
return function(fn) {
229229
ngZone._pendingMicrotasks++;
230230
var microtask = function() {
231-
var s = _zone_microtask();
231+
var s = microtaskScope();
232232
try {
233233
fn();
234234
} finally {

0 commit comments

Comments
 (0)