@angular/language-service 7.2.7 → 7.2.11

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v7.2.7
2
+ * @license Angular v7.2.11
3
3
  * (c) 2010-2019 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10212,11 +10212,9 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
10212
10212
  }
10213
10213
  return TokenizeResult;
10214
10214
  }());
10215
- function tokenize(source, url, getTagDefinition, tokenizeExpansionForms, interpolationConfig) {
10216
- if (tokenizeExpansionForms === void 0) { tokenizeExpansionForms = false; }
10217
- if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
10218
- return new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, tokenizeExpansionForms, interpolationConfig)
10219
- .tokenize();
10215
+ function tokenize(source, url, getTagDefinition, options) {
10216
+ if (options === void 0) { options = {}; }
10217
+ return new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, options).tokenize();
10220
10218
  }
10221
10219
  var _CR_OR_CRLF_REGEXP = /\r\n?/g;
10222
10220
  function _unexpectedCharacterErrorMsg(charCode) {
@@ -10240,22 +10238,22 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
10240
10238
  * @param _tokenizeIcu Whether to tokenize ICU messages (considered as text nodes when false)
10241
10239
  * @param _interpolationConfig
10242
10240
  */
10243
- function _Tokenizer(_file, _getTagDefinition, _tokenizeIcu, _interpolationConfig) {
10244
- if (_interpolationConfig === void 0) { _interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
10241
+ function _Tokenizer(_file, _getTagDefinition, options) {
10245
10242
  this._file = _file;
10246
10243
  this._getTagDefinition = _getTagDefinition;
10247
- this._tokenizeIcu = _tokenizeIcu;
10248
- this._interpolationConfig = _interpolationConfig;
10249
- // Note: this is always lowercase!
10250
10244
  this._peek = -1;
10251
10245
  this._nextPeek = -1;
10252
10246
  this._index = -1;
10253
10247
  this._line = 0;
10254
10248
  this._column = -1;
10249
+ this._currentTokenStart = null;
10250
+ this._currentTokenType = null;
10255
10251
  this._expansionCaseStack = [];
10256
10252
  this._inInterpolation = false;
10257
10253
  this.tokens = [];
10258
10254
  this.errors = [];
10255
+ this._tokenizeIcu = options.tokenizeExpansionForms || false;
10256
+ this._interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;
10259
10257
  this._input = _file.content;
10260
10258
  this._length = _file.content.length;
10261
10259
  this._advance();
@@ -10347,6 +10345,12 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
10347
10345
  };
10348
10346
  _Tokenizer.prototype._endToken = function (parts, end) {
10349
10347
  if (end === void 0) { end = this._getLocation(); }
10348
+ if (this._currentTokenStart === null) {
10349
+ throw new TokenError('Programming error - attempted to end a token when there was no start to the token', this._currentTokenType, this._getSpan(end, end));
10350
+ }
10351
+ if (this._currentTokenType === null) {
10352
+ throw new TokenError('Programming error - attempted to end a token which has no token type', null, this._getSpan(this._currentTokenStart, end));
10353
+ }
10350
10354
  var token = new Token$1(this._currentTokenType, parts, new ParseSourceSpan(this._currentTokenStart, end));
10351
10355
  this.tokens.push(token);
10352
10356
  this._currentTokenStart = null;
@@ -10840,10 +10844,8 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
10840
10844
  function Parser(getTagDefinition) {
10841
10845
  this.getTagDefinition = getTagDefinition;
10842
10846
  }
10843
- Parser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
10844
- if (parseExpansionForms === void 0) { parseExpansionForms = false; }
10845
- if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
10846
- var tokensAndErrors = tokenize(source, url, this.getTagDefinition, parseExpansionForms, interpolationConfig);
10847
+ Parser.prototype.parse = function (source, url, options) {
10848
+ var tokensAndErrors = tokenize(source, url, this.getTagDefinition, options);
10847
10849
  var treeAndErrors = new _TreeBuilder(tokensAndErrors.tokens, this.getTagDefinition).build();
10848
10850
  return new ParseTreeResult(treeAndErrors.rootNodes, tokensAndErrors.errors.concat(treeAndErrors.errors));
10849
10851
  };
@@ -11177,10 +11179,8 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
11177
11179
  function HtmlParser() {
11178
11180
  return _super.call(this, getHtmlTagDefinition) || this;
11179
11181
  }
11180
- HtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
11181
- if (parseExpansionForms === void 0) { parseExpansionForms = false; }
11182
- if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
11183
- return _super.prototype.parse.call(this, source, url, parseExpansionForms, interpolationConfig);
11182
+ HtmlParser.prototype.parse = function (source, url, options) {
11183
+ return _super.prototype.parse.call(this, source, url, options);
11184
11184
  };
11185
11185
  return HtmlParser;
11186
11186
  }(Parser$1));
@@ -14595,13 +14595,14 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
14595
14595
  *
14596
14596
  * @param template text of the template to parse
14597
14597
  * @param templateUrl URL to use for source mapping of the parsed template
14598
+ * @param options options to modify how the template is parsed
14598
14599
  */
14599
14600
  function parseTemplate(template, templateUrl, options) {
14600
14601
  if (options === void 0) { options = {}; }
14601
14602
  var interpolationConfig = options.interpolationConfig, preserveWhitespaces = options.preserveWhitespaces;
14602
14603
  var bindingParser = makeBindingParser(interpolationConfig);
14603
14604
  var htmlParser = new HtmlParser();
14604
- var parseResult = htmlParser.parse(template, templateUrl, true, interpolationConfig);
14605
+ var parseResult = htmlParser.parse(template, templateUrl, __assign({}, options, { tokenizeExpansionForms: true }));
14605
14606
  if (parseResult.errors && parseResult.errors.length > 0) {
14606
14607
  return { errors: parseResult.errors, nodes: [] };
14607
14608
  }
@@ -15299,7 +15300,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
15299
15300
  InterpolationConfig.fromArray(facade.interpolation) :
15300
15301
  DEFAULT_INTERPOLATION_CONFIG;
15301
15302
  // Parse the template and check for errors.
15302
- var template = parseTemplate(facade.template, sourceMapUrl, { preserveWhitespaces: facade.preserveWhitespaces || false, interpolationConfig: interpolationConfig });
15303
+ var template = parseTemplate(facade.template, sourceMapUrl, { preserveWhitespaces: facade.preserveWhitespaces, interpolationConfig: interpolationConfig });
15303
15304
  if (template.errors !== undefined) {
15304
15305
  var errors = template.errors.map(function (err) { return err.toString(); }).join(', ');
15305
15306
  throw new Error("Errors during JIT compilation of template for " + facade.name + ": " + errors);
@@ -15440,7 +15441,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
15440
15441
  * Use of this source code is governed by an MIT-style license that can be
15441
15442
  * found in the LICENSE file at https://angular.io/license
15442
15443
  */
15443
- var VERSION$1 = new Version('7.2.7');
15444
+ var VERSION$1 = new Version('7.2.11');
15444
15445
 
15445
15446
  /**
15446
15447
  * @license
@@ -15890,7 +15891,8 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
15890
15891
  DirectiveNormalizer.prototype._preparseLoadedTemplate = function (prenormData, template, templateAbsUrl) {
15891
15892
  var isInline = !!prenormData.template;
15892
15893
  var interpolationConfig = InterpolationConfig.fromArray(prenormData.interpolation);
15893
- var rootNodesAndErrors = this._htmlParser.parse(template, templateSourceUrl({ reference: prenormData.ngModuleType }, { type: { reference: prenormData.componentType } }, { isInline: isInline, templateUrl: templateAbsUrl }), true, interpolationConfig);
15894
+ var templateUrl = templateSourceUrl({ reference: prenormData.ngModuleType }, { type: { reference: prenormData.componentType } }, { isInline: isInline, templateUrl: templateAbsUrl });
15895
+ var rootNodesAndErrors = this._htmlParser.parse(template, templateUrl, { tokenizeExpansionForms: true, interpolationConfig: interpolationConfig });
15894
15896
  if (rootNodesAndErrors.errors.length > 0) {
15895
15897
  var errorString = rootNodesAndErrors.errors.join('\n');
15896
15898
  throw syntaxError("Template parse errors:\n" + errorString);
@@ -16656,9 +16658,8 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
16656
16658
  function XmlParser() {
16657
16659
  return _super.call(this, getXmlTagDefinition) || this;
16658
16660
  }
16659
- XmlParser.prototype.parse = function (source, url, parseExpansionForms) {
16660
- if (parseExpansionForms === void 0) { parseExpansionForms = false; }
16661
- return _super.prototype.parse.call(this, source, url, parseExpansionForms);
16661
+ XmlParser.prototype.parse = function (source, url, options) {
16662
+ return _super.prototype.parse.call(this, source, url, options);
16662
16663
  };
16663
16664
  return XmlParser;
16664
16665
  }(Parser$1));
@@ -16794,7 +16795,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
16794
16795
  XliffParser.prototype.parse = function (xliff, url) {
16795
16796
  this._unitMlString = null;
16796
16797
  this._msgIdToHtml = {};
16797
- var xml = new XmlParser().parse(xliff, url, false);
16798
+ var xml = new XmlParser().parse(xliff, url);
16798
16799
  this._errors = xml.errors;
16799
16800
  visitAll(this, xml.rootNodes, null);
16800
16801
  return {
@@ -16866,7 +16867,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
16866
16867
  function XmlToI18n() {
16867
16868
  }
16868
16869
  XmlToI18n.prototype.convert = function (message, url) {
16869
- var xmlIcu = new XmlParser().parse(message, url, true);
16870
+ var xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });
16870
16871
  this._errors = xmlIcu.errors;
16871
16872
  var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
16872
16873
  [] : [].concat.apply([], __spread(visitAll(this, xmlIcu.rootNodes)));
@@ -17074,7 +17075,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
17074
17075
  Xliff2Parser.prototype.parse = function (xliff, url) {
17075
17076
  this._unitMlString = null;
17076
17077
  this._msgIdToHtml = {};
17077
- var xml = new XmlParser().parse(xliff, url, false);
17078
+ var xml = new XmlParser().parse(xliff, url);
17078
17079
  this._errors = xml.errors;
17079
17080
  visitAll(this, xml.rootNodes, null);
17080
17081
  return {
@@ -17152,7 +17153,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
17152
17153
  function XmlToI18n() {
17153
17154
  }
17154
17155
  XmlToI18n.prototype.convert = function (message, url) {
17155
- var xmlIcu = new XmlParser().parse(message, url, true);
17156
+ var xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });
17156
17157
  this._errors = xmlIcu.errors;
17157
17158
  var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
17158
17159
  [] : [].concat.apply([], __spread(visitAll(this, xmlIcu.rootNodes)));
@@ -17300,7 +17301,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
17300
17301
  this._msgIdToHtml = {};
17301
17302
  // We can not parse the ICU messages at this point as some messages might not originate
17302
17303
  // from Angular that could not be lex'd.
17303
- var xml = new XmlParser().parse(xtb, url, false);
17304
+ var xml = new XmlParser().parse(xtb, url);
17304
17305
  this._errors = xml.errors;
17305
17306
  visitAll(this, xml.rootNodes);
17306
17307
  return {
@@ -17361,7 +17362,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
17361
17362
  function XmlToI18n() {
17362
17363
  }
17363
17364
  XmlToI18n.prototype.convert = function (message, url) {
17364
- var xmlIcu = new XmlParser().parse(message, url, true);
17365
+ var xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });
17365
17366
  this._errors = xmlIcu.errors;
17366
17367
  var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
17367
17368
  [] :
@@ -17462,7 +17463,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
17462
17463
  var text = this._convertToText(srcMsg);
17463
17464
  // text to html
17464
17465
  var url = srcMsg.nodes[0].sourceSpan.start.file.url;
17465
- var html = new HtmlParser().parse(text, url, true);
17466
+ var html = new HtmlParser().parse(text, url, { tokenizeExpansionForms: true });
17466
17467
  return {
17467
17468
  nodes: html.rootNodes,
17468
17469
  errors: __spread(this._errors, html.errors),
@@ -17587,10 +17588,10 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
17587
17588
  new TranslationBundle({}, null, digest, undefined, missingTranslation, console);
17588
17589
  }
17589
17590
  }
17590
- I18NHtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
17591
- if (parseExpansionForms === void 0) { parseExpansionForms = false; }
17592
- if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
17593
- var parseResult = this._htmlParser.parse(source, url, parseExpansionForms, interpolationConfig);
17591
+ I18NHtmlParser.prototype.parse = function (source, url, options) {
17592
+ if (options === void 0) { options = {}; }
17593
+ var interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;
17594
+ var parseResult = this._htmlParser.parse(source, url, __assign({ interpolationConfig: interpolationConfig }, options));
17594
17595
  if (parseResult.errors.length) {
17595
17596
  return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);
17596
17597
  }
@@ -19748,7 +19749,10 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
19748
19749
  };
19749
19750
  TemplateParser.prototype.tryParse = function (component, template, directives, pipes, schemas, templateUrl, preserveWhitespaces) {
19750
19751
  var htmlParseResult = typeof template === 'string' ?
19751
- this._htmlParser.parse(template, templateUrl, true, this.getInterpolationConfig(component)) :
19752
+ this._htmlParser.parse(template, templateUrl, {
19753
+ tokenizeExpansionForms: true,
19754
+ interpolationConfig: this.getInterpolationConfig(component)
19755
+ }) :
19752
19756
  template;
19753
19757
  if (!preserveWhitespaces) {
19754
19758
  htmlParseResult = removeWhitespaces(htmlParseResult);
@@ -20823,16 +20827,16 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
20823
20827
  return {
20824
20828
  __symbolic: 'error',
20825
20829
  message: "Could not resolve " + module + " relative to " + self.host.getMetadataFor(sourceSymbol.filePath) + ".",
20826
- line: map.line,
20827
- character: map.character,
20830
+ line: map['line'],
20831
+ character: map['character'],
20828
20832
  fileName: getOriginalName()
20829
20833
  };
20830
20834
  }
20831
20835
  return {
20832
20836
  __symbolic: 'resolved',
20833
20837
  symbol: self.getStaticSymbol(filePath, name_1),
20834
- line: map.line,
20835
- character: map.character,
20838
+ line: map['line'],
20839
+ character: map['character'],
20836
20840
  fileName: getOriginalName()
20837
20841
  };
20838
20842
  }
@@ -21116,7 +21120,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
21116
21120
  */
21117
21121
  ToJsonSerializer.prototype.visitStringMap = function (map, context) {
21118
21122
  if (map['__symbolic'] === 'resolved') {
21119
- return visitValue(map.symbol, this, context);
21123
+ return visitValue(map['symbol'], this, context);
21120
21124
  }
21121
21125
  if (map['__symbolic'] === 'error') {
21122
21126
  delete map['line'];
@@ -28182,7 +28186,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
28182
28186
  var expressionParser = new Parser(new Lexer());
28183
28187
  var config = new CompilerConfig();
28184
28188
  var parser = new TemplateParser(config, this.host.resolver.getReflector(), expressionParser, new DomElementSchemaRegistry(), htmlParser, null, []);
28185
- var htmlResult = htmlParser.parse(template.source, '', true);
28189
+ var htmlResult = htmlParser.parse(template.source, '', { tokenizeExpansionForms: true });
28186
28190
  var analyzedModules = this.host.getAnalyzedModules();
28187
28191
  var errors = undefined;
28188
28192
  var ngModule = analyzedModules.ngModuleByPipeOrDirective.get(template.type);
@@ -28720,6 +28724,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
28720
28724
  * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated
28721
28725
  * until reactivated by setting the strategy to `Default` (`CheckAlways`).
28722
28726
  * Change detection can still be explicitly invoked.
28727
+ * This strategy applies to all child directives and cannot be overridden.
28723
28728
  */
28724
28729
  ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
28725
28730
  /**
@@ -33855,7 +33860,7 @@ define(['exports', 'fs', 'path', 'typescript'], function (exports, fs, path, ts)
33855
33860
  /**
33856
33861
  * @publicApi
33857
33862
  */
33858
- var VERSION$2 = new Version$1('7.2.7');
33863
+ var VERSION$2 = new Version$1('7.2.11');
33859
33864
 
33860
33865
  /**
33861
33866
  * @license
@@ -36815,7 +36820,7 @@ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
36815
36820
  }
36816
36821
  };
36817
36822
  /**
36818
- * Does the work of creating the `ngBaseDef` property for the @Input and @Output decorators.
36823
+ * Does the work of creating the `ngBaseDef` property for the `Input` and `Output` decorators.
36819
36824
  * @param key "inputs" or "outputs"
36820
36825
  */
36821
36826
  var updateBaseDefFromIOProp = function (getProp) {
@@ -45140,11 +45145,7 @@ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
45140
45145
  function DummyHtmlParser() {
45141
45146
  return _super !== null && _super.apply(this, arguments) || this;
45142
45147
  }
45143
- DummyHtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {
45144
- if (parseExpansionForms === void 0) { parseExpansionForms = false; }
45145
- if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }
45146
- return new ParseTreeResult([], []);
45147
- };
45148
+ DummyHtmlParser.prototype.parse = function () { return new ParseTreeResult([], []); };
45148
45149
  return DummyHtmlParser;
45149
45150
  }(HtmlParser));
45150
45151
  /**
@@ -46032,7 +46033,7 @@ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
46032
46033
  * Use of this source code is governed by an MIT-style license that can be
46033
46034
  * found in the LICENSE file at https://angular.io/license
46034
46035
  */
46035
- var VERSION$3 = new Version$1('7.2.7');
46036
+ var VERSION$3 = new Version$1('7.2.11');
46036
46037
 
46037
46038
  /**
46038
46039
  * @license