refactor: Consistently use index access on index signature types. (#28937)

This change helps highlight certain misoptimizations with Closure
compiler. It is also stylistically preferable to consistently use index
access on index sig types.

Roughly, when one sees '.foo' they know it is always checked for typos
in the prop name by the type system (unless 'any'), while "['foo']" is
always not.

Once all angular repos are conforming this will become a tsetse.info
check, enforced by bazel.

PR Close #28937
This commit is contained in:
Rado Kirov
2019-02-22 14:30:10 -08:00
committed by Igor Minar
parent 2b974d4012
commit 03d2e5cb1d
7 changed files with 14 additions and 14 deletions

View File

@ -10,7 +10,7 @@ import {CompilerFacade, ExportedCompilerFacade} from './compiler_facade_interfac
export * from './compiler_facade_interface';
export function getCompilerFacade(): CompilerFacade {
const globalNg: ExportedCompilerFacade = global.ng;
const globalNg: ExportedCompilerFacade = global['ng'];
if (!globalNg || !globalNg.ɵcompilerFacade) {
throw new Error(
`Angular JIT compilation failed: '@angular/compiler' not loaded!\n` +