refactor(OutputAst): BuiltinMethod.bind renamed to Bind (#10739)
This commit is contained in:
parent
7f6685e451
commit
e9479b30e8
|
@ -157,7 +157,7 @@ export abstract class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {
|
|||
case o.BuiltinMethod.SubscribeObservable:
|
||||
name = 'subscribe';
|
||||
break;
|
||||
case o.BuiltinMethod.bind:
|
||||
case o.BuiltinMethod.Bind:
|
||||
name = 'bind';
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -260,7 +260,7 @@ export class WritePropExpr extends Expression {
|
|||
export enum BuiltinMethod {
|
||||
ConcatArray,
|
||||
SubscribeObservable,
|
||||
bind
|
||||
Bind
|
||||
}
|
||||
|
||||
export class InvokeMethodExpr extends Expression {
|
||||
|
|
|
@ -159,7 +159,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
|
|||
case o.BuiltinMethod.SubscribeObservable:
|
||||
result = receiver.subscribe({next: args[0]});
|
||||
break;
|
||||
case o.BuiltinMethod.bind:
|
||||
case o.BuiltinMethod.Bind:
|
||||
result = receiver.bind(args[0]);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -277,7 +277,7 @@ class _TsEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisitor
|
|||
case o.BuiltinMethod.SubscribeObservable:
|
||||
name = 'subscribe';
|
||||
break;
|
||||
case o.BuiltinMethod.bind:
|
||||
case o.BuiltinMethod.Bind:
|
||||
name = 'bind';
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -65,7 +65,7 @@ export class CompilePipe {
|
|||
var pipeInstanceSeenFromPureProxy = getPropertyInView(this.instance, callingView, this.view);
|
||||
createPureProxy(
|
||||
pipeInstanceSeenFromPureProxy.prop('transform')
|
||||
.callMethod(o.BuiltinMethod.bind, [pipeInstanceSeenFromPureProxy]),
|
||||
.callMethod(o.BuiltinMethod.Bind, [pipeInstanceSeenFromPureProxy]),
|
||||
args.length, purePipeProxyInstance, callingView);
|
||||
return o.importExpr(Identifiers.castByValue)
|
||||
.callFn([purePipeProxyInstance, pipeInstanceSeenFromPureProxy.prop('transform')])
|
||||
|
|
|
@ -97,7 +97,7 @@ export class CompileEventListener {
|
|||
var listenExpr: any /** TODO #9100 */;
|
||||
var eventListener = o.THIS_EXPR.callMethod(
|
||||
'eventHandler',
|
||||
[o.THIS_EXPR.prop(this._methodName).callMethod(o.BuiltinMethod.bind, [o.THIS_EXPR])]);
|
||||
[o.THIS_EXPR.prop(this._methodName).callMethod(o.BuiltinMethod.Bind, [o.THIS_EXPR])]);
|
||||
if (isPresent(this.eventTarget)) {
|
||||
listenExpr = ViewProperties.renderer.callMethod(
|
||||
'listenGlobal', [o.literal(this.eventTarget), o.literal(this.eventName), eventListener]);
|
||||
|
@ -117,7 +117,7 @@ export class CompileEventListener {
|
|||
this.compileElement.view.subscriptions.push(subscription);
|
||||
var eventListener = o.THIS_EXPR.callMethod(
|
||||
'eventHandler',
|
||||
[o.THIS_EXPR.prop(this._methodName).callMethod(o.BuiltinMethod.bind, [o.THIS_EXPR])]);
|
||||
[o.THIS_EXPR.prop(this._methodName).callMethod(o.BuiltinMethod.Bind, [o.THIS_EXPR])]);
|
||||
this.compileElement.view.createMethod.addStmt(
|
||||
subscription
|
||||
.set(directiveInstance.prop(observablePropName)
|
||||
|
|
|
@ -95,7 +95,7 @@ export function main() {
|
|||
|
||||
expect(
|
||||
emitStmt(
|
||||
o.variable('fn').callMethod(o.BuiltinMethod.bind, [o.variable('someObj')]).toStmt()))
|
||||
o.variable('fn').callMethod(o.BuiltinMethod.Bind, [o.variable('someObj')]).toStmt()))
|
||||
.toEqual('fn.bind(someObj);');
|
||||
});
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ var _getExpressionsStmts: o.Statement[] = [
|
|||
'invokeMethodExternalInstanceViaBind',
|
||||
o.variable('externalInstance')
|
||||
.prop('someMethod')
|
||||
.callMethod(o.BuiltinMethod.bind, [o.variable('externalInstance')])
|
||||
.callMethod(o.BuiltinMethod.Bind, [o.variable('externalInstance')])
|
||||
.callFn([o.literal('someParam')])
|
||||
],
|
||||
[
|
||||
|
@ -124,7 +124,7 @@ var _getExpressionsStmts: o.Statement[] = [
|
|||
'invokeMethodDynamicInstanceViaBind',
|
||||
o.variable('dynamicInstance')
|
||||
.prop('dynamicMethod')
|
||||
.callMethod(o.BuiltinMethod.bind, [o.variable('dynamicInstance')])
|
||||
.callMethod(o.BuiltinMethod.Bind, [o.variable('dynamicInstance')])
|
||||
.callFn([o.literal('someParam')])
|
||||
],
|
||||
[
|
||||
|
|
|
@ -97,7 +97,7 @@ export function main() {
|
|||
|
||||
expect(
|
||||
emitStmt(
|
||||
o.variable('fn').callMethod(o.BuiltinMethod.bind, [o.variable('someObj')]).toStmt()))
|
||||
o.variable('fn').callMethod(o.BuiltinMethod.Bind, [o.variable('someObj')]).toStmt()))
|
||||
.toEqual('fn.bind(someObj);');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue