angular-docs-cn/packages/platform-browser/src
Rado Kirov 294e56d529 refactor(platform-browser): Hoist functions to workaround optimization bug. (#32230)
Technically, function definitions can live anywhere because they are
hoisted. However, in this case Closure optimizations break when exported
function definitions are referred in another static object that is
exported.

The bad pattern is:
```
exports const obj = {f};
export function f() {...}
```

which turns to the following in Closure's module system:
```
goog.module('m');

exports.obj = {f};

function f() {...}
exports.f = f;
```

which badly optimizes to (note module objects are collapsed)
```
var b = a; var a = function() {...};  // now b is undefined.
```

This is an optimizer bug and should be fixed in Closure, but in the
meantime this change is a noop and will unblock other changes we want to
make.

PR Close #32230
2020-02-25 13:12:27 -08:00
..
browser refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
dom fix(ivy): set namespace for host elements of dynamically created components (#35136) 2020-02-07 17:22:53 -08:00
security perf(core): make sanitization tree-shakable in Ivy mode (#31934) 2019-08-15 10:30:12 -07:00
browser.ts refactor(platform-browser): Hoist functions to workaround optimization bug. (#32230) 2020-02-25 13:12:27 -08:00
platform-browser.externs.js fix: create proper externs so that closure does not clobber e.g. `ng` for internal variables (#19423) 2017-09-26 15:02:33 -07:00
platform-browser.ts feat(ivy): make Hammer support tree-shakable (#32203) 2019-08-21 11:43:51 -07:00
private_export.ts perf(core): Make `PlatformLocation` tree-shakable (#32154) 2019-08-29 21:51:56 -07:00
version.ts docs: update platform-browser with `@publicApi` tags (#26595) 2018-10-19 14:35:52 -07:00