Skip to content

Commit 9b7378d

Browse files
committed
chore(typings): remove traceur-runtime.d.ts
fixes angular#4297 Closes angular#4415
1 parent fb97961 commit 9b7378d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+144
-258
lines changed

docs/typescript-definition-package/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
5050
createTypeDefinitionFile.typeDefinitions = [
5151
{
5252
id: 'angular2/angular2',
53-
references: ['../es6-promise/es6-promise.d.ts'],
53+
references: ['../es6-shim/es6-shim.d.ts'],
5454
modules: {
5555
'angular2/angular2': {namespace: 'ng', id: 'angular2/angular2'},
5656
'angular2/web_worker/worker': {namespace: 'ngWorker', id: 'angular2/web_worker/worker'},

modules/angular2/manual_typings/traceur-runtime.d.ts

Lines changed: 0 additions & 89 deletions
This file was deleted.

modules/angular2/src/compiler/runtime_metadata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g;
2525

2626
@Injectable()
2727
export class RuntimeMetadataResolver {
28-
private _cache: Map<Type, cpl.CompileDirectiveMetadata> = new Map();
28+
private _cache = new Map<Type, cpl.CompileDirectiveMetadata>();
2929

3030
constructor(private _directiveResolver: DirectiveResolver, private _viewResolver: ViewResolver) {}
3131

@@ -84,7 +84,7 @@ export class RuntimeMetadataResolver {
8484

8585
function removeDuplicatedDirectives(directives: cpl.CompileDirectiveMetadata[]):
8686
cpl.CompileDirectiveMetadata[] {
87-
var directivesMap: Map<Type, cpl.CompileDirectiveMetadata> = new Map();
87+
var directivesMap = new Map<Type, cpl.CompileDirectiveMetadata>();
8888
directives.forEach((dirMeta) => { directivesMap.set(dirMeta.type.runtime, dirMeta); });
8989
return MapWrapper.values(directivesMap);
9090
}

modules/angular2/src/compiler/template_compiler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ import {Inject} from 'angular2/src/core/di';
3131

3232
@Injectable()
3333
export class TemplateCompiler {
34-
private _hostCacheKeys: Map<Type, any> = new Map();
35-
private _compiledTemplateCache: Map<Type, CompiledTemplate> = new Map();
36-
private _compiledTemplateDone: Map<Type, Promise<CompiledTemplate>> = new Map();
34+
private _hostCacheKeys = new Map<Type, any>();
35+
private _compiledTemplateCache = new Map<any, CompiledTemplate>();
36+
private _compiledTemplateDone = new Map<any, Promise<CompiledTemplate>>();
3737
private _appId: string;
3838

3939
constructor(private _runtimeMetadataResolver: RuntimeMetadataResolver,

modules/angular2/src/compiler/template_parser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class TemplateParser {
9595
class TemplateParseVisitor implements HtmlAstVisitor {
9696
selectorMatcher: SelectorMatcher;
9797
errors: string[] = [];
98-
directivesIndex: Map<CompileDirectiveMetadata, number> = new Map();
98+
directivesIndex = new Map<CompileDirectiveMetadata, number>();
9999
constructor(directives: CompileDirectiveMetadata[], private _exprParser: Parser,
100100
private _schemaRegistry: ElementSchemaRegistry) {
101101
this.selectorMatcher = new SelectorMatcher();
@@ -407,7 +407,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
407407
props: BoundElementOrDirectiveProperty[],
408408
possibleExportAsVars: VariableAst[],
409409
sourceInfo: string): DirectiveAst[] {
410-
var matchedVariables: Set<string> = new Set();
410+
var matchedVariables = new Set<string>();
411411
var directiveAsts = directives.map((directive: CompileDirectiveMetadata) => {
412412
var hostProperties: BoundElementPropertyAst[] = [];
413413
var hostEvents: BoundEventAst[] = [];
@@ -461,7 +461,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
461461
boundProps: BoundElementOrDirectiveProperty[],
462462
targetBoundDirectiveProps: BoundDirectivePropertyAst[]) {
463463
if (isPresent(directiveProperties)) {
464-
var boundPropsByName: Map<string, BoundElementOrDirectiveProperty> = new Map();
464+
var boundPropsByName = new Map<string, BoundElementOrDirectiveProperty>();
465465
boundProps.forEach(boundProp => {
466466
var key = dashCaseToCamelCase(boundProp.name);
467467
var prevValue = boundPropsByName.get(boundProp.name);
@@ -487,7 +487,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
487487
private _createElementPropertyAsts(elementName: string, props: BoundElementOrDirectiveProperty[],
488488
directives: DirectiveAst[]): BoundElementPropertyAst[] {
489489
var boundElementProps: BoundElementPropertyAst[] = [];
490-
var boundDirectivePropsIndex: Map<string, BoundDirectivePropertyAst> = new Map();
490+
var boundDirectivePropsIndex = new Map<string, BoundDirectivePropertyAst>();
491491
directives.forEach((directive: DirectiveAst) => {
492492
directive.properties.forEach((prop: BoundDirectivePropertyAst) => {
493493
boundDirectivePropsIndex.set(prop.templateName, prop);
@@ -664,4 +664,4 @@ function createElementCssSelector(elementName: string, matchableAttrs: string[][
664664
}
665665

666666
var EMPTY_COMPONENT = new Component(new SelectorMatcher(), null);
667-
var NON_BINDABLE_VISITOR = new NonBindableVisitor();
667+
var NON_BINDABLE_VISITOR = new NonBindableVisitor();

modules/angular2/src/core/change_detection/codegen_name_util.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class CodegenNameUtil {
4242
* See [sanitizeName] for details.
4343
*/
4444
_sanitizedNames: string[];
45-
_sanitizedEventNames: Map<EventBinding, string[]>;
45+
_sanitizedEventNames = new Map<EventBinding, string[]>();
4646

4747
constructor(private _records: ProtoRecord[], private _eventBindings: EventBinding[],
4848
private _directiveRecords: any[], private _utilName: string) {
@@ -52,7 +52,6 @@ export class CodegenNameUtil {
5252
this._sanitizedNames[i + 1] = sanitizeName(`${this._records[i].name}${i}`);
5353
}
5454

55-
this._sanitizedEventNames = new Map();
5655
for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) {
5756
var eb = _eventBindings[ebIndex];
5857
var names = [_CONTEXT_ACCESSOR];

modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class _DuplicateItemRecordList {
568568
}
569569

570570
class _DuplicateMap {
571-
map: Map<any, _DuplicateItemRecordList> = new Map();
571+
map = new Map<any, _DuplicateItemRecordList>();
572572

573573
put(record: CollectionChangeRecord) {
574574
// todo(vicb) handle corner cases

modules/angular2/src/core/compiler/compiler.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ import {
4545
*/
4646
@Injectable()
4747
export class CompilerCache {
48-
_cache: Map<Type, AppProtoView> = new Map();
49-
_hostCache: Map<Type, AppProtoView> = new Map();
48+
_cache = new Map<Type, AppProtoView>();
49+
_hostCache = new Map<Type, AppProtoView>();
5050

5151
set(component: Type, protoView: AppProtoView): void { this._cache.set(component, protoView); }
5252

@@ -99,7 +99,7 @@ export class CompilerCache {
9999
*/
100100
@Injectable()
101101
export class Compiler {
102-
private _compiling: Map<Type, Promise<AppProtoView>> = new Map();
102+
private _compiling = new Map<Type, Promise<AppProtoView>>();
103103
private _appUrl: string;
104104
private _defaultPipes: Type[];
105105

@@ -151,17 +151,17 @@ export class Compiler {
151151
Compiler._assertTypeIsComponent(componentBinding);
152152

153153
var directiveMetadata = componentBinding.metadata;
154-
hostPvPromise =
155-
this._render.compileHost(directiveMetadata)
156-
.then((hostRenderPv) => {
157-
var protoViews = this._protoViewFactory.createAppProtoViews(
158-
componentBinding, hostRenderPv, [componentBinding], []);
159-
return this._compileNestedProtoViews(protoViews, componentType, new Map());
160-
})
161-
.then((appProtoView) => {
162-
this._compilerCache.setHost(componentType, appProtoView);
163-
return appProtoView;
164-
});
154+
hostPvPromise = this._render.compileHost(directiveMetadata)
155+
.then((hostRenderPv) => {
156+
var protoViews = this._protoViewFactory.createAppProtoViews(
157+
componentBinding, hostRenderPv, [componentBinding], []);
158+
return this._compileNestedProtoViews(protoViews, componentType,
159+
new Map<Type, AppProtoView>());
160+
})
161+
.then((appProtoView) => {
162+
this._compilerCache.setHost(componentType, appProtoView);
163+
return appProtoView;
164+
});
165165
}
166166
return hostPvPromise.then((hostAppProtoView) => {
167167
wtfEndTimeRange(r);
@@ -221,7 +221,7 @@ export class Compiler {
221221
}
222222

223223
private _removeDuplicatedDirectives(directives: DirectiveBinding[]): DirectiveBinding[] {
224-
var directivesMap: Map<number, DirectiveBinding> = new Map();
224+
var directivesMap = new Map<number, DirectiveBinding>();
225225
directives.forEach((dirBinding) => { directivesMap.set(dirBinding.key.id, dirBinding); });
226226
return MapWrapper.values(directivesMap);
227227
}

modules/angular2/src/core/compiler/component_url_mapper.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ export class ComponentUrlMapper {
2424
}
2525

2626
export class RuntimeComponentUrlMapper extends ComponentUrlMapper {
27-
_componentUrls: Map<Type, string>;
27+
_componentUrls = new Map<Type, string>();
2828

29-
constructor() {
30-
super();
31-
this._componentUrls = new Map();
32-
}
29+
constructor() { super(); }
3330

3431
setComponentUrl(component: Type, url: string) { this._componentUrls.set(component, url); }
3532

modules/angular2/src/core/compiler/proto_view_factory.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {ElementBinder} from './element_binder';
3333
import {ProtoElementInjector, DirectiveBinding} from './element_injector';
3434

3535
export class BindingRecordsCreator {
36-
_directiveRecordsMap: Map<number, DirectiveRecord> = new Map();
36+
_directiveRecordsMap = new Map<number, DirectiveRecord>();
3737

3838
getEventBindingRecords(elementBinders: RenderElementBinder[],
3939
allDirectiveMetadatas: RenderDirectiveMetadata[]): BindingRecord[] {
@@ -353,7 +353,7 @@ function _collectNestedProtoViewsVariableBindings(nestedPvsWithIndex: RenderProt
353353
}
354354

355355
function _createVariableBindings(renderProtoView): Map<string, string> {
356-
var variableBindings = new Map();
356+
var variableBindings = new Map<string, string>();
357357
MapWrapper.forEach(renderProtoView.variableBindings,
358358
(mappedName, varName) => { variableBindings.set(varName, mappedName); });
359359
return variableBindings;
@@ -384,7 +384,7 @@ function _createVariableNames(parentVariableNames: string[], renderProtoView): s
384384

385385
export function createVariableLocations(elementBinders: RenderElementBinder[]):
386386
Map<string, number> {
387-
var variableLocations = new Map();
387+
var variableLocations = new Map<string, number>();
388388
for (var i = 0; i < elementBinders.length; i++) {
389389
var binder = elementBinders[i];
390390
MapWrapper.forEach(binder.variableBindings,
@@ -478,7 +478,7 @@ function _createElementBinder(protoView: AppProtoView, boundElementIndex, render
478478
export function createDirectiveVariableBindings(renderElementBinder: RenderElementBinder,
479479
directiveBindings: DirectiveBinding[]):
480480
Map<string, number> {
481-
var directiveVariableBindings = new Map();
481+
var directiveVariableBindings = new Map<string, number>();
482482
MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => {
483483
var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs);
484484
directiveVariableBindings.set(templateName, dirIndex);

0 commit comments

Comments
 (0)