@angular/language-service 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/language-service.umd.js +128 -72
- package/bundles/language-service.umd.min.js +66 -73
- package/package.json +1 -1
- package/src/version.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v8.0.
|
|
2
|
+
* @license Angular v8.0.1
|
|
3
3
|
* (c) 2010-2019 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7481,6 +7481,9 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7481
7481
|
var actionStmts = [];
|
|
7482
7482
|
flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts);
|
|
7483
7483
|
prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
|
|
7484
|
+
if (visitor.usesImplicitReceiver) {
|
|
7485
|
+
localResolver.notifyImplicitReceiverUse();
|
|
7486
|
+
}
|
|
7484
7487
|
var lastIndex = actionStmts.length - 1;
|
|
7485
7488
|
var preventDefaultVar = null;
|
|
7486
7489
|
if (lastIndex >= 0) {
|
|
@@ -7528,6 +7531,9 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7528
7531
|
var visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, interpolationFunction);
|
|
7529
7532
|
var outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression);
|
|
7530
7533
|
var stmts = getStatementsFromVisitor(visitor, bindingId);
|
|
7534
|
+
if (visitor.usesImplicitReceiver) {
|
|
7535
|
+
localResolver.notifyImplicitReceiverUse();
|
|
7536
|
+
}
|
|
7531
7537
|
if (visitor.temporaryCount === 0 && form == BindingForm.TrySimple) {
|
|
7532
7538
|
return new ConvertPropertyBindingResult([], outputExpr);
|
|
7533
7539
|
}
|
|
@@ -7553,6 +7559,9 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7553
7559
|
function convertUpdateArguments(localResolver, contextVariableExpression, expressionWithArgumentsToExtract, bindingId) {
|
|
7554
7560
|
var visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId, undefined);
|
|
7555
7561
|
var outputExpr = expressionWithArgumentsToExtract.visit(visitor, _Mode.Expression);
|
|
7562
|
+
if (visitor.usesImplicitReceiver) {
|
|
7563
|
+
localResolver.notifyImplicitReceiverUse();
|
|
7564
|
+
}
|
|
7556
7565
|
var stmts = getStatementsFromVisitor(visitor, bindingId);
|
|
7557
7566
|
// Removing the first argument, because it was a length for ViewEngine, not Ivy.
|
|
7558
7567
|
var args = outputExpr.args.slice(1);
|
|
@@ -7652,6 +7661,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7652
7661
|
this._resultMap = new Map();
|
|
7653
7662
|
this._currentTemporary = 0;
|
|
7654
7663
|
this.temporaryCount = 0;
|
|
7664
|
+
this.usesImplicitReceiver = false;
|
|
7655
7665
|
}
|
|
7656
7666
|
_AstToIrVisitor.prototype.visitBinary = function (ast, mode) {
|
|
7657
7667
|
var op;
|
|
@@ -7731,6 +7741,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7731
7741
|
};
|
|
7732
7742
|
_AstToIrVisitor.prototype.visitImplicitReceiver = function (ast, mode) {
|
|
7733
7743
|
ensureExpressionMode(mode, ast);
|
|
7744
|
+
this.usesImplicitReceiver = true;
|
|
7734
7745
|
return this._implicitReceiver;
|
|
7735
7746
|
};
|
|
7736
7747
|
_AstToIrVisitor.prototype.visitInterpolation = function (ast, mode) {
|
|
@@ -7794,11 +7805,15 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7794
7805
|
}
|
|
7795
7806
|
else {
|
|
7796
7807
|
var args = this.visitAll(ast.args, _Mode.Expression);
|
|
7808
|
+
var prevUsesImplicitReceiver = this.usesImplicitReceiver;
|
|
7797
7809
|
var result = null;
|
|
7798
7810
|
var receiver = this._visit(ast.receiver, _Mode.Expression);
|
|
7799
7811
|
if (receiver === this._implicitReceiver) {
|
|
7800
7812
|
var varExpr = this._getLocal(ast.name);
|
|
7801
7813
|
if (varExpr) {
|
|
7814
|
+
// Restore the previous "usesImplicitReceiver" state since the implicit
|
|
7815
|
+
// receiver has been replaced with a resolved local expression.
|
|
7816
|
+
this.usesImplicitReceiver = prevUsesImplicitReceiver;
|
|
7802
7817
|
result = varExpr.callFn(args);
|
|
7803
7818
|
}
|
|
7804
7819
|
}
|
|
@@ -7821,9 +7836,15 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7821
7836
|
}
|
|
7822
7837
|
else {
|
|
7823
7838
|
var result = null;
|
|
7839
|
+
var prevUsesImplicitReceiver = this.usesImplicitReceiver;
|
|
7824
7840
|
var receiver = this._visit(ast.receiver, _Mode.Expression);
|
|
7825
7841
|
if (receiver === this._implicitReceiver) {
|
|
7826
7842
|
result = this._getLocal(ast.name);
|
|
7843
|
+
if (result) {
|
|
7844
|
+
// Restore the previous "usesImplicitReceiver" state since the implicit
|
|
7845
|
+
// receiver has been replaced with a resolved local expression.
|
|
7846
|
+
this.usesImplicitReceiver = prevUsesImplicitReceiver;
|
|
7847
|
+
}
|
|
7827
7848
|
}
|
|
7828
7849
|
if (result == null) {
|
|
7829
7850
|
result = receiver.prop(ast.name);
|
|
@@ -7833,6 +7854,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7833
7854
|
};
|
|
7834
7855
|
_AstToIrVisitor.prototype.visitPropertyWrite = function (ast, mode) {
|
|
7835
7856
|
var receiver = this._visit(ast.receiver, _Mode.Expression);
|
|
7857
|
+
var prevUsesImplicitReceiver = this.usesImplicitReceiver;
|
|
7836
7858
|
var varExpr = null;
|
|
7837
7859
|
if (receiver === this._implicitReceiver) {
|
|
7838
7860
|
var localExpr = this._getLocal(ast.name);
|
|
@@ -7842,6 +7864,9 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7842
7864
|
// to a 'context.property' value and will be used as the target of the
|
|
7843
7865
|
// write expression.
|
|
7844
7866
|
varExpr = localExpr;
|
|
7867
|
+
// Restore the previous "usesImplicitReceiver" state since the implicit
|
|
7868
|
+
// receiver has been replaced with a resolved local expression.
|
|
7869
|
+
this.usesImplicitReceiver = prevUsesImplicitReceiver;
|
|
7845
7870
|
}
|
|
7846
7871
|
else {
|
|
7847
7872
|
// Otherwise it's an error.
|
|
@@ -7903,7 +7928,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
7903
7928
|
// / \ / \
|
|
7904
7929
|
// . c . e
|
|
7905
7930
|
// / \ / \
|
|
7906
|
-
// a b
|
|
7931
|
+
// a b . d
|
|
7907
7932
|
// / \
|
|
7908
7933
|
// . c
|
|
7909
7934
|
// / \
|
|
@@ -8062,6 +8087,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
8062
8087
|
var DefaultLocalResolver = /** @class */ (function () {
|
|
8063
8088
|
function DefaultLocalResolver() {
|
|
8064
8089
|
}
|
|
8090
|
+
DefaultLocalResolver.prototype.notifyImplicitReceiverUse = function () { };
|
|
8065
8091
|
DefaultLocalResolver.prototype.getLocal = function (name) {
|
|
8066
8092
|
if (name === EventHandlerVars.event.name) {
|
|
8067
8093
|
return EventHandlerVars.event;
|
|
@@ -15386,8 +15412,6 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15386
15412
|
* Use of this source code is governed by an MIT-style license that can be
|
|
15387
15413
|
* found in the LICENSE file at https://angular.io/license
|
|
15388
15414
|
*/
|
|
15389
|
-
// Default selector used by `<ng-content>` if none specified
|
|
15390
|
-
var DEFAULT_NG_CONTENT_SELECTOR = '*';
|
|
15391
15415
|
// Selector attribute name of `<ng-content>`
|
|
15392
15416
|
var NG_CONTENT_SELECT_ATTR$1 = 'select';
|
|
15393
15417
|
// Attribute name of `ngProjectAs`.
|
|
@@ -15399,14 +15423,17 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15399
15423
|
function renderFlagCheckIfStmt(flags, statements) {
|
|
15400
15424
|
return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null, false), statements);
|
|
15401
15425
|
}
|
|
15402
|
-
function prepareEventListenerParameters(eventAst,
|
|
15426
|
+
function prepareEventListenerParameters(eventAst, handlerName, scope) {
|
|
15403
15427
|
if (handlerName === void 0) { handlerName = null; }
|
|
15404
15428
|
if (scope === void 0) { scope = null; }
|
|
15405
15429
|
var type = eventAst.type, name = eventAst.name, target = eventAst.target, phase = eventAst.phase, handler = eventAst.handler;
|
|
15406
15430
|
if (target && !GLOBAL_TARGET_RESOLVERS.has(target)) {
|
|
15407
15431
|
throw new Error("Unexpected global target '" + target + "' defined for '" + name + "' event.\n Supported list of global targets: " + Array.from(GLOBAL_TARGET_RESOLVERS.keys()) + ".");
|
|
15408
15432
|
}
|
|
15409
|
-
var
|
|
15433
|
+
var implicitReceiverExpr = (scope === null || scope.bindingLevel === 0) ?
|
|
15434
|
+
variable(CONTEXT_NAME) :
|
|
15435
|
+
scope.getOrCreateSharedContextVar(0);
|
|
15436
|
+
var bindingExpr = convertActionBinding(scope, implicitReceiverExpr, handler, 'b', function () { return error('Unexpected interpolation'); }, eventAst.handlerSpan);
|
|
15410
15437
|
var statements = [];
|
|
15411
15438
|
if (scope) {
|
|
15412
15439
|
statements.push.apply(statements, __spread(scope.restoreViewStatement()));
|
|
@@ -15478,13 +15505,16 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15478
15505
|
this._pureFunctionSlots = 0;
|
|
15479
15506
|
// Number of binding slots
|
|
15480
15507
|
this._bindingSlots = 0;
|
|
15481
|
-
//
|
|
15482
|
-
|
|
15483
|
-
//
|
|
15484
|
-
this.
|
|
15508
|
+
// Projection slots found in the template. Projection slots can distribute projected
|
|
15509
|
+
// nodes based on a selector, or can just use the wildcard selector to match
|
|
15510
|
+
// all nodes which aren't matching any selector.
|
|
15511
|
+
this._ngContentReservedSlots = [];
|
|
15485
15512
|
// Number of non-default selectors found in all parent templates of this template. We need to
|
|
15486
|
-
// track it to properly adjust projection
|
|
15513
|
+
// track it to properly adjust projection slot index in the `projection` instruction.
|
|
15487
15514
|
this._ngContentSelectorsOffset = 0;
|
|
15515
|
+
// Expression that should be used as implicit receiver when converting template
|
|
15516
|
+
// expressions to output AST.
|
|
15517
|
+
this._implicitReceiverExpr = null;
|
|
15488
15518
|
// These should be handled in the template or element directly.
|
|
15489
15519
|
this.visitReference = invalid$1;
|
|
15490
15520
|
this.visitVariable = invalid$1;
|
|
@@ -15557,15 +15587,17 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15557
15587
|
// Nested templates must be processed before creation instructions so template()
|
|
15558
15588
|
// instructions can be generated with the correct internal const count.
|
|
15559
15589
|
this._nestedTemplateFns.forEach(function (buildTemplateFn) { return buildTemplateFn(); });
|
|
15560
|
-
// Output the `projectionDef` instruction when some `<ng-content>` are present.
|
|
15561
|
-
// The `projectionDef` instruction only emitted for the component template and
|
|
15562
|
-
// nested templates (<ng-template> tags).
|
|
15563
|
-
if (this.level === 0 && this.
|
|
15590
|
+
// Output the `projectionDef` instruction when some `<ng-content>` tags are present.
|
|
15591
|
+
// The `projectionDef` instruction is only emitted for the component template and
|
|
15592
|
+
// is skipped for nested templates (<ng-template> tags).
|
|
15593
|
+
if (this.level === 0 && this._ngContentReservedSlots.length) {
|
|
15564
15594
|
var parameters = [];
|
|
15565
|
-
//
|
|
15566
|
-
if
|
|
15567
|
-
|
|
15568
|
-
|
|
15595
|
+
// By default the `projectionDef` instructions creates one slot for the wildcard
|
|
15596
|
+
// selector if no parameters are passed. Therefore we only want to allocate a new
|
|
15597
|
+
// array for the projection slots if the default projection slot is not sufficient.
|
|
15598
|
+
if (this._ngContentReservedSlots.length > 1 || this._ngContentReservedSlots[0] !== '*') {
|
|
15599
|
+
var r3ReservedSlots = this._ngContentReservedSlots.map(function (s) { return s !== '*' ? parseSelectorToR3Selector(s) : s; });
|
|
15600
|
+
parameters.push(this.constantPool.getConstLiteral(asLiteral(r3ReservedSlots), true));
|
|
15569
15601
|
}
|
|
15570
15602
|
// Since we accumulate ngContent selectors while processing template elements,
|
|
15571
15603
|
// we *prepend* `projectionDef` to creation instructions block, to put it before
|
|
@@ -15596,6 +15628,8 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15596
15628
|
};
|
|
15597
15629
|
// LocalResolver
|
|
15598
15630
|
TemplateDefinitionBuilder.prototype.getLocal = function (name) { return this._bindingScope.get(name); };
|
|
15631
|
+
// LocalResolver
|
|
15632
|
+
TemplateDefinitionBuilder.prototype.notifyImplicitReceiverUse = function () { this._bindingScope.notifyImplicitReceiverUse(); };
|
|
15599
15633
|
TemplateDefinitionBuilder.prototype.i18nTranslate = function (message, params, ref, transformFn) {
|
|
15600
15634
|
var _a;
|
|
15601
15635
|
if (params === void 0) { params = {}; }
|
|
@@ -15733,7 +15767,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15733
15767
|
var _a = this.i18n, index = _a.index, bindings = _a.bindings;
|
|
15734
15768
|
if (bindings.size) {
|
|
15735
15769
|
bindings.forEach(function (binding) {
|
|
15736
|
-
_this.updateInstruction(index, span, Identifiers$1.i18nExp, function () { return [_this.convertPropertyBinding(
|
|
15770
|
+
_this.updateInstruction(index, span, Identifiers$1.i18nExp, function () { return [_this.convertPropertyBinding(binding)]; });
|
|
15737
15771
|
});
|
|
15738
15772
|
this.updateInstruction(index, span, Identifiers$1.i18nApply, [literal(index)]);
|
|
15739
15773
|
}
|
|
@@ -15743,13 +15777,11 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15743
15777
|
this.i18n = null; // reset local i18n context
|
|
15744
15778
|
};
|
|
15745
15779
|
TemplateDefinitionBuilder.prototype.visitContent = function (ngContent) {
|
|
15746
|
-
this._hasNgContent = true;
|
|
15747
15780
|
var slot = this.allocateDataSlot();
|
|
15748
|
-
var
|
|
15749
|
-
0 :
|
|
15750
|
-
this._ngContentSelectors.push(ngContent.selector) + this._ngContentSelectorsOffset;
|
|
15781
|
+
var projectionSlotIdx = this._ngContentSelectorsOffset + this._ngContentReservedSlots.length;
|
|
15751
15782
|
var parameters = [literal(slot)];
|
|
15752
15783
|
var attributes = [];
|
|
15784
|
+
this._ngContentReservedSlots.push(ngContent.selector);
|
|
15753
15785
|
ngContent.attributes.forEach(function (attribute) {
|
|
15754
15786
|
var name = attribute.name, value = attribute.value;
|
|
15755
15787
|
if (name === NG_PROJECT_AS_ATTR_NAME) {
|
|
@@ -15760,10 +15792,10 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15760
15792
|
}
|
|
15761
15793
|
});
|
|
15762
15794
|
if (attributes.length > 0) {
|
|
15763
|
-
parameters.push(literal(
|
|
15795
|
+
parameters.push(literal(projectionSlotIdx), literalArr(attributes));
|
|
15764
15796
|
}
|
|
15765
|
-
else if (
|
|
15766
|
-
parameters.push(literal(
|
|
15797
|
+
else if (projectionSlotIdx !== 0) {
|
|
15798
|
+
parameters.push(literal(projectionSlotIdx));
|
|
15767
15799
|
}
|
|
15768
15800
|
this.creationInstruction(ngContent.sourceSpan, Identifiers$1.projection, parameters);
|
|
15769
15801
|
};
|
|
@@ -15871,7 +15903,6 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15871
15903
|
if (currentNamespace !== wasInNamespace) {
|
|
15872
15904
|
this.addNamespaceInstruction(currentNamespace, element);
|
|
15873
15905
|
}
|
|
15874
|
-
var implicit = variable(CONTEXT_NAME);
|
|
15875
15906
|
if (this.i18n) {
|
|
15876
15907
|
this.i18n.appendElement(element.i18n, elementIndex);
|
|
15877
15908
|
}
|
|
@@ -15913,7 +15944,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15913
15944
|
i18nAttrArgs_1.push(literal(attr.name), _this.i18nTranslate(message, params));
|
|
15914
15945
|
converted.expressions.forEach(function (expression) {
|
|
15915
15946
|
hasBindings_1 = true;
|
|
15916
|
-
var binding = _this.convertExpressionBinding(
|
|
15947
|
+
var binding = _this.convertExpressionBinding(expression);
|
|
15917
15948
|
_this.updateInstruction(elementIndex, element.sourceSpan, Identifiers$1.i18nExp, [binding]);
|
|
15918
15949
|
});
|
|
15919
15950
|
}
|
|
@@ -15934,7 +15965,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15934
15965
|
// designed to run inside of `elementStart` and `elementEnd`. The update instructions
|
|
15935
15966
|
// (things like `elementStyleProp`, `elementClassProp`, etc..) are applied later on in this
|
|
15936
15967
|
// file
|
|
15937
|
-
this.processStylingInstruction(
|
|
15968
|
+
this.processStylingInstruction(stylingBuilder.buildElementStylingInstruction(element.sourceSpan, this.constantPool), true);
|
|
15938
15969
|
// Generate Listeners (outputs)
|
|
15939
15970
|
element.outputs.forEach(function (outputAst) {
|
|
15940
15971
|
_this.creationInstruction(outputAst.sourceSpan, Identifiers$1.listener, _this.prepareListenerParameter(element.name, outputAst, elementIndex));
|
|
@@ -15951,7 +15982,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15951
15982
|
// and assign in the code below.
|
|
15952
15983
|
stylingBuilder.buildUpdateLevelInstructions(this._valueConverter).forEach(function (instruction) {
|
|
15953
15984
|
_this._bindingSlots += instruction.allocateBindingSlots;
|
|
15954
|
-
_this.processStylingInstruction(
|
|
15985
|
+
_this.processStylingInstruction(instruction, false);
|
|
15955
15986
|
});
|
|
15956
15987
|
// the reason why `undefined` is used is because the renderer understands this as a
|
|
15957
15988
|
// special value to symbolize that there is no RHS to this binding
|
|
@@ -15977,7 +16008,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
15977
16008
|
_this.updateInstruction(elementIndex, input.sourceSpan, Identifiers$1.property, function () {
|
|
15978
16009
|
return [
|
|
15979
16010
|
literal(bindingName_1),
|
|
15980
|
-
(hasValue_1 ? _this.convertPropertyBinding(
|
|
16011
|
+
(hasValue_1 ? _this.convertPropertyBinding(value_1, /* skipBindFn */ true) :
|
|
15981
16012
|
emptyValueBindInstruction),
|
|
15982
16013
|
];
|
|
15983
16014
|
});
|
|
@@ -16010,15 +16041,13 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16010
16041
|
if (inputType === 0 /* Property */) {
|
|
16011
16042
|
if (value_2 instanceof Interpolation) {
|
|
16012
16043
|
_this.updateInstruction(elementIndex, input.sourceSpan, getPropertyInterpolationExpression(value_2), function () {
|
|
16013
|
-
return __spread([literal(attrName_1)], _this.getUpdateInstructionArguments(
|
|
16044
|
+
return __spread([literal(attrName_1)], _this.getUpdateInstructionArguments(value_2), params_2);
|
|
16014
16045
|
});
|
|
16015
16046
|
}
|
|
16016
16047
|
else {
|
|
16017
16048
|
// Bound, un-interpolated properties
|
|
16018
16049
|
_this.updateInstruction(elementIndex, input.sourceSpan, Identifiers$1.property, function () {
|
|
16019
|
-
return __spread([
|
|
16020
|
-
literal(attrName_1), _this.convertPropertyBinding(implicit, value_2, true)
|
|
16021
|
-
], params_2);
|
|
16050
|
+
return __spread([literal(attrName_1), _this.convertPropertyBinding(value_2, true)], params_2);
|
|
16022
16051
|
});
|
|
16023
16052
|
}
|
|
16024
16053
|
}
|
|
@@ -16032,8 +16061,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16032
16061
|
}
|
|
16033
16062
|
_this.updateInstruction(elementIndex, input.sourceSpan, instruction_1, function () {
|
|
16034
16063
|
return __spread([
|
|
16035
|
-
literal(elementIndex), literal(attrName_1),
|
|
16036
|
-
_this.convertPropertyBinding(implicit, value_2)
|
|
16064
|
+
literal(elementIndex), literal(attrName_1), _this.convertPropertyBinding(value_2)
|
|
16037
16065
|
], params_2);
|
|
16038
16066
|
});
|
|
16039
16067
|
}
|
|
@@ -16094,11 +16122,10 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16094
16122
|
// template definition. e.g. <div *ngIf="showing">{{ foo }}</div> <div #foo></div>
|
|
16095
16123
|
this._nestedTemplateFns.push(function () {
|
|
16096
16124
|
var _a;
|
|
16097
|
-
var templateFunctionExpr = templateVisitor.buildTemplateFunction(template.children, template.variables, _this.
|
|
16125
|
+
var templateFunctionExpr = templateVisitor.buildTemplateFunction(template.children, template.variables, _this._ngContentReservedSlots.length + _this._ngContentSelectorsOffset, template.i18n);
|
|
16098
16126
|
_this.constantPool.statements.push(templateFunctionExpr.toDeclStmt(templateName, null));
|
|
16099
|
-
if (templateVisitor.
|
|
16100
|
-
_this.
|
|
16101
|
-
(_a = _this._ngContentSelectors).push.apply(_a, __spread(templateVisitor._ngContentSelectors));
|
|
16127
|
+
if (templateVisitor._ngContentReservedSlots.length) {
|
|
16128
|
+
(_a = _this._ngContentReservedSlots).push.apply(_a, __spread(templateVisitor._ngContentReservedSlots));
|
|
16102
16129
|
}
|
|
16103
16130
|
});
|
|
16104
16131
|
// e.g. template(1, MyComp_Template_1)
|
|
@@ -16107,12 +16134,11 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16107
16134
|
return trimTrailingNulls(parameters);
|
|
16108
16135
|
});
|
|
16109
16136
|
// handle property bindings e.g. ɵɵproperty('ngForOf', ctx.items), et al;
|
|
16110
|
-
|
|
16111
|
-
this.templatePropertyBindings(template, templateIndex, context, template.templateAttrs);
|
|
16137
|
+
this.templatePropertyBindings(template, templateIndex, template.templateAttrs);
|
|
16112
16138
|
// Only add normal input/output binding instructions on explicit ng-template elements.
|
|
16113
16139
|
if (template.tagName === NG_TEMPLATE_TAG_NAME) {
|
|
16114
16140
|
// Add the input bindings
|
|
16115
|
-
this.templatePropertyBindings(template, templateIndex,
|
|
16141
|
+
this.templatePropertyBindings(template, templateIndex, template.inputs);
|
|
16116
16142
|
// Generate listeners for directive output
|
|
16117
16143
|
template.outputs.forEach(function (outputAst) {
|
|
16118
16144
|
_this.creationInstruction(outputAst.sourceSpan, Identifiers$1.listener, _this.prepareListenerParameter('ng_template', outputAst, templateIndex));
|
|
@@ -16134,7 +16160,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16134
16160
|
this.creationInstruction(text.sourceSpan, Identifiers$1.text, [literal(nodeIndex)]);
|
|
16135
16161
|
var value = text.value.visit(this._valueConverter);
|
|
16136
16162
|
this.allocateBindingSlots(value);
|
|
16137
|
-
this.updateInstruction(nodeIndex, text.sourceSpan, Identifiers$1.textBinding, function () { return [literal(nodeIndex), _this.convertPropertyBinding(
|
|
16163
|
+
this.updateInstruction(nodeIndex, text.sourceSpan, Identifiers$1.textBinding, function () { return [literal(nodeIndex), _this.convertPropertyBinding(value)]; });
|
|
16138
16164
|
};
|
|
16139
16165
|
TemplateDefinitionBuilder.prototype.visitText = function (text) {
|
|
16140
16166
|
// when a text element is located within a translatable
|
|
@@ -16181,18 +16207,18 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16181
16207
|
TemplateDefinitionBuilder.prototype.getConstCount = function () { return this._dataIndex; };
|
|
16182
16208
|
TemplateDefinitionBuilder.prototype.getVarCount = function () { return this._pureFunctionSlots; };
|
|
16183
16209
|
TemplateDefinitionBuilder.prototype.getNgContentSelectors = function () {
|
|
16184
|
-
return this.
|
|
16185
|
-
this.constantPool.getConstLiteral(asLiteral(this.
|
|
16210
|
+
return this._ngContentReservedSlots.length ?
|
|
16211
|
+
this.constantPool.getConstLiteral(asLiteral(this._ngContentReservedSlots), true) :
|
|
16186
16212
|
null;
|
|
16187
16213
|
};
|
|
16188
16214
|
TemplateDefinitionBuilder.prototype.bindingContext = function () { return "" + this._bindingContext++; };
|
|
16189
|
-
TemplateDefinitionBuilder.prototype.templatePropertyBindings = function (template, templateIndex,
|
|
16215
|
+
TemplateDefinitionBuilder.prototype.templatePropertyBindings = function (template, templateIndex, attrs) {
|
|
16190
16216
|
var _this = this;
|
|
16191
16217
|
attrs.forEach(function (input) {
|
|
16192
16218
|
if (input instanceof BoundAttribute) {
|
|
16193
16219
|
var value_4 = input.value.visit(_this._valueConverter);
|
|
16194
16220
|
_this.allocateBindingSlots(value_4);
|
|
16195
|
-
_this.updateInstruction(templateIndex, template.sourceSpan, Identifiers$1.property, function () { return [literal(input.name), _this.convertPropertyBinding(
|
|
16221
|
+
_this.updateInstruction(templateIndex, template.sourceSpan, Identifiers$1.property, function () { return [literal(input.name), _this.convertPropertyBinding(value_4, true)]; });
|
|
16196
16222
|
}
|
|
16197
16223
|
});
|
|
16198
16224
|
};
|
|
@@ -16207,11 +16233,11 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16207
16233
|
return instruction(span, reference, params).toStmt();
|
|
16208
16234
|
});
|
|
16209
16235
|
};
|
|
16210
|
-
TemplateDefinitionBuilder.prototype.processStylingInstruction = function (
|
|
16236
|
+
TemplateDefinitionBuilder.prototype.processStylingInstruction = function (instruction, createMode) {
|
|
16211
16237
|
var _this = this;
|
|
16212
16238
|
if (instruction) {
|
|
16213
16239
|
var paramsFn = function () {
|
|
16214
|
-
return instruction.buildParams(function (value) { return _this.convertPropertyBinding(
|
|
16240
|
+
return instruction.buildParams(function (value) { return _this.convertPropertyBinding(value, true); });
|
|
16215
16241
|
};
|
|
16216
16242
|
if (createMode) {
|
|
16217
16243
|
this.creationInstruction(instruction.sourceSpan, instruction.reference, paramsFn);
|
|
@@ -16239,17 +16265,29 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16239
16265
|
TemplateDefinitionBuilder.prototype.allocateBindingSlots = function (value) {
|
|
16240
16266
|
this._bindingSlots += value instanceof Interpolation ? value.expressions.length : 1;
|
|
16241
16267
|
};
|
|
16242
|
-
|
|
16243
|
-
|
|
16268
|
+
/**
|
|
16269
|
+
* Gets an expression that refers to the implicit receiver. The implicit
|
|
16270
|
+
* receiver is always the root level context.
|
|
16271
|
+
*/
|
|
16272
|
+
TemplateDefinitionBuilder.prototype.getImplicitReceiverExpr = function () {
|
|
16273
|
+
if (this._implicitReceiverExpr) {
|
|
16274
|
+
return this._implicitReceiverExpr;
|
|
16275
|
+
}
|
|
16276
|
+
return this._implicitReceiverExpr = this.level === 0 ?
|
|
16277
|
+
variable(CONTEXT_NAME) :
|
|
16278
|
+
this._bindingScope.getOrCreateSharedContextVar(0);
|
|
16279
|
+
};
|
|
16280
|
+
TemplateDefinitionBuilder.prototype.convertExpressionBinding = function (value) {
|
|
16281
|
+
var convertedPropertyBinding = convertPropertyBinding(this, this.getImplicitReceiverExpr(), value, this.bindingContext(), BindingForm.TrySimple);
|
|
16244
16282
|
var valExpr = convertedPropertyBinding.currValExpr;
|
|
16245
16283
|
return importExpr(Identifiers$1.bind).callFn([valExpr]);
|
|
16246
16284
|
};
|
|
16247
|
-
TemplateDefinitionBuilder.prototype.convertPropertyBinding = function (
|
|
16285
|
+
TemplateDefinitionBuilder.prototype.convertPropertyBinding = function (value, skipBindFn) {
|
|
16248
16286
|
var _a;
|
|
16249
16287
|
var interpolationFn = value instanceof Interpolation ? interpolate : function () { return error('Unexpected interpolation'); };
|
|
16250
|
-
var convertedPropertyBinding = convertPropertyBinding(this,
|
|
16251
|
-
(_a = this._tempVariables).push.apply(_a, __spread(convertedPropertyBinding.stmts));
|
|
16288
|
+
var convertedPropertyBinding = convertPropertyBinding(this, this.getImplicitReceiverExpr(), value, this.bindingContext(), BindingForm.TrySimple, interpolationFn);
|
|
16252
16289
|
var valExpr = convertedPropertyBinding.currValExpr;
|
|
16290
|
+
(_a = this._tempVariables).push.apply(_a, __spread(convertedPropertyBinding.stmts));
|
|
16253
16291
|
return value instanceof Interpolation || skipBindFn ? valExpr :
|
|
16254
16292
|
importExpr(Identifiers$1.bind).callFn([valExpr]);
|
|
16255
16293
|
};
|
|
@@ -16257,12 +16295,11 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16257
16295
|
* Gets a list of argument expressions to pass to an update instruction expression. Also updates
|
|
16258
16296
|
* the temp variables state with temp variables that were identified as needing to be created
|
|
16259
16297
|
* while visiting the arguments.
|
|
16260
|
-
* @param contextExpression The expression for the context variable used to create arguments
|
|
16261
16298
|
* @param value The original expression we will be resolving an arguments list from.
|
|
16262
16299
|
*/
|
|
16263
|
-
TemplateDefinitionBuilder.prototype.getUpdateInstructionArguments = function (
|
|
16300
|
+
TemplateDefinitionBuilder.prototype.getUpdateInstructionArguments = function (value) {
|
|
16264
16301
|
var _a;
|
|
16265
|
-
var _b = convertUpdateArguments(this,
|
|
16302
|
+
var _b = convertUpdateArguments(this, this.getImplicitReceiverExpr(), value, this.bindingContext()), args = _b.args, stmts = _b.stmts;
|
|
16266
16303
|
(_a = this._tempVariables).push.apply(_a, __spread(stmts));
|
|
16267
16304
|
return args;
|
|
16268
16305
|
};
|
|
@@ -16381,8 +16418,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16381
16418
|
sanitizeIdentifier(eventName);
|
|
16382
16419
|
var handlerName = _this.templateName + "_" + tagName + "_" + bindingFnName + "_" + index + "_listener";
|
|
16383
16420
|
var scope = _this._bindingScope.nestedScope(_this._bindingScope.bindingLevel);
|
|
16384
|
-
|
|
16385
|
-
return prepareEventListenerParameters(outputAst, context, handlerName, scope);
|
|
16421
|
+
return prepareEventListenerParameters(outputAst, handlerName, scope);
|
|
16386
16422
|
};
|
|
16387
16423
|
};
|
|
16388
16424
|
return TemplateDefinitionBuilder;
|
|
@@ -16602,13 +16638,35 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
16602
16638
|
});
|
|
16603
16639
|
return this;
|
|
16604
16640
|
};
|
|
16641
|
+
// Implemented as part of LocalResolver.
|
|
16605
16642
|
BindingScope.prototype.getLocal = function (name) { return this.get(name); };
|
|
16643
|
+
// Implemented as part of LocalResolver.
|
|
16644
|
+
BindingScope.prototype.notifyImplicitReceiverUse = function () {
|
|
16645
|
+
if (this.bindingLevel !== 0) {
|
|
16646
|
+
// Since the implicit receiver is accessed in an embedded view, we need to
|
|
16647
|
+
// ensure that we declare a shared context variable for the current template
|
|
16648
|
+
// in the update variables.
|
|
16649
|
+
this.map.get(SHARED_CONTEXT_KEY + 0).declare = true;
|
|
16650
|
+
}
|
|
16651
|
+
};
|
|
16606
16652
|
BindingScope.prototype.nestedScope = function (level) {
|
|
16607
16653
|
var newScope = new BindingScope(level, this);
|
|
16608
16654
|
if (level > 0)
|
|
16609
16655
|
newScope.generateSharedContextVar(0);
|
|
16610
16656
|
return newScope;
|
|
16611
16657
|
};
|
|
16658
|
+
/**
|
|
16659
|
+
* Gets or creates a shared context variable and returns its expression. Note that
|
|
16660
|
+
* this does not mean that the shared variable will be declared. Variables in the
|
|
16661
|
+
* binding scope will be only declared if they are used.
|
|
16662
|
+
*/
|
|
16663
|
+
BindingScope.prototype.getOrCreateSharedContextVar = function (retrievalLevel) {
|
|
16664
|
+
var bindingKey = SHARED_CONTEXT_KEY + retrievalLevel;
|
|
16665
|
+
if (!this.map.has(bindingKey)) {
|
|
16666
|
+
this.generateSharedContextVar(retrievalLevel);
|
|
16667
|
+
}
|
|
16668
|
+
return this.map.get(bindingKey).lhs;
|
|
16669
|
+
};
|
|
16612
16670
|
BindingScope.prototype.getSharedContextName = function (retrievalLevel) {
|
|
16613
16671
|
var sharedCtxObj = this.map.get(SHARED_CONTEXT_KEY + retrievalLevel);
|
|
16614
16672
|
return sharedCtxObj && sharedCtxObj.declare ? sharedCtxObj.lhs : null;
|
|
@@ -17255,7 +17313,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
17255
17313
|
// Calculate host event bindings
|
|
17256
17314
|
var eventBindings = bindingParser.createDirectiveHostEventAsts(directiveSummary, hostBindingSourceSpan);
|
|
17257
17315
|
if (eventBindings && eventBindings.length) {
|
|
17258
|
-
var listeners = createHostListeners(
|
|
17316
|
+
var listeners = createHostListeners(eventBindings, meta);
|
|
17259
17317
|
createStatements.push.apply(createStatements, __spread(listeners));
|
|
17260
17318
|
}
|
|
17261
17319
|
// Calculate the host property bindings
|
|
@@ -17391,14 +17449,14 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
17391
17449
|
}
|
|
17392
17450
|
return { bindingName: bindingName, instruction: instruction, isAttribute: !!attrMatches };
|
|
17393
17451
|
}
|
|
17394
|
-
function createHostListeners(
|
|
17452
|
+
function createHostListeners(eventBindings, meta) {
|
|
17395
17453
|
return eventBindings.map(function (binding) {
|
|
17396
17454
|
var bindingName = binding.name && sanitizeIdentifier(binding.name);
|
|
17397
17455
|
var bindingFnName = binding.type === 1 /* Animation */ ?
|
|
17398
17456
|
prepareSyntheticListenerFunctionName(bindingName, binding.targetOrPhase) :
|
|
17399
17457
|
bindingName;
|
|
17400
17458
|
var handlerName = meta.name && bindingName ? meta.name + "_" + bindingFnName + "_HostBindingHandler" : null;
|
|
17401
|
-
var params = prepareEventListenerParameters(BoundEvent.fromParsedEvent(binding),
|
|
17459
|
+
var params = prepareEventListenerParameters(BoundEvent.fromParsedEvent(binding), handlerName);
|
|
17402
17460
|
var instruction = binding.type == 1 /* Animation */ ? Identifiers$1.componentHostSyntheticListener : Identifiers$1.listener;
|
|
17403
17461
|
return importExpr(instruction).callFn(params).toStmt();
|
|
17404
17462
|
});
|
|
@@ -17775,7 +17833,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
17775
17833
|
* Use of this source code is governed by an MIT-style license that can be
|
|
17776
17834
|
* found in the LICENSE file at https://angular.io/license
|
|
17777
17835
|
*/
|
|
17778
|
-
var VERSION$1 = new Version('8.0.
|
|
17836
|
+
var VERSION$1 = new Version('8.0.1');
|
|
17779
17837
|
|
|
17780
17838
|
/**
|
|
17781
17839
|
* @license
|
|
@@ -37462,7 +37520,7 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
37462
37520
|
/**
|
|
37463
37521
|
* @publicApi
|
|
37464
37522
|
*/
|
|
37465
|
-
var VERSION$2 = new Version$1('8.0.
|
|
37523
|
+
var VERSION$2 = new Version$1('8.0.1');
|
|
37466
37524
|
|
|
37467
37525
|
/**
|
|
37468
37526
|
* @license
|
|
@@ -40367,10 +40425,8 @@ define(['exports', 'path', 'typescript', 'fs'], function (exports, path, ts, fs)
|
|
|
40367
40425
|
_this.ngModule = ngModule;
|
|
40368
40426
|
_this.componentType = componentDef.type;
|
|
40369
40427
|
_this.selector = componentDef.selectors[0][0];
|
|
40370
|
-
// The component definition does not include the wildcard ('*') selector in its list.
|
|
40371
|
-
// It is implicitly expected as the first item in the projectable nodes array.
|
|
40372
40428
|
_this.ngContentSelectors =
|
|
40373
|
-
componentDef.ngContentSelectors ?
|
|
40429
|
+
componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
|
|
40374
40430
|
_this.isBoundToModule = !!ngModule;
|
|
40375
40431
|
return _this;
|
|
40376
40432
|
}
|
|
@@ -41217,7 +41273,7 @@ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
|
|
|
41217
41273
|
};
|
|
41218
41274
|
function getPromiseCtor(promiseCtor) {
|
|
41219
41275
|
if (!promiseCtor) {
|
|
41220
|
-
promiseCtor = Promise;
|
|
41276
|
+
promiseCtor = config.Promise || Promise;
|
|
41221
41277
|
}
|
|
41222
41278
|
if (!promiseCtor) {
|
|
41223
41279
|
throw new Error('no Promise impl found');
|
|
@@ -48054,7 +48110,7 @@ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
|
|
|
48054
48110
|
* Use of this source code is governed by an MIT-style license that can be
|
|
48055
48111
|
* found in the LICENSE file at https://angular.io/license
|
|
48056
48112
|
*/
|
|
48057
|
-
var VERSION$3 = new Version$1('8.0.
|
|
48113
|
+
var VERSION$3 = new Version$1('8.0.1');
|
|
48058
48114
|
|
|
48059
48115
|
/**
|
|
48060
48116
|
* @license
|