angular-cn/packages
Misko Hevery 33630dd3ed fix(ivy): workaround for tsickle bug (#23379)
The issue is with tsickle type inference and the bug should be assigned to them.

The offending code is:
```
function cacheMatchingDirectivesForNode(
    tNode: TNode, tView: TView, localRefs: string[] | null): void {
  const exportsMap = localRefs ? {'': -1} : null;     // <<<<< ===== OFFENDING LINE
  const matches = tView.currentMatches = findDirectiveMatches(tNode);
  if (matches) {
    for (let i = 0; i < matches.length; i += 2) {
      const def = matches[i] as DirectiveDef<any>;
      const valueIndex = i + 1;
      resolveDirective(def, valueIndex, matches, tView);
      saveNameToExportMap(matches[valueIndex] as number, def, exportsMap);
    }
  }
  if (exportsMap) cacheMatchingLocalNames(tNode, localRefs, exportsMap);
}

```

because it generates invalid js closure code:
```
function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {
    const /** @type {(null|{: number})} */ exportsMap = localRefs ? { '': -1 } : null;      // <<<<< ===== OFFENDING LINE
    const /** @type {(null|!Array<?>)} */ matches = tView.currentMatches = findDirectiveMatches(tNode);
    if (matches) {
        for (let /** @type {number} */ i = 0; i < matches.length; i += 2) {
            const /** @type {!tsickle_forward_declare_11.DirectiveDef<?>} */ def = /** @type {!tsickle_forward_declare_11.DirectiveDef<?>} */ (matches[i]);
            const /** @type {number} */ valueIndex = i + 1;
            resolveDirective(def, valueIndex, matches, tView);
            saveNameToExportMap(/** @type {number} */ (matches[valueIndex]), def, exportsMap);
        }
    }
    if (exportsMap)
        cacheMatchingLocalNames(tNode, localRefs, exportsMap);
}
```

The workaround is to declare the type explicitly such as:

```
const exportsMap: ({[key:string]:number}|null) = localRefs ? {'': -1} : null;
```

which than generates valid closure code:

```
const /** @type {(null|!Object<string,number>)} */ exportsMap = localRefs ? { '': -1 } : null;
```

PR Close #23379
2018-04-13 21:29:39 -07:00
..
animations docs(animations): migrate deprecated `@whatItDoes` tag (#23210) 2018-04-10 21:49:32 -07:00
bazel test: integration tests now against bazel built packages (#22810) 2018-04-13 16:30:50 -07:00
benchpress refactor: ensure all 'TODO's are consistent (#23252) 2018-04-13 13:11:01 -07:00
common refactor: update CLDR data for closure locale & use a const for undefined (#23372) 2018-04-13 16:30:23 -07:00
compiler feat(ivy): support injection even if no injector present (#23345) 2018-04-13 14:29:52 -07:00
compiler-cli refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private (#23371) 2018-04-13 16:20:25 -07:00
core fix(ivy): workaround for tsickle bug (#23379) 2018-04-13 21:29:39 -07:00
docs refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
elements fix(elements): include schematics in npm distro (#23350) 2018-04-13 00:50:04 -07:00
examples fix(common): titlecase pipe (#22600) 2018-03-23 13:42:51 -04:00
forms docs: remove all deprecated `@stable` jsdoc tags (#23210) 2018-04-10 21:49:32 -07:00
http refactor: ensure all 'TODO's are consistent (#23252) 2018-04-13 13:11:01 -07:00
language-service refactor(language-service): fix typo on type.ts language-service 2018-04-13 00:06:26 -07:00
platform-browser feat(platform-browser): add token marking which the type of animation module nearest in the injector tree (#23075) 2018-04-12 23:17:38 -07:00
platform-browser-dynamic docs: remove all deprecated `@stable` jsdoc tags (#23210) 2018-04-10 21:49:32 -07:00
platform-server test: move platform-server integration test (#22810) 2018-04-13 16:30:50 -07:00
platform-webworker refactor: ensure all 'TODO's are consistent (#23252) 2018-04-13 13:11:01 -07:00
platform-webworker-dynamic docs: remove all deprecated `@stable` jsdoc tags (#23210) 2018-04-10 21:49:32 -07:00
router docs: remove all deprecated `@stable` jsdoc tags (#23210) 2018-04-10 21:49:32 -07:00
service-worker fix(service-worker): let `*` match 0 characters in globs (#23339) 2018-04-13 13:13:36 -07:00
upgrade docs(upgrade): fix detail regarding bootstrapping order (#23225) (#23270) 2018-04-12 23:16:18 -07:00
BUILD.bazel feat(bazel): introduce a binary stamping feature (#22176) 2018-02-15 14:08:53 -08:00
README.md Revert "docs: Remove unneeded file (#18106)" 2017-07-20 16:46:47 -05:00
empty.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
es6-subset.d.ts build: switch from npm to yarn (#19328) 2017-09-22 13:20:52 -07:00
goog.d.ts fix(compiler): add typings for `COMPILED`. 2017-09-29 09:26:38 -07:00
license-banner.txt docs(common): update copyright years (#21232) 2018-01-04 17:45:36 -05:00
rollup.config.js refactor: make all rollup config ES5 compatible (#20028) 2017-10-30 23:09:17 -04:00
system.d.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
tsconfig-build.json build: enable importHelpers in tsconfig (#22812) 2018-03-15 21:16:03 -07:00
tsconfig-metadata.json refactor(compiler): bump metadata version to 4 (#19338) 2017-09-26 13:31:59 -07:00
tsconfig.json feat(elements): add schematics (#23298) 2018-04-11 18:13:30 -07:00
types.d.ts build: add bazel test rules for remainder of packages (#21053) 2017-12-22 13:10:51 -08:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT