refactor(WTF): rename scopes to follow coding conventions
This commit is contained in:
parent
c349bbbc08
commit
b29b045d78
|
@ -84,7 +84,7 @@ export class AppViewManager {
|
|||
return this._utils.getComponentInstance(hostView, boundElementIndex);
|
||||
}
|
||||
|
||||
_scope_createRootHostView: WtfScopeFn = wtfCreateScope('AppViewManager#createRootHostView()');
|
||||
_createRootHostViewScope: WtfScopeFn = wtfCreateScope('AppViewManager#createRootHostView()');
|
||||
/**
|
||||
* Load component view into existing element.
|
||||
*
|
||||
|
@ -141,7 +141,7 @@ export class AppViewManager {
|
|||
*/
|
||||
createRootHostView(hostProtoViewRef: ProtoViewRef, overrideSelector: string,
|
||||
injector: Injector): HostViewRef {
|
||||
var s = this._scope_createRootHostView();
|
||||
var s = this._createRootHostViewScope();
|
||||
var hostProtoView: viewModule.AppProtoView = internalProtoView(hostProtoViewRef);
|
||||
var hostElementSelector = overrideSelector;
|
||||
if (isBlank(hostElementSelector)) {
|
||||
|
@ -157,14 +157,14 @@ export class AppViewManager {
|
|||
return wtfLeave(s, hostView.ref);
|
||||
}
|
||||
|
||||
_scope_destroyRootHostView: WtfScopeFn = wtfCreateScope('AppViewManager#destroyRootHostView()');
|
||||
_destroyRootHostViewScope: WtfScopeFn = wtfCreateScope('AppViewManager#destroyRootHostView()');
|
||||
/**
|
||||
* Remove the View created with {@link AppViewManager#createRootHostView}.
|
||||
*/
|
||||
destroyRootHostView(hostViewRef: HostViewRef) {
|
||||
// Note: Don't put the hostView into the view pool
|
||||
// as it is depending on the element for which it was created.
|
||||
var s = this._scope_destroyRootHostView();
|
||||
var s = this._destroyRootHostViewScope();
|
||||
var hostView = internalView(<ViewRef>hostViewRef);
|
||||
this._renderer.detachFragment(hostView.renderFragment);
|
||||
this._renderer.dehydrateView(hostView.render);
|
||||
|
@ -174,7 +174,7 @@ export class AppViewManager {
|
|||
wtfLeave(s);
|
||||
}
|
||||
|
||||
_scope_createEmbeddedViewInContainer: WtfScopeFn =
|
||||
_createEmbeddedViewInContainerScope: WtfScopeFn =
|
||||
wtfCreateScope('AppViewManager#createEmbeddedViewInContainer()');
|
||||
/**
|
||||
*
|
||||
|
@ -182,7 +182,7 @@ export class AppViewManager {
|
|||
*/
|
||||
createEmbeddedViewInContainer(viewContainerLocation: ElementRef, atIndex: number,
|
||||
templateRef: TemplateRef): ViewRef {
|
||||
var s = this._scope_createEmbeddedViewInContainer();
|
||||
var s = this._createEmbeddedViewInContainerScope();
|
||||
var protoView = internalProtoView(templateRef.protoViewRef);
|
||||
if (protoView.type !== ViewType.EMBEDDED) {
|
||||
throw new BaseException('This method can only be called with embedded ProtoViews!');
|
||||
|
@ -191,7 +191,7 @@ export class AppViewManager {
|
|||
templateRef.elementRef, null));
|
||||
}
|
||||
|
||||
_scope_createHostViewInContainer: WtfScopeFn =
|
||||
_createHostViewInContainerScope: WtfScopeFn =
|
||||
wtfCreateScope('AppViewManager#createHostViewInContainer()');
|
||||
/**
|
||||
*
|
||||
|
@ -200,7 +200,7 @@ export class AppViewManager {
|
|||
createHostViewInContainer(viewContainerLocation: ElementRef, atIndex: number,
|
||||
protoViewRef: ProtoViewRef,
|
||||
imperativelyCreatedInjector: ResolvedBinding[]): HostViewRef {
|
||||
var s = this._scope_createHostViewInContainer();
|
||||
var s = this._createHostViewInContainerScope();
|
||||
var protoView = internalProtoView(protoViewRef);
|
||||
if (protoView.type !== ViewType.HOST) {
|
||||
throw new BaseException('This method can only be called with host ProtoViews!');
|
||||
|
@ -255,27 +255,27 @@ export class AppViewManager {
|
|||
}
|
||||
}
|
||||
|
||||
_scope_destroyViewInContainer = wtfCreateScope('AppViewMananger#destroyViewInContainer()');
|
||||
_destroyViewInContainerScope = wtfCreateScope('AppViewMananger#destroyViewInContainer()');
|
||||
/**
|
||||
*
|
||||
* See {@link AppViewManager#createViewInContainer}.
|
||||
*/
|
||||
destroyViewInContainer(viewContainerLocation: ElementRef, atIndex: number) {
|
||||
var s = this._scope_destroyViewInContainer();
|
||||
var s = this._destroyViewInContainerScope();
|
||||
var parentView = internalView(viewContainerLocation.parentView);
|
||||
var boundElementIndex = viewContainerLocation.boundElementIndex;
|
||||
this._destroyViewInContainer(parentView, boundElementIndex, atIndex);
|
||||
wtfLeave(s);
|
||||
}
|
||||
|
||||
_scope_attachViewInContainer = wtfCreateScope('AppViewMananger#attachViewInContainer()');
|
||||
_attachViewInContainerScope = wtfCreateScope('AppViewMananger#attachViewInContainer()');
|
||||
/**
|
||||
*
|
||||
* See {@link AppViewManager#detachViewInContainer}.
|
||||
*/
|
||||
attachViewInContainer(viewContainerLocation: ElementRef, atIndex: number,
|
||||
viewRef: ViewRef): ViewRef {
|
||||
var s = this._scope_attachViewInContainer();
|
||||
var s = this._attachViewInContainerScope();
|
||||
var view = internalView(viewRef);
|
||||
var parentView = internalView(viewContainerLocation.parentView);
|
||||
var boundElementIndex = viewContainerLocation.boundElementIndex;
|
||||
|
@ -290,13 +290,13 @@ export class AppViewManager {
|
|||
return wtfLeave(s, viewRef);
|
||||
}
|
||||
|
||||
_scope_detachViewInContainer = wtfCreateScope('AppViewMananger#detachViewInContainer()');
|
||||
_detachViewInContainerScope = wtfCreateScope('AppViewMananger#detachViewInContainer()');
|
||||
/**
|
||||
*
|
||||
* See {@link AppViewManager#attachViewInContainer}.
|
||||
*/
|
||||
detachViewInContainer(viewContainerLocation: ElementRef, atIndex: number): ViewRef {
|
||||
var s = this._scope_detachViewInContainer();
|
||||
var s = this._detachViewInContainerScope();
|
||||
var parentView = internalView(viewContainerLocation.parentView);
|
||||
var boundElementIndex = viewContainerLocation.boundElementIndex;
|
||||
var viewContainer = parentView.viewContainers[boundElementIndex];
|
||||
|
|
|
@ -32,7 +32,7 @@ import {wtfLeave, wtfCreateScope, WtfScopeFn} from '../profile/profile';
|
|||
*/
|
||||
@Injectable()
|
||||
export class LifeCycle {
|
||||
static _scope_tick: WtfScopeFn = wtfCreateScope('LifeCycle#tick()');
|
||||
static _tickScope: WtfScopeFn = wtfCreateScope('LifeCycle#tick()');
|
||||
|
||||
_changeDetector: ChangeDetector;
|
||||
_enforceNoNewChanges: boolean;
|
||||
|
@ -74,7 +74,7 @@ export class LifeCycle {
|
|||
throw new BaseException("LifeCycle.tick is called recursively");
|
||||
}
|
||||
|
||||
var s = LifeCycle._scope_tick();
|
||||
var s = LifeCycle._tickScope();
|
||||
try {
|
||||
this._runningTick = true;
|
||||
this._changeDetector.detectChanges();
|
||||
|
|
|
@ -25,7 +25,7 @@ function noopScope(arg0?: any, arg1?: any): any {
|
|||
*
|
||||
* Used to mark scope entry. The return value is used to leave the scope.
|
||||
*
|
||||
* final myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
|
||||
* var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
|
||||
*
|
||||
* someMethod() {
|
||||
* var s = myScope('Foo'); // 'Foo' gets stored in tracing UI
|
||||
|
|
|
@ -50,10 +50,10 @@ export class DomRenderer extends Renderer {
|
|||
this._document = document;
|
||||
}
|
||||
|
||||
_scope_createRootHostView: WtfScopeFn = wtfCreateScope('DomRenderer#createRootHostView()');
|
||||
_createRootHostViewScope: WtfScopeFn = wtfCreateScope('DomRenderer#createRootHostView()');
|
||||
createRootHostView(hostProtoViewRef: RenderProtoViewRef, fragmentCount: number,
|
||||
hostElementSelector: string): RenderViewWithFragments {
|
||||
var s = this._scope_createRootHostView();
|
||||
var s = this._createRootHostViewScope();
|
||||
var hostProtoView = resolveInternalDomProtoView(hostProtoViewRef);
|
||||
var element = DOM.querySelector(this._document, hostElementSelector);
|
||||
if (isBlank(element)) {
|
||||
|
@ -63,9 +63,9 @@ export class DomRenderer extends Renderer {
|
|||
return wtfLeave(s, this._createView(hostProtoView, element));
|
||||
}
|
||||
|
||||
_scope_createView = wtfCreateScope('DomRenderer#createView()');
|
||||
_createViewScope = wtfCreateScope('DomRenderer#createView()');
|
||||
createView(protoViewRef: RenderProtoViewRef, fragmentCount: number): RenderViewWithFragments {
|
||||
var s = this._scope_createView();
|
||||
var s = this._createViewScope();
|
||||
var protoView = resolveInternalDomProtoView(protoViewRef);
|
||||
return wtfLeave(s, this._createView(protoView, null));
|
||||
}
|
||||
|
@ -109,9 +109,9 @@ export class DomRenderer extends Renderer {
|
|||
moveNodesAfterSibling(element, resolveInternalDomFragment(fragmentRef));
|
||||
}
|
||||
|
||||
_scope_detachFragment = wtfCreateScope('DomRenderer#detachFragment()');
|
||||
_detachFragmentScope = wtfCreateScope('DomRenderer#detachFragment()');
|
||||
detachFragment(fragmentRef: RenderFragmentRef) {
|
||||
var s = this._scope_detachFragment();
|
||||
var s = this._detachFragmentScope();
|
||||
var fragmentNodes = resolveInternalDomFragment(fragmentRef);
|
||||
for (var i = 0; i < fragmentNodes.length; i++) {
|
||||
DOM.remove(fragmentNodes[i]);
|
||||
|
@ -201,9 +201,9 @@ export class DomRenderer extends Renderer {
|
|||
DOM.setText(view.boundTextNodes[textNodeIndex], text);
|
||||
}
|
||||
|
||||
_scope_setEventDispatcher = wtfCreateScope('DomRenderer#setEventDispatcher()');
|
||||
_setEventDispatcherScope = wtfCreateScope('DomRenderer#setEventDispatcher()');
|
||||
setEventDispatcher(viewRef: RenderViewRef, dispatcher: any /*api.EventDispatcher*/): void {
|
||||
var s = this._scope_setEventDispatcher();
|
||||
var s = this._setEventDispatcherScope();
|
||||
var view = resolveInternalDomView(viewRef);
|
||||
view.eventDispatcher = dispatcher;
|
||||
wtfLeave(s);
|
||||
|
|
|
@ -15,8 +15,8 @@ export interface NgZoneZone extends Zone { _innerZone: boolean; }
|
|||
* `Zone`. The default `onTurnDone` runs the Angular change detection.
|
||||
*/
|
||||
export class NgZone {
|
||||
_zone_run_scope: WtfScopeFn = wtfCreateScope(`NgZone#run()`);
|
||||
_zone_microtask: WtfScopeFn = wtfCreateScope(`NgZone#microtask()`);
|
||||
_runScope: WtfScopeFn = wtfCreateScope(`NgZone#run()`);
|
||||
_microtaskScope: WtfScopeFn = wtfCreateScope(`NgZone#microtask()`);
|
||||
|
||||
// Code executed in _mountZone does not trigger the onTurnDone.
|
||||
_mountZone;
|
||||
|
@ -141,7 +141,7 @@ export class NgZone {
|
|||
if (this._disabled) {
|
||||
return fn();
|
||||
} else {
|
||||
var s = this._zone_run_scope();
|
||||
var s = this._runScope();
|
||||
try {
|
||||
return this._innerZone.run(fn);
|
||||
} finally {
|
||||
|
@ -175,7 +175,7 @@ export class NgZone {
|
|||
}
|
||||
|
||||
_createInnerZone(zone, enableLongStackTrace) {
|
||||
var _zone_microtask = this._zone_microtask;
|
||||
var microtaskScope = this._microtaskScope;
|
||||
var ngZone = this;
|
||||
var errorHandling;
|
||||
|
||||
|
@ -228,7 +228,7 @@ export class NgZone {
|
|||
return function(fn) {
|
||||
ngZone._pendingMicrotasks++;
|
||||
var microtask = function() {
|
||||
var s = _zone_microtask();
|
||||
var s = microtaskScope();
|
||||
try {
|
||||
fn();
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue