angular/packages/compiler-cli/src/ngtsc
George Kalpakas 033aba9351 fix(ngcc): do not emit ES2015 code in ES5 files (#33514)
Previously, ngcc's `Renderer` would add some constants in the processed
files which were emitted as ES2015 code (e.g. `const` declarations).
This would result in invalid ES5 generated code that would break when
run on browsers that do not support the emitted format.

This commit fixes it by adding a `printStatement()` method to
`RenderingFormatter`, which can convert statements to JavaScript code in
a suitable format for the corresponding `RenderingFormatter`.
Additionally, the `translateExpression()` and `translateStatement()`
ngtsc helper methods are augmented to accept an extra hint to know
whether the code needs to be translated to ES5 format or not.

Fixes #32665

PR Close #33514
2019-11-13 13:49:31 -08:00
..
annotations fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
cycles refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
diagnostics fix(ivy): don't crash on unknown pipe (#33454) 2019-10-31 23:43:32 +00:00
entry_point refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
file_system refactor(compiler-cli): remove unused method FileSystem#mkdir() (#33237) 2019-10-21 11:26:57 -04:00
imports feat(ivy): enable re-export of the compilation scope of NgModules privately (#33177) 2019-10-22 13:14:31 -04:00
incremental fix(ivy): ensure module scope is rebuild on dependent change (#33522) 2019-11-12 13:56:30 -08:00
indexer fix(ivy): support abstract directives in template type checking (#33131) 2019-10-24 12:44:30 -07:00
metadata fix(ivy): support abstract directives in template type checking (#33131) 2019-10-24 12:44:30 -07:00
partial_evaluator fix(ngcc): handle new __spreadArrays tslib helper (#33617) 2019-11-06 19:43:07 +00:00
perf refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
reflection fix(ngcc): handle new __spreadArrays tslib helper (#33617) 2019-11-06 19:43:07 +00:00
routing build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
scope fix(ivy): support abstract directives in template type checking (#33131) 2019-10-24 12:44:30 -07:00
shims fix(compiler-cli): Pass SourceFile to getFullText() (#33660) 2019-11-07 16:47:07 -08:00
switch build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
testing refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
transform fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
translator fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
typecheck fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
util feat: typescript 3.6 support (#32946) 2019-10-18 13:15:16 -04:00
program.ts refactor(ivy): remove ngBaseDef (#33264) 2019-10-25 13:11:34 -07:00
resource_loader.ts fix(ivy): handle rooted resource paths correctly (#31511) 2019-07-11 11:42:33 -04:00
synthetic_files_compiler_host.ts feat: add support for TypeScript 3.3 (and drop older versions) (#29004) 2019-03-13 10:38:37 -07:00
tsc_plugin.ts refactor(ivy): use ClassDeclaration in more ReflectionHost methods (#29209) 2019-03-21 22:20:23 +00:00