style: enforce disallowance of object constructor (#33211)
Applying the `prefer-literal` tslint rule to object enforces the style guide rule https://google.github.io/styleguide/jsguide.html#features-objects-ctor PR Close #33211
This commit is contained in:

committed by
Miško Hevery

parent
354f66b904
commit
db4789bf91
@ -33,7 +33,7 @@ export const INJECTOR = new InjectionToken<Injector>(
|
||||
-1 as any // `-1` is used by Ivy DI system as special value to recognize it as `Injector`.
|
||||
);
|
||||
|
||||
const _THROW_IF_NOT_FOUND = new Object();
|
||||
const _THROW_IF_NOT_FOUND = {};
|
||||
export const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
|
||||
|
||||
export const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
|
||||
|
@ -16,7 +16,7 @@ import {ReflectiveDependency, ResolvedReflectiveFactory, ResolvedReflectiveProvi
|
||||
|
||||
|
||||
// Threshold for the dynamic version
|
||||
const UNDEFINED = new Object();
|
||||
const UNDEFINED = {};
|
||||
|
||||
/**
|
||||
* A ReflectiveDependency injection container used for instantiating objects and resolving
|
||||
|
@ -18,7 +18,7 @@ import {stringify} from '../util/stringify';
|
||||
import {DepDef, DepFlags, NgModuleData, NgModuleDefinition, NgModuleProviderDef, NodeFlags} from './types';
|
||||
import {splitDepsDsl, tokenKey} from './util';
|
||||
|
||||
const UNDEFINED_VALUE = new Object();
|
||||
const UNDEFINED_VALUE = {};
|
||||
|
||||
const InjectorRefTokenKey = tokenKey(Injector);
|
||||
const INJECTORRefTokenKey = tokenKey(INJECTOR);
|
||||
|
@ -26,7 +26,7 @@ import {DepFlags, ElementData, NgModuleData, NgModuleDefinition, NodeDef, NodeFl
|
||||
import {markParentViewsForCheck, resolveDefinition, rootRenderNodes, splitNamespace, tokenKey, viewParentEl} from './util';
|
||||
import {attachEmbeddedView, detachEmbeddedView, moveEmbeddedView, renderDetachView} from './view_attach';
|
||||
|
||||
const EMPTY_CONTEXT = new Object();
|
||||
const EMPTY_CONTEXT = {};
|
||||
|
||||
// Attention: this function is called as top level function.
|
||||
// Putting any logic in here will destroy closure tree shaking!
|
||||
|
Reference in New Issue
Block a user