Repository: angular
Issue: EventEmitter: Gets wrong compiled by Closure Compiler
Labels: area: packaging,freq2: medium,area: compiler,type: use-case,P3

<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.

ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
The EventEmitter class get wrongly compiled in the latest version of Google Closure Compiler (20171203.0.0).
Resulting in `Cannot read property 'prototype' of undefined` error

Code Emittet by 20171203.0.0 (Does not work):
```js
$$jscomp$inherits$$($EventEmitter$$module$node_modules$$angular$core$esm2015$core$$, $module$node_modules$rxjs$Subject$$.$Subject$);
```
The problem in it self, is that the "$Subject$" property is undefind.

Code Emittet by 20171112.0.0 (Does work):
```js
$$jscomp$inherits$$($EventEmitter$$module$node_modules$$angular$core$esm2015$core$$, $module$node_modules$rxjs$Subject$Subject$$);
```
As you can see the difference, is that subject is not a property but the variable it self.

https://github.com/angular/angular/blob/master/packages/core/src/event_emitter.ts#L58

I am not 100% sure if this is an Angular, RxJS or Closure Compiler issue, but hopefully someone can shine some light on it.

## Expected behavior
<!-- Describe what the desired behavior would be. -->
To get compiled correctly.

## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
-->

Create new project with Angular CLI, change project to use EventEmitter.
Compile with Google Closure Compiler (Advarnced and dependency_mode=STRICT)

## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->
As a Google product Angular should compiler correctly with Google Closure Compiler.

## Environment

<pre><code>
Angular version: 5.1.2
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: v8.9.1<!-- run `node --version` -->
- Platform:  Windows

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->
</code></pre>