angular/packages/compiler-cli/ngcc/src/rendering
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
..
commonjs_rendering_formatter.ts feat(ngcc): enable private NgModule re-exports in ngcc on request (#33177) 2019-10-22 13:14:31 -04:00
dts_renderer.ts fix(ngcc): add reexports only once (#33658) 2019-11-07 20:29:13 +00:00
esm5_rendering_formatter.ts fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
esm_rendering_formatter.ts fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
ngcc_import_rewriter.ts refactor(ivy): move ngcc into a higher level folder (#29092) 2019-03-20 14:45:54 -04:00
renderer.ts fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
rendering_formatter.ts fix(ngcc): do not emit ES2015 code in ES5 files (#33514) 2019-11-13 13:49:31 -08:00
source_maps.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
umd_rendering_formatter.ts feat(ngcc): enable private NgModule re-exports in ngcc on request (#33177) 2019-10-22 13:14:31 -04:00
utils.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00