parent
fb9796130d
commit
9b7378d132
@ -50,7 +50,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
|
|||||||
createTypeDefinitionFile.typeDefinitions = [
|
createTypeDefinitionFile.typeDefinitions = [
|
||||||
{
|
{
|
||||||
id: 'angular2/angular2',
|
id: 'angular2/angular2',
|
||||||
references: ['../es6-promise/es6-promise.d.ts'],
|
references: ['../es6-shim/es6-shim.d.ts'],
|
||||||
modules: {
|
modules: {
|
||||||
'angular2/angular2': {namespace: 'ng', id: 'angular2/angular2'},
|
'angular2/angular2': {namespace: 'ng', id: 'angular2/angular2'},
|
||||||
'angular2/web_worker/worker': {namespace: 'ngWorker', id: 'angular2/web_worker/worker'},
|
'angular2/web_worker/worker': {namespace: 'ngWorker', id: 'angular2/web_worker/worker'},
|
||||||
|
@ -1,89 +0,0 @@
|
|||||||
// This file is used for TypeScript compilation to ES5 only.
|
|
||||||
// Since this file is not included in the compilation to ES6, it is an error
|
|
||||||
// to <reference> this file from other sources.
|
|
||||||
// Instead it is referenced by the rootFilePaths option to the compiler.
|
|
||||||
|
|
||||||
// We also want the following typings to be available only when compiling to
|
|
||||||
// ES5, because they are redundant with lib.es6.d.ts.
|
|
||||||
/// <reference path="../typings/es6-promise/es6-promise.d.ts"/>
|
|
||||||
|
|
||||||
// Extend the ES5 standard library with some ES6 features we polyfill at runtime
|
|
||||||
// by loading es6-shim.js
|
|
||||||
|
|
||||||
// These are mostly copied from lib.es6.d.ts
|
|
||||||
|
|
||||||
interface String {
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* position. Otherwise returns false.
|
|
||||||
*/
|
|
||||||
startsWith(searchString: string, position?: number): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NumberConstructor {
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is an integer, false otherwise.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isInteger(number: number): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Array<T> {
|
|
||||||
/**
|
|
||||||
* Returns the this object after filling the section identified by start and end with value
|
|
||||||
* @param value value to fill array section with
|
|
||||||
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
||||||
* length+start where length is the length of the array.
|
|
||||||
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
||||||
* length+end.
|
|
||||||
*/
|
|
||||||
fill(value: T, start?: number, end?: number): T[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copied from lib.dom.d.ts and modified
|
|
||||||
interface Map<K, V> {
|
|
||||||
clear(): void;
|
|
||||||
delete (key: K): boolean;
|
|
||||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
||||||
keys(): Array<K>;
|
|
||||||
values(): Array<V>;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value: V): Map<K, V>;
|
|
||||||
size: number;
|
|
||||||
}
|
|
||||||
declare var Map: {
|
|
||||||
new (): Map<any, any>;
|
|
||||||
new<K, V>(): Map<K, V>;
|
|
||||||
// alexeagle: PATCHED
|
|
||||||
new<K, V>(m: Map<K, V>): Map<any, any>;
|
|
||||||
new<K, V>(l: Array<any>): Map<any, any>;
|
|
||||||
prototype: Map<any, any>;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface Set<T> {
|
|
||||||
add(value: T): Set<T>;
|
|
||||||
clear(): void;
|
|
||||||
delete (value: T): boolean;
|
|
||||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
|
||||||
has(value: T): boolean;
|
|
||||||
size: number;
|
|
||||||
}
|
|
||||||
declare var Set: {
|
|
||||||
new (): Set<any>;
|
|
||||||
new<T>(): Set<T>;
|
|
||||||
// alexeagle PATCHED
|
|
||||||
new<T>(s: Set<T>): Set<T>;
|
|
||||||
new<T>(l: Array<T>): Set<T>;
|
|
||||||
prototype: Set<any>;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface SymbolConstructor {
|
|
||||||
/**
|
|
||||||
* A method that returns the default iterator for an object.Called by the semantics of the
|
|
||||||
* for-of statement.
|
|
||||||
*/
|
|
||||||
iterator: symbol;
|
|
||||||
}
|
|
||||||
declare var Symbol: SymbolConstructor;
|
|
@ -25,7 +25,7 @@ var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g;
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RuntimeMetadataResolver {
|
export class RuntimeMetadataResolver {
|
||||||
private _cache: Map<Type, cpl.CompileDirectiveMetadata> = new Map();
|
private _cache = new Map<Type, cpl.CompileDirectiveMetadata>();
|
||||||
|
|
||||||
constructor(private _directiveResolver: DirectiveResolver, private _viewResolver: ViewResolver) {}
|
constructor(private _directiveResolver: DirectiveResolver, private _viewResolver: ViewResolver) {}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ export class RuntimeMetadataResolver {
|
|||||||
|
|
||||||
function removeDuplicatedDirectives(directives: cpl.CompileDirectiveMetadata[]):
|
function removeDuplicatedDirectives(directives: cpl.CompileDirectiveMetadata[]):
|
||||||
cpl.CompileDirectiveMetadata[] {
|
cpl.CompileDirectiveMetadata[] {
|
||||||
var directivesMap: Map<Type, cpl.CompileDirectiveMetadata> = new Map();
|
var directivesMap = new Map<Type, cpl.CompileDirectiveMetadata>();
|
||||||
directives.forEach((dirMeta) => { directivesMap.set(dirMeta.type.runtime, dirMeta); });
|
directives.forEach((dirMeta) => { directivesMap.set(dirMeta.type.runtime, dirMeta); });
|
||||||
return MapWrapper.values(directivesMap);
|
return MapWrapper.values(directivesMap);
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,9 @@ import {Inject} from 'angular2/src/core/di';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TemplateCompiler {
|
export class TemplateCompiler {
|
||||||
private _hostCacheKeys: Map<Type, any> = new Map();
|
private _hostCacheKeys = new Map<Type, any>();
|
||||||
private _compiledTemplateCache: Map<Type, CompiledTemplate> = new Map();
|
private _compiledTemplateCache = new Map<any, CompiledTemplate>();
|
||||||
private _compiledTemplateDone: Map<Type, Promise<CompiledTemplate>> = new Map();
|
private _compiledTemplateDone = new Map<any, Promise<CompiledTemplate>>();
|
||||||
private _appId: string;
|
private _appId: string;
|
||||||
|
|
||||||
constructor(private _runtimeMetadataResolver: RuntimeMetadataResolver,
|
constructor(private _runtimeMetadataResolver: RuntimeMetadataResolver,
|
||||||
|
@ -95,7 +95,7 @@ export class TemplateParser {
|
|||||||
class TemplateParseVisitor implements HtmlAstVisitor {
|
class TemplateParseVisitor implements HtmlAstVisitor {
|
||||||
selectorMatcher: SelectorMatcher;
|
selectorMatcher: SelectorMatcher;
|
||||||
errors: string[] = [];
|
errors: string[] = [];
|
||||||
directivesIndex: Map<CompileDirectiveMetadata, number> = new Map();
|
directivesIndex = new Map<CompileDirectiveMetadata, number>();
|
||||||
constructor(directives: CompileDirectiveMetadata[], private _exprParser: Parser,
|
constructor(directives: CompileDirectiveMetadata[], private _exprParser: Parser,
|
||||||
private _schemaRegistry: ElementSchemaRegistry) {
|
private _schemaRegistry: ElementSchemaRegistry) {
|
||||||
this.selectorMatcher = new SelectorMatcher();
|
this.selectorMatcher = new SelectorMatcher();
|
||||||
@ -407,7 +407,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
|
|||||||
props: BoundElementOrDirectiveProperty[],
|
props: BoundElementOrDirectiveProperty[],
|
||||||
possibleExportAsVars: VariableAst[],
|
possibleExportAsVars: VariableAst[],
|
||||||
sourceInfo: string): DirectiveAst[] {
|
sourceInfo: string): DirectiveAst[] {
|
||||||
var matchedVariables: Set<string> = new Set();
|
var matchedVariables = new Set<string>();
|
||||||
var directiveAsts = directives.map((directive: CompileDirectiveMetadata) => {
|
var directiveAsts = directives.map((directive: CompileDirectiveMetadata) => {
|
||||||
var hostProperties: BoundElementPropertyAst[] = [];
|
var hostProperties: BoundElementPropertyAst[] = [];
|
||||||
var hostEvents: BoundEventAst[] = [];
|
var hostEvents: BoundEventAst[] = [];
|
||||||
@ -461,7 +461,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
|
|||||||
boundProps: BoundElementOrDirectiveProperty[],
|
boundProps: BoundElementOrDirectiveProperty[],
|
||||||
targetBoundDirectiveProps: BoundDirectivePropertyAst[]) {
|
targetBoundDirectiveProps: BoundDirectivePropertyAst[]) {
|
||||||
if (isPresent(directiveProperties)) {
|
if (isPresent(directiveProperties)) {
|
||||||
var boundPropsByName: Map<string, BoundElementOrDirectiveProperty> = new Map();
|
var boundPropsByName = new Map<string, BoundElementOrDirectiveProperty>();
|
||||||
boundProps.forEach(boundProp => {
|
boundProps.forEach(boundProp => {
|
||||||
var key = dashCaseToCamelCase(boundProp.name);
|
var key = dashCaseToCamelCase(boundProp.name);
|
||||||
var prevValue = boundPropsByName.get(boundProp.name);
|
var prevValue = boundPropsByName.get(boundProp.name);
|
||||||
@ -487,7 +487,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
|
|||||||
private _createElementPropertyAsts(elementName: string, props: BoundElementOrDirectiveProperty[],
|
private _createElementPropertyAsts(elementName: string, props: BoundElementOrDirectiveProperty[],
|
||||||
directives: DirectiveAst[]): BoundElementPropertyAst[] {
|
directives: DirectiveAst[]): BoundElementPropertyAst[] {
|
||||||
var boundElementProps: BoundElementPropertyAst[] = [];
|
var boundElementProps: BoundElementPropertyAst[] = [];
|
||||||
var boundDirectivePropsIndex: Map<string, BoundDirectivePropertyAst> = new Map();
|
var boundDirectivePropsIndex = new Map<string, BoundDirectivePropertyAst>();
|
||||||
directives.forEach((directive: DirectiveAst) => {
|
directives.forEach((directive: DirectiveAst) => {
|
||||||
directive.properties.forEach((prop: BoundDirectivePropertyAst) => {
|
directive.properties.forEach((prop: BoundDirectivePropertyAst) => {
|
||||||
boundDirectivePropsIndex.set(prop.templateName, prop);
|
boundDirectivePropsIndex.set(prop.templateName, prop);
|
||||||
@ -664,4 +664,4 @@ function createElementCssSelector(elementName: string, matchableAttrs: string[][
|
|||||||
}
|
}
|
||||||
|
|
||||||
var EMPTY_COMPONENT = new Component(new SelectorMatcher(), null);
|
var EMPTY_COMPONENT = new Component(new SelectorMatcher(), null);
|
||||||
var NON_BINDABLE_VISITOR = new NonBindableVisitor();
|
var NON_BINDABLE_VISITOR = new NonBindableVisitor();
|
||||||
|
@ -42,7 +42,7 @@ export class CodegenNameUtil {
|
|||||||
* See [sanitizeName] for details.
|
* See [sanitizeName] for details.
|
||||||
*/
|
*/
|
||||||
_sanitizedNames: string[];
|
_sanitizedNames: string[];
|
||||||
_sanitizedEventNames: Map<EventBinding, string[]>;
|
_sanitizedEventNames = new Map<EventBinding, string[]>();
|
||||||
|
|
||||||
constructor(private _records: ProtoRecord[], private _eventBindings: EventBinding[],
|
constructor(private _records: ProtoRecord[], private _eventBindings: EventBinding[],
|
||||||
private _directiveRecords: any[], private _utilName: string) {
|
private _directiveRecords: any[], private _utilName: string) {
|
||||||
@ -52,7 +52,6 @@ export class CodegenNameUtil {
|
|||||||
this._sanitizedNames[i + 1] = sanitizeName(`${this._records[i].name}${i}`);
|
this._sanitizedNames[i + 1] = sanitizeName(`${this._records[i].name}${i}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._sanitizedEventNames = new Map();
|
|
||||||
for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) {
|
for (var ebIndex = 0; ebIndex < _eventBindings.length; ++ebIndex) {
|
||||||
var eb = _eventBindings[ebIndex];
|
var eb = _eventBindings[ebIndex];
|
||||||
var names = [_CONTEXT_ACCESSOR];
|
var names = [_CONTEXT_ACCESSOR];
|
||||||
|
@ -568,7 +568,7 @@ class _DuplicateItemRecordList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _DuplicateMap {
|
class _DuplicateMap {
|
||||||
map: Map<any, _DuplicateItemRecordList> = new Map();
|
map = new Map<any, _DuplicateItemRecordList>();
|
||||||
|
|
||||||
put(record: CollectionChangeRecord) {
|
put(record: CollectionChangeRecord) {
|
||||||
// todo(vicb) handle corner cases
|
// todo(vicb) handle corner cases
|
||||||
|
@ -45,8 +45,8 @@ import {
|
|||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CompilerCache {
|
export class CompilerCache {
|
||||||
_cache: Map<Type, AppProtoView> = new Map();
|
_cache = new Map<Type, AppProtoView>();
|
||||||
_hostCache: Map<Type, AppProtoView> = new Map();
|
_hostCache = new Map<Type, AppProtoView>();
|
||||||
|
|
||||||
set(component: Type, protoView: AppProtoView): void { this._cache.set(component, protoView); }
|
set(component: Type, protoView: AppProtoView): void { this._cache.set(component, protoView); }
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ export class CompilerCache {
|
|||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Compiler {
|
export class Compiler {
|
||||||
private _compiling: Map<Type, Promise<AppProtoView>> = new Map();
|
private _compiling = new Map<Type, Promise<AppProtoView>>();
|
||||||
private _appUrl: string;
|
private _appUrl: string;
|
||||||
private _defaultPipes: Type[];
|
private _defaultPipes: Type[];
|
||||||
|
|
||||||
@ -151,17 +151,17 @@ export class Compiler {
|
|||||||
Compiler._assertTypeIsComponent(componentBinding);
|
Compiler._assertTypeIsComponent(componentBinding);
|
||||||
|
|
||||||
var directiveMetadata = componentBinding.metadata;
|
var directiveMetadata = componentBinding.metadata;
|
||||||
hostPvPromise =
|
hostPvPromise = this._render.compileHost(directiveMetadata)
|
||||||
this._render.compileHost(directiveMetadata)
|
.then((hostRenderPv) => {
|
||||||
.then((hostRenderPv) => {
|
var protoViews = this._protoViewFactory.createAppProtoViews(
|
||||||
var protoViews = this._protoViewFactory.createAppProtoViews(
|
componentBinding, hostRenderPv, [componentBinding], []);
|
||||||
componentBinding, hostRenderPv, [componentBinding], []);
|
return this._compileNestedProtoViews(protoViews, componentType,
|
||||||
return this._compileNestedProtoViews(protoViews, componentType, new Map());
|
new Map<Type, AppProtoView>());
|
||||||
})
|
})
|
||||||
.then((appProtoView) => {
|
.then((appProtoView) => {
|
||||||
this._compilerCache.setHost(componentType, appProtoView);
|
this._compilerCache.setHost(componentType, appProtoView);
|
||||||
return appProtoView;
|
return appProtoView;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return hostPvPromise.then((hostAppProtoView) => {
|
return hostPvPromise.then((hostAppProtoView) => {
|
||||||
wtfEndTimeRange(r);
|
wtfEndTimeRange(r);
|
||||||
@ -221,7 +221,7 @@ export class Compiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _removeDuplicatedDirectives(directives: DirectiveBinding[]): DirectiveBinding[] {
|
private _removeDuplicatedDirectives(directives: DirectiveBinding[]): DirectiveBinding[] {
|
||||||
var directivesMap: Map<number, DirectiveBinding> = new Map();
|
var directivesMap = new Map<number, DirectiveBinding>();
|
||||||
directives.forEach((dirBinding) => { directivesMap.set(dirBinding.key.id, dirBinding); });
|
directives.forEach((dirBinding) => { directivesMap.set(dirBinding.key.id, dirBinding); });
|
||||||
return MapWrapper.values(directivesMap);
|
return MapWrapper.values(directivesMap);
|
||||||
}
|
}
|
||||||
|
@ -24,12 +24,9 @@ export class ComponentUrlMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class RuntimeComponentUrlMapper extends ComponentUrlMapper {
|
export class RuntimeComponentUrlMapper extends ComponentUrlMapper {
|
||||||
_componentUrls: Map<Type, string>;
|
_componentUrls = new Map<Type, string>();
|
||||||
|
|
||||||
constructor() {
|
constructor() { super(); }
|
||||||
super();
|
|
||||||
this._componentUrls = new Map();
|
|
||||||
}
|
|
||||||
|
|
||||||
setComponentUrl(component: Type, url: string) { this._componentUrls.set(component, url); }
|
setComponentUrl(component: Type, url: string) { this._componentUrls.set(component, url); }
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import {ElementBinder} from './element_binder';
|
|||||||
import {ProtoElementInjector, DirectiveBinding} from './element_injector';
|
import {ProtoElementInjector, DirectiveBinding} from './element_injector';
|
||||||
|
|
||||||
export class BindingRecordsCreator {
|
export class BindingRecordsCreator {
|
||||||
_directiveRecordsMap: Map<number, DirectiveRecord> = new Map();
|
_directiveRecordsMap = new Map<number, DirectiveRecord>();
|
||||||
|
|
||||||
getEventBindingRecords(elementBinders: RenderElementBinder[],
|
getEventBindingRecords(elementBinders: RenderElementBinder[],
|
||||||
allDirectiveMetadatas: RenderDirectiveMetadata[]): BindingRecord[] {
|
allDirectiveMetadatas: RenderDirectiveMetadata[]): BindingRecord[] {
|
||||||
@ -353,7 +353,7 @@ function _collectNestedProtoViewsVariableBindings(nestedPvsWithIndex: RenderProt
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _createVariableBindings(renderProtoView): Map<string, string> {
|
function _createVariableBindings(renderProtoView): Map<string, string> {
|
||||||
var variableBindings = new Map();
|
var variableBindings = new Map<string, string>();
|
||||||
MapWrapper.forEach(renderProtoView.variableBindings,
|
MapWrapper.forEach(renderProtoView.variableBindings,
|
||||||
(mappedName, varName) => { variableBindings.set(varName, mappedName); });
|
(mappedName, varName) => { variableBindings.set(varName, mappedName); });
|
||||||
return variableBindings;
|
return variableBindings;
|
||||||
@ -384,7 +384,7 @@ function _createVariableNames(parentVariableNames: string[], renderProtoView): s
|
|||||||
|
|
||||||
export function createVariableLocations(elementBinders: RenderElementBinder[]):
|
export function createVariableLocations(elementBinders: RenderElementBinder[]):
|
||||||
Map<string, number> {
|
Map<string, number> {
|
||||||
var variableLocations = new Map();
|
var variableLocations = new Map<string, number>();
|
||||||
for (var i = 0; i < elementBinders.length; i++) {
|
for (var i = 0; i < elementBinders.length; i++) {
|
||||||
var binder = elementBinders[i];
|
var binder = elementBinders[i];
|
||||||
MapWrapper.forEach(binder.variableBindings,
|
MapWrapper.forEach(binder.variableBindings,
|
||||||
@ -478,7 +478,7 @@ function _createElementBinder(protoView: AppProtoView, boundElementIndex, render
|
|||||||
export function createDirectiveVariableBindings(renderElementBinder: RenderElementBinder,
|
export function createDirectiveVariableBindings(renderElementBinder: RenderElementBinder,
|
||||||
directiveBindings: DirectiveBinding[]):
|
directiveBindings: DirectiveBinding[]):
|
||||||
Map<string, number> {
|
Map<string, number> {
|
||||||
var directiveVariableBindings = new Map();
|
var directiveVariableBindings = new Map<string, number>();
|
||||||
MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => {
|
MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => {
|
||||||
var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs);
|
var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs);
|
||||||
directiveVariableBindings.set(templateName, dirIndex);
|
directiveVariableBindings.set(templateName, dirIndex);
|
||||||
|
@ -167,7 +167,7 @@ export class AppView implements ChangeDispatcher, RenderEventDispatcher {
|
|||||||
* @param {number} boundElementIndex
|
* @param {number} boundElementIndex
|
||||||
*/
|
*/
|
||||||
triggerEventHandlers(eventName: string, eventObj: Event, boundElementIndex: number): void {
|
triggerEventHandlers(eventName: string, eventObj: Event, boundElementIndex: number): void {
|
||||||
var locals = new Map();
|
var locals = new Map<string, any>();
|
||||||
locals.set('$event', eventObj);
|
locals.set('$event', eventObj);
|
||||||
this.dispatchEvent(boundElementIndex, eventName, locals);
|
this.dispatchEvent(boundElementIndex, eventName, locals);
|
||||||
}
|
}
|
||||||
@ -332,7 +332,7 @@ class EventEvaluationError extends WrappedException {
|
|||||||
*/
|
*/
|
||||||
export class AppProtoView {
|
export class AppProtoView {
|
||||||
elementBinders: ElementBinder[] = [];
|
elementBinders: ElementBinder[] = [];
|
||||||
protoLocals: Map<string, any> = new Map();
|
protoLocals = new Map<string, any>();
|
||||||
mergeMapping: AppProtoViewMergeMapping;
|
mergeMapping: AppProtoViewMergeMapping;
|
||||||
ref: ProtoViewRef;
|
ref: ProtoViewRef;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ export const APP_VIEW_POOL_CAPACITY = CONST_EXPR(new OpaqueToken('AppViewPool.vi
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppViewPool {
|
export class AppViewPool {
|
||||||
_poolCapacityPerProtoView: number;
|
_poolCapacityPerProtoView: number;
|
||||||
_pooledViewsPerProtoView: Map<viewModule.AppProtoView, Array<viewModule.AppView>> = new Map();
|
_pooledViewsPerProtoView = new Map<viewModule.AppProtoView, Array<viewModule.AppView>>();
|
||||||
|
|
||||||
constructor(@Inject(APP_VIEW_POOL_CAPACITY) poolCapacityPerProtoView) {
|
constructor(@Inject(APP_VIEW_POOL_CAPACITY) poolCapacityPerProtoView) {
|
||||||
this._poolCapacityPerProtoView = poolCapacityPerProtoView;
|
this._poolCapacityPerProtoView = poolCapacityPerProtoView;
|
||||||
|
@ -10,7 +10,7 @@ import {reflector} from 'angular2/src/core/reflection/reflection';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ViewResolver {
|
export class ViewResolver {
|
||||||
_cache: Map<Type, ViewMetadata> = new Map();
|
_cache = new Map<Type, ViewMetadata>();
|
||||||
|
|
||||||
resolve(component: Type): ViewMetadata {
|
resolve(component: Type): ViewMetadata {
|
||||||
var view = this._cache.get(component);
|
var view = this._cache.get(component);
|
||||||
|
@ -470,7 +470,8 @@ export function resolveBinding(binding: Binding): ResolvedBinding {
|
|||||||
* Resolve a list of Bindings.
|
* Resolve a list of Bindings.
|
||||||
*/
|
*/
|
||||||
export function resolveBindings(bindings: Array<Type | Binding | any[]>): ResolvedBinding[] {
|
export function resolveBindings(bindings: Array<Type | Binding | any[]>): ResolvedBinding[] {
|
||||||
var normalized = _createListOfBindings(_normalizeBindings(bindings, new Map()));
|
var normalized = _createListOfBindings(
|
||||||
|
_normalizeBindings(bindings, new Map<number, _NormalizedBinding | _NormalizedBinding[]>()));
|
||||||
return normalized.map(b => {
|
return normalized.map(b => {
|
||||||
if (b instanceof _NormalizedBinding) {
|
if (b instanceof _NormalizedBinding) {
|
||||||
return new ResolvedBinding(b.key, [b.resolvedFactory], false);
|
return new ResolvedBinding(b.key, [b.resolvedFactory], false);
|
||||||
|
@ -49,7 +49,7 @@ export class Key {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export class KeyRegistry {
|
export class KeyRegistry {
|
||||||
private _allKeys: Map<Object, Key> = new Map();
|
private _allKeys = new Map<Object, Key>();
|
||||||
|
|
||||||
get(token: Object): Key {
|
get(token: Object): Key {
|
||||||
if (token instanceof Key) return token;
|
if (token instanceof Key) return token;
|
||||||
|
@ -43,7 +43,7 @@ export class SwitchView {
|
|||||||
export class NgSwitch {
|
export class NgSwitch {
|
||||||
private _switchValue: any;
|
private _switchValue: any;
|
||||||
private _useDefault: boolean = false;
|
private _useDefault: boolean = false;
|
||||||
private _valueViews: Map<any, SwitchView[]> = new Map();
|
private _valueViews = new Map<any, SwitchView[]>();
|
||||||
private _activeViews: SwitchView[] = [];
|
private _activeViews: SwitchView[] = [];
|
||||||
|
|
||||||
set ngSwitch(value) {
|
set ngSwitch(value) {
|
||||||
|
@ -216,7 +216,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
|||||||
getStyle(element, stylename: string): string { return element.style[stylename]; }
|
getStyle(element, stylename: string): string { return element.style[stylename]; }
|
||||||
tagName(element): string { return element.tagName; }
|
tagName(element): string { return element.tagName; }
|
||||||
attributeMap(element): Map<string, string> {
|
attributeMap(element): Map<string, string> {
|
||||||
var res = new Map();
|
var res = new Map<string, string>();
|
||||||
var elAttrs = element.attributes;
|
var elAttrs = element.attributes;
|
||||||
for (var i = 0; i < elAttrs.length; i++) {
|
for (var i = 0; i < elAttrs.length; i++) {
|
||||||
var attrib = elAttrs[i];
|
var attrib = elAttrs[i];
|
||||||
|
@ -409,7 +409,7 @@ export class Parse5DomAdapter extends DomAdapter {
|
|||||||
}
|
}
|
||||||
tagName(element): string { return element.tagName == "style" ? "STYLE" : element.tagName; }
|
tagName(element): string { return element.tagName == "style" ? "STYLE" : element.tagName; }
|
||||||
attributeMap(element): Map<string, string> {
|
attributeMap(element): Map<string, string> {
|
||||||
var res = new Map();
|
var res = new Map<string, string>();
|
||||||
var elAttrs = treeAdapter.getAttrList(element);
|
var elAttrs = treeAdapter.getAttrList(element);
|
||||||
for (var i = 0; i < elAttrs.length; i++) {
|
for (var i = 0; i < elAttrs.length; i++) {
|
||||||
var attrib = elAttrs[i];
|
var attrib = elAttrs[i];
|
||||||
|
@ -15,7 +15,7 @@ export var StringMap = global.Object;
|
|||||||
// Map constructor. We work around that by manually adding the items.
|
// Map constructor. We work around that by manually adding the items.
|
||||||
var createMapFromPairs: {(pairs: any[]): Map<any, any>} = (function() {
|
var createMapFromPairs: {(pairs: any[]): Map<any, any>} = (function() {
|
||||||
try {
|
try {
|
||||||
if (new Map([[1, 2]]).size === 1) {
|
if (new Map(<any>[[1, 2]]).size === 1) {
|
||||||
return function createMapFromPairs(pairs: any[]): Map<any, any> { return new Map(pairs); };
|
return function createMapFromPairs(pairs: any[]): Map<any, any> { return new Map(pairs); };
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -31,8 +31,8 @@ var createMapFromPairs: {(pairs: any[]): Map<any, any>} = (function() {
|
|||||||
})();
|
})();
|
||||||
var createMapFromMap: {(m: Map<any, any>): Map<any, any>} = (function() {
|
var createMapFromMap: {(m: Map<any, any>): Map<any, any>} = (function() {
|
||||||
try {
|
try {
|
||||||
if (new Map(new Map())) {
|
if (new Map(<any>new Map())) {
|
||||||
return function createMapFromMap(m: Map<any, any>): Map<any, any> { return new Map(m); };
|
return function createMapFromMap(m: Map<any, any>): Map<any, any> { return new Map(<any>m); };
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ var _arrayFromMap: {(m: Map<any, any>, getValues: boolean): any[]} = (function()
|
|||||||
export class MapWrapper {
|
export class MapWrapper {
|
||||||
static clone<K, V>(m: Map<K, V>): Map<K, V> { return createMapFromMap(m); }
|
static clone<K, V>(m: Map<K, V>): Map<K, V> { return createMapFromMap(m); }
|
||||||
static createFromStringMap<T>(stringMap: StringMap<string, T>): Map<string, T> {
|
static createFromStringMap<T>(stringMap: StringMap<string, T>): Map<string, T> {
|
||||||
var result = new Map();
|
var result = new Map<string, T>();
|
||||||
for (var prop in stringMap) {
|
for (var prop in stringMap) {
|
||||||
result.set(prop, stringMap[prop]);
|
result.set(prop, stringMap[prop]);
|
||||||
}
|
}
|
||||||
|
@ -350,6 +350,7 @@ export function setValueOnPath(global: any, path: string, value: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim
|
// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim
|
||||||
|
declare var Symbol;
|
||||||
var _symbolIterator = null;
|
var _symbolIterator = null;
|
||||||
export function getSymbolIterator(): string | symbol {
|
export function getSymbolIterator(): string | symbol {
|
||||||
if (isBlank(_symbolIterator)) {
|
if (isBlank(_symbolIterator)) {
|
||||||
|
@ -20,18 +20,14 @@ export class ReflectionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class Reflector {
|
export class Reflector {
|
||||||
_injectableInfo: Map<any, ReflectionInfo>;
|
_injectableInfo = new Map<any, ReflectionInfo>();
|
||||||
_getters: Map<string, GetterFn>;
|
_getters = new Map<string, GetterFn>();
|
||||||
_setters: Map<string, SetterFn>;
|
_setters = new Map<string, SetterFn>();
|
||||||
_methods: Map<string, MethodFn>;
|
_methods = new Map<string, MethodFn>();
|
||||||
_usedKeys: Set<any>;
|
_usedKeys: Set<any>;
|
||||||
reflectionCapabilities: PlatformReflectionCapabilities;
|
reflectionCapabilities: PlatformReflectionCapabilities;
|
||||||
|
|
||||||
constructor(reflectionCapabilities: PlatformReflectionCapabilities) {
|
constructor(reflectionCapabilities: PlatformReflectionCapabilities) {
|
||||||
this._injectableInfo = new Map();
|
|
||||||
this._getters = new Map();
|
|
||||||
this._setters = new Map();
|
|
||||||
this._methods = new Map();
|
|
||||||
this._usedKeys = null;
|
this._usedKeys = null;
|
||||||
this.reflectionCapabilities = reflectionCapabilities;
|
this.reflectionCapabilities = reflectionCapabilities;
|
||||||
}
|
}
|
||||||
|
@ -238,9 +238,9 @@ export class RenderDirectiveMetadata {
|
|||||||
exportAs?: string,
|
exportAs?: string,
|
||||||
queries?: StringMap<string, any>
|
queries?: StringMap<string, any>
|
||||||
}): RenderDirectiveMetadata {
|
}): RenderDirectiveMetadata {
|
||||||
let hostListeners = new Map();
|
let hostListeners = new Map<string, string>();
|
||||||
let hostProperties = new Map();
|
let hostProperties = new Map<string, string>();
|
||||||
let hostAttributes = new Map();
|
let hostAttributes = new Map<string, string>();
|
||||||
|
|
||||||
if (isPresent(host)) {
|
if (isPresent(host)) {
|
||||||
MapWrapper.forEach(host, (value: string, key: string) => {
|
MapWrapper.forEach(host, (value: string, key: string) => {
|
||||||
|
@ -12,7 +12,7 @@ export class CompileStepFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class DefaultStepFactory extends CompileStepFactory {
|
export class DefaultStepFactory extends CompileStepFactory {
|
||||||
private _componentUIDsCache: Map<string, string> = new Map();
|
private _componentUIDsCache = new Map<string, string>();
|
||||||
constructor(private _parser: Parser, private _appId: string) { super(); }
|
constructor(private _parser: Parser, private _appId: string) { super(); }
|
||||||
|
|
||||||
createSteps(view: ViewDefinition): CompileStep[] {
|
createSteps(view: ViewDefinition): CompileStep[] {
|
||||||
|
@ -156,12 +156,12 @@ export class SelectorMatcher {
|
|||||||
return notMatcher;
|
return notMatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _elementMap: Map<string, SelectorContext[]> = new Map();
|
private _elementMap = new Map<string, SelectorContext[]>();
|
||||||
private _elementPartialMap: Map<string, SelectorMatcher> = new Map();
|
private _elementPartialMap = new Map<string, SelectorMatcher>();
|
||||||
private _classMap: Map<string, SelectorContext[]> = new Map();
|
private _classMap = new Map<string, SelectorContext[]>();
|
||||||
private _classPartialMap: Map<string, SelectorMatcher> = new Map();
|
private _classPartialMap = new Map<string, SelectorMatcher>();
|
||||||
private _attrValueMap: Map<string, Map<string, SelectorContext[]>> = new Map();
|
private _attrValueMap = new Map<string, Map<string, SelectorContext[]>>();
|
||||||
private _attrValuePartialMap: Map<string, Map<string, SelectorMatcher>> = new Map();
|
private _attrValuePartialMap = new Map<string, Map<string, SelectorMatcher>>();
|
||||||
private _listContexts: SelectorListContext[] = [];
|
private _listContexts: SelectorListContext[] = [];
|
||||||
|
|
||||||
addSelectables(cssSelectors: CssSelector[], callbackCtxt?: any) {
|
addSelectables(cssSelectors: CssSelector[], callbackCtxt?: any) {
|
||||||
@ -218,7 +218,7 @@ export class SelectorMatcher {
|
|||||||
var terminalMap = matcher._attrValueMap;
|
var terminalMap = matcher._attrValueMap;
|
||||||
var terminalValuesMap = terminalMap.get(attrName);
|
var terminalValuesMap = terminalMap.get(attrName);
|
||||||
if (isBlank(terminalValuesMap)) {
|
if (isBlank(terminalValuesMap)) {
|
||||||
terminalValuesMap = new Map();
|
terminalValuesMap = new Map<string, SelectorContext[]>();
|
||||||
terminalMap.set(attrName, terminalValuesMap);
|
terminalMap.set(attrName, terminalValuesMap);
|
||||||
}
|
}
|
||||||
this._addTerminal(terminalValuesMap, attrValue, selectable);
|
this._addTerminal(terminalValuesMap, attrValue, selectable);
|
||||||
@ -226,7 +226,7 @@ export class SelectorMatcher {
|
|||||||
var parttialMap = matcher._attrValuePartialMap;
|
var parttialMap = matcher._attrValuePartialMap;
|
||||||
var partialValuesMap = parttialMap.get(attrName);
|
var partialValuesMap = parttialMap.get(attrName);
|
||||||
if (isBlank(partialValuesMap)) {
|
if (isBlank(partialValuesMap)) {
|
||||||
partialValuesMap = new Map();
|
partialValuesMap = new Map<string, SelectorMatcher>();
|
||||||
parttialMap.set(attrName, partialValuesMap);
|
parttialMap.set(attrName, partialValuesMap);
|
||||||
}
|
}
|
||||||
matcher = this._addPartial(partialValuesMap, attrValue);
|
matcher = this._addPartial(partialValuesMap, attrValue);
|
||||||
|
@ -28,7 +28,7 @@ export class TemplateAndStyles {
|
|||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ViewLoader {
|
export class ViewLoader {
|
||||||
_cache: Map<string, Promise<string>> = new Map();
|
_cache = new Map<string, Promise<string>>();
|
||||||
|
|
||||||
constructor(private _xhr: XHR, private _styleInliner: StyleInliner,
|
constructor(private _xhr: XHR, private _styleInliner: StyleInliner,
|
||||||
private _styleUrlResolver: StyleUrlResolver) {}
|
private _styleUrlResolver: StyleUrlResolver) {}
|
||||||
|
@ -5,7 +5,7 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
|||||||
import {ElementSchemaRegistry} from './element_schema_registry';
|
import {ElementSchemaRegistry} from './element_schema_registry';
|
||||||
|
|
||||||
export class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
export class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
||||||
private _protoElements: Map<string, Element> = new Map();
|
private _protoElements = new Map<string, Element>();
|
||||||
|
|
||||||
private _getProtoElement(tagName: string): Element {
|
private _getProtoElement(tagName: string): Element {
|
||||||
var element = this._protoElements.get(tagName);
|
var element = this._protoElements.get(tagName);
|
||||||
|
@ -38,11 +38,11 @@ import {NG_BINDING_CLASS, queryBoundTextNodeIndices, camelCaseToDashCase} from '
|
|||||||
import {EVENT_TARGET_SEPARATOR} from "../../event_config";
|
import {EVENT_TARGET_SEPARATOR} from "../../event_config";
|
||||||
|
|
||||||
export class ProtoViewBuilder {
|
export class ProtoViewBuilder {
|
||||||
variableBindings: Map<string, string> = new Map();
|
variableBindings = new Map<string, string>();
|
||||||
elements: ElementBinderBuilder[] = [];
|
elements: ElementBinderBuilder[] = [];
|
||||||
rootTextBindings: Map<Node, ASTWithSource> = new Map();
|
rootTextBindings = new Map<Node, ASTWithSource>();
|
||||||
ngContentCount: number = 0;
|
ngContentCount: number = 0;
|
||||||
hostAttributes: Map<string, string> = new Map();
|
hostAttributes = new Map<string, string>();
|
||||||
|
|
||||||
constructor(public rootElement, public type: ViewType,
|
constructor(public rootElement, public type: ViewType,
|
||||||
public viewEncapsulation: ViewEncapsulation) {}
|
public viewEncapsulation: ViewEncapsulation) {}
|
||||||
@ -89,7 +89,7 @@ export class ProtoViewBuilder {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ListWrapper.forEach(this.elements, (ebb: ElementBinderBuilder) => {
|
ListWrapper.forEach(this.elements, (ebb: ElementBinderBuilder) => {
|
||||||
var directiveTemplatePropertyNames = new Set();
|
var directiveTemplatePropertyNames = new Set<string>();
|
||||||
var apiDirectiveBinders = ListWrapper.map(ebb.directives, (dbb: DirectiveBuilder) => {
|
var apiDirectiveBinders = ListWrapper.map(ebb.directives, (dbb: DirectiveBuilder) => {
|
||||||
ebb.eventBuilder.merge(dbb.eventBuilder);
|
ebb.eventBuilder.merge(dbb.eventBuilder);
|
||||||
ListWrapper.forEach(dbb.templatePropertyNames,
|
ListWrapper.forEach(dbb.templatePropertyNames,
|
||||||
@ -155,12 +155,12 @@ export class ElementBinderBuilder {
|
|||||||
distanceToParent: number = 0;
|
distanceToParent: number = 0;
|
||||||
directives: DirectiveBuilder[] = [];
|
directives: DirectiveBuilder[] = [];
|
||||||
nestedProtoView: ProtoViewBuilder = null;
|
nestedProtoView: ProtoViewBuilder = null;
|
||||||
propertyBindings: Map<string, ASTWithSource> = new Map();
|
propertyBindings = new Map<string, ASTWithSource>();
|
||||||
variableBindings: Map<string, string> = new Map();
|
variableBindings = new Map<string, string>();
|
||||||
eventBindings: EventBinding[] = [];
|
eventBindings: EventBinding[] = [];
|
||||||
eventBuilder: EventBuilder = new EventBuilder();
|
eventBuilder: EventBuilder = new EventBuilder();
|
||||||
textBindings: Map<Node, ASTWithSource> = new Map();
|
textBindings = new Map<Node, ASTWithSource>();
|
||||||
readAttributes: Map<string, string> = new Map();
|
readAttributes = new Map<string, string>();
|
||||||
componentId: string = null;
|
componentId: string = null;
|
||||||
|
|
||||||
constructor(public index: number, public element, description: string) {}
|
constructor(public index: number, public element, description: string) {}
|
||||||
@ -231,10 +231,10 @@ export class ElementBinderBuilder {
|
|||||||
|
|
||||||
export class DirectiveBuilder {
|
export class DirectiveBuilder {
|
||||||
// mapping from directive property name to AST for that directive
|
// mapping from directive property name to AST for that directive
|
||||||
propertyBindings: Map<string, ASTWithSource> = new Map();
|
propertyBindings = new Map<string, ASTWithSource>();
|
||||||
// property names used in the template
|
// property names used in the template
|
||||||
templatePropertyNames: string[] = [];
|
templatePropertyNames: string[] = [];
|
||||||
hostPropertyBindings: Map<string, ASTWithSource> = new Map();
|
hostPropertyBindings = new Map<string, ASTWithSource>();
|
||||||
eventBindings: EventBinding[] = [];
|
eventBindings: EventBinding[] = [];
|
||||||
eventBuilder: EventBuilder = new EventBuilder();
|
eventBuilder: EventBuilder = new EventBuilder();
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ export function mergeProtoViewsRecursively(templateCloner: TemplateCloner,
|
|||||||
// modify the DOM
|
// modify the DOM
|
||||||
mergeEmbeddedPvsIntoComponentOrRootPv(clonedProtoViews, hostViewAndBinderIndices);
|
mergeEmbeddedPvsIntoComponentOrRootPv(clonedProtoViews, hostViewAndBinderIndices);
|
||||||
var fragments = [];
|
var fragments = [];
|
||||||
var elementsWithNativeShadowRoot: Set<Element> = new Set();
|
var elementsWithNativeShadowRoot = new Set<Element>();
|
||||||
mergeComponents(clonedProtoViews, hostViewAndBinderIndices, fragments,
|
mergeComponents(clonedProtoViews, hostViewAndBinderIndices, fragments,
|
||||||
elementsWithNativeShadowRoot);
|
elementsWithNativeShadowRoot);
|
||||||
// Note: Need to remark parent elements of bound text nodes
|
// Note: Need to remark parent elements of bound text nodes
|
||||||
@ -50,7 +50,7 @@ export function mergeProtoViewsRecursively(templateCloner: TemplateCloner,
|
|||||||
|
|
||||||
// read out the new element / text node / ElementBinder order
|
// read out the new element / text node / ElementBinder order
|
||||||
var mergedBoundElements = queryBoundElements(rootNode, false);
|
var mergedBoundElements = queryBoundElements(rootNode, false);
|
||||||
var mergedBoundTextIndices: Map<Node, number> = new Map();
|
var mergedBoundTextIndices = new Map<Node, number>();
|
||||||
var boundTextNodeMap: Map<Node, any> = indexBoundTextNodes(clonedProtoViews);
|
var boundTextNodeMap: Map<Node, any> = indexBoundTextNodes(clonedProtoViews);
|
||||||
var rootTextNodeIndices =
|
var rootTextNodeIndices =
|
||||||
calcRootTextNodeIndices(rootNode, boundTextNodeMap, mergedBoundTextIndices);
|
calcRootTextNodeIndices(rootNode, boundTextNodeMap, mergedBoundTextIndices);
|
||||||
@ -69,7 +69,7 @@ export function mergeProtoViewsRecursively(templateCloner: TemplateCloner,
|
|||||||
var mergedProtoView =
|
var mergedProtoView =
|
||||||
DomProtoView.create(templateCloner, mainProtoView.original.type, rootElement,
|
DomProtoView.create(templateCloner, mainProtoView.original.type, rootElement,
|
||||||
mainProtoView.original.encapsulation, fragmentsRootNodeCount,
|
mainProtoView.original.encapsulation, fragmentsRootNodeCount,
|
||||||
rootTextNodeIndices, mergedElementBinders, new Map());
|
rootTextNodeIndices, mergedElementBinders, new Map<string, string>());
|
||||||
return new RenderProtoViewMergeMapping(new DomProtoViewRef(mergedProtoView),
|
return new RenderProtoViewMergeMapping(new DomProtoViewRef(mergedProtoView),
|
||||||
fragmentsRootNodeCount.length, mappedElementIndices,
|
fragmentsRootNodeCount.length, mappedElementIndices,
|
||||||
mergedBoundElements.length, mappedTextIndices,
|
mergedBoundElements.length, mappedTextIndices,
|
||||||
@ -116,7 +116,7 @@ function markBoundTextNodeParentsAsBoundElements(mergableProtoViews: ClonedProto
|
|||||||
}
|
}
|
||||||
|
|
||||||
function indexBoundTextNodes(mergableProtoViews: ClonedProtoView[]): Map<Node, any> {
|
function indexBoundTextNodes(mergableProtoViews: ClonedProtoView[]): Map<Node, any> {
|
||||||
var boundTextNodeMap = new Map();
|
var boundTextNodeMap = new Map<Node, any>();
|
||||||
for (var pvIndex = 0; pvIndex < mergableProtoViews.length; pvIndex++) {
|
for (var pvIndex = 0; pvIndex < mergableProtoViews.length; pvIndex++) {
|
||||||
var mergableProtoView = mergableProtoViews[pvIndex];
|
var mergableProtoView = mergableProtoViews[pvIndex];
|
||||||
mergableProtoView.boundTextNodes.forEach(
|
mergableProtoView.boundTextNodes.forEach(
|
||||||
@ -352,7 +352,7 @@ function calcElementBinders(clonedProtoViews: ClonedProtoView[], mergedBoundElem
|
|||||||
|
|
||||||
function indexElementBindersByElement(mergableProtoViews: ClonedProtoView[]):
|
function indexElementBindersByElement(mergableProtoViews: ClonedProtoView[]):
|
||||||
Map<Element, DomElementBinder> {
|
Map<Element, DomElementBinder> {
|
||||||
var elementBinderByElement = new Map();
|
var elementBinderByElement = new Map<Element, DomElementBinder>();
|
||||||
mergableProtoViews.forEach((mergableProtoView) => {
|
mergableProtoViews.forEach((mergableProtoView) => {
|
||||||
for (var i = 0; i < mergableProtoView.boundElements.length; i++) {
|
for (var i = 0; i < mergableProtoView.boundElements.length; i++) {
|
||||||
var el = mergableProtoView.boundElements[i];
|
var el = mergableProtoView.boundElements[i];
|
||||||
@ -442,7 +442,7 @@ function calcNestedViewCounts(hostViewAndBinderIndices: number[][]): number[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function indexArray(arr: any[]): Map<any, number> {
|
function indexArray(arr: any[]): Map<any, number> {
|
||||||
var map = new Map();
|
var map = new Map<any, number>();
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for (var i = 0; i < arr.length; i++) {
|
||||||
map.set(arr[i], i);
|
map.set(arr[i], i);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import {DOCUMENT} from '../dom_tokens';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class SharedStylesHost {
|
export class SharedStylesHost {
|
||||||
_styles: string[] = [];
|
_styles: string[] = [];
|
||||||
_stylesSet: Set<string> = new Set();
|
_stylesSet = new Set<string>();
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ export class SharedStylesHost {
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DomSharedStylesHost extends SharedStylesHost {
|
export class DomSharedStylesHost extends SharedStylesHost {
|
||||||
private _hostNodes: Set<Node> = new Set();
|
private _hostNodes = new Set<Node>();
|
||||||
constructor(@Inject(DOCUMENT) doc: any) {
|
constructor(@Inject(DOCUMENT) doc: any) {
|
||||||
super();
|
super();
|
||||||
this._hostNodes.add(doc.head);
|
this._hostNodes.add(doc.head);
|
||||||
|
@ -69,7 +69,7 @@ export class DomView {
|
|||||||
dispatchEvent(elementIndex: number, eventName: string, event: Event): boolean {
|
dispatchEvent(elementIndex: number, eventName: string, event: Event): boolean {
|
||||||
var allowDefaultBehavior = true;
|
var allowDefaultBehavior = true;
|
||||||
if (isPresent(this.eventDispatcher)) {
|
if (isPresent(this.eventDispatcher)) {
|
||||||
var evalLocals = new Map();
|
var evalLocals = new Map<string, any>();
|
||||||
evalLocals.set('$event', event);
|
evalLocals.set('$event', event);
|
||||||
// TODO(tbosch): reenable this when we are parsing element properties
|
// TODO(tbosch): reenable this when we are parsing element properties
|
||||||
// out of action expressions
|
// out of action expressions
|
||||||
|
@ -52,7 +52,7 @@ export class DefaultRenderView<N> extends RenderViewRef {
|
|||||||
dispatchRenderEvent(boundElementIndex: number, eventName: string, event: any): boolean {
|
dispatchRenderEvent(boundElementIndex: number, eventName: string, event: any): boolean {
|
||||||
var allowDefaultBehavior = true;
|
var allowDefaultBehavior = true;
|
||||||
if (isPresent(this.eventDispatcher)) {
|
if (isPresent(this.eventDispatcher)) {
|
||||||
var locals = new Map();
|
var locals = new Map<string, any>();
|
||||||
locals.set('$event', event);
|
locals.set('$event', event);
|
||||||
allowDefaultBehavior =
|
allowDefaultBehavior =
|
||||||
this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals);
|
this.eventDispatcher.dispatchRenderEvent(boundElementIndex, eventName, locals);
|
||||||
|
@ -6,13 +6,12 @@ import {PromiseCompleter, PromiseWrapper, Promise} from 'angular2/src/core/facad
|
|||||||
|
|
||||||
export class MockXHR extends XHR {
|
export class MockXHR extends XHR {
|
||||||
private _expectations: _Expectation[];
|
private _expectations: _Expectation[];
|
||||||
private _definitions: Map<string, string>;
|
private _definitions = new Map<string, string>();
|
||||||
private _requests: _PendingRequest[];
|
private _requests: _PendingRequest[];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this._expectations = [];
|
this._expectations = [];
|
||||||
this._definitions = new Map();
|
|
||||||
this._requests = [];
|
this._requests = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ export class Testability {
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TestabilityRegistry {
|
export class TestabilityRegistry {
|
||||||
_applications: Map<any, Testability> = new Map();
|
_applications = new Map<any, Testability>();
|
||||||
|
|
||||||
constructor() { testabilityGetter.addToWindow(this); }
|
constructor() { testabilityGetter.addToWindow(this); }
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ export class Headers {
|
|||||||
_headersMap: Map<string, string[]>;
|
_headersMap: Map<string, string[]>;
|
||||||
constructor(headers?: Headers | StringMap<string, any>) {
|
constructor(headers?: Headers | StringMap<string, any>) {
|
||||||
if (isBlank(headers)) {
|
if (isBlank(headers)) {
|
||||||
this._headersMap = new Map();
|
this._headersMap = new Map<string, string[]>();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
} from 'angular2/src/core/facade/collection';
|
} from 'angular2/src/core/facade/collection';
|
||||||
|
|
||||||
function paramParser(rawParams: string = ''): Map<string, string[]> {
|
function paramParser(rawParams: string = ''): Map<string, string[]> {
|
||||||
var map: Map<string, string[]> = new Map();
|
var map = new Map<string, string[]>();
|
||||||
if (rawParams.length > 0) {
|
if (rawParams.length > 0) {
|
||||||
var params: string[] = StringWrapper.split(rawParams, new RegExp('&'));
|
var params: string[] = StringWrapper.split(rawParams, new RegExp('&'));
|
||||||
ListWrapper.forEach(params, (param: string) => {
|
ListWrapper.forEach(params, (param: string) => {
|
||||||
|
@ -4,8 +4,8 @@ import {DirectiveMetadata, ComponentMetadata} from '../core/metadata';
|
|||||||
import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver';
|
import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver';
|
||||||
|
|
||||||
export class MockDirectiveResolver extends DirectiveResolver {
|
export class MockDirectiveResolver extends DirectiveResolver {
|
||||||
private _bindingsOverrides: Map<Type, any[]> = new Map();
|
private _bindingsOverrides = new Map<Type, any[]>();
|
||||||
private _viewBindingsOverrides: Map<Type, any[]> = new Map();
|
private _viewBindingsOverrides = new Map<Type, any[]>();
|
||||||
|
|
||||||
resolve(type: Type): DirectiveMetadata {
|
resolve(type: Type): DirectiveMetadata {
|
||||||
var dm = super.resolve(type);
|
var dm = super.resolve(type);
|
||||||
|
@ -6,10 +6,10 @@ import {ViewMetadata} from '../core/metadata';
|
|||||||
import {ViewResolver} from 'angular2/src/core/compiler/view_resolver';
|
import {ViewResolver} from 'angular2/src/core/compiler/view_resolver';
|
||||||
|
|
||||||
export class MockViewResolver extends ViewResolver {
|
export class MockViewResolver extends ViewResolver {
|
||||||
_views: Map<Type, ViewMetadata> = new Map();
|
_views = new Map<Type, ViewMetadata>();
|
||||||
_inlineTemplates: Map<Type, string> = new Map();
|
_inlineTemplates = new Map<Type, string>();
|
||||||
_viewCache: Map<Type, ViewMetadata> = new Map();
|
_viewCache = new Map<Type, ViewMetadata>();
|
||||||
_directiveOverrides: Map<Type, Map<Type, Type>> = new Map();
|
_directiveOverrides = new Map<Type, Map<Type, Type>>();
|
||||||
|
|
||||||
constructor() { super(); }
|
constructor() { super(); }
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ export class MockViewResolver extends ViewResolver {
|
|||||||
var overrides = this._directiveOverrides.get(component);
|
var overrides = this._directiveOverrides.get(component);
|
||||||
|
|
||||||
if (isBlank(overrides)) {
|
if (isBlank(overrides)) {
|
||||||
overrides = new Map();
|
overrides = new Map<Type, Type>();
|
||||||
this._directiveOverrides.set(component, overrides);
|
this._directiveOverrides.set(component, overrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ import {ComponentInstruction} from './instruction';
|
|||||||
* components.
|
* components.
|
||||||
*/
|
*/
|
||||||
export class RouteRecognizer {
|
export class RouteRecognizer {
|
||||||
names: Map<string, PathRecognizer> = new Map();
|
names = new Map<string, PathRecognizer>();
|
||||||
|
|
||||||
auxRoutes: Map<string, PathRecognizer> = new Map();
|
auxRoutes = new Map<string, PathRecognizer>();
|
||||||
|
|
||||||
// TODO: optimize this into a trie
|
// TODO: optimize this into a trie
|
||||||
matchers: PathRecognizer[] = [];
|
matchers: PathRecognizer[] = [];
|
||||||
|
@ -43,7 +43,7 @@ var _resolveToNull = PromiseWrapper.resolve(null);
|
|||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RouteRegistry {
|
export class RouteRegistry {
|
||||||
private _rules: Map<any, RouteRecognizer> = new Map();
|
private _rules = new Map<any, RouteRecognizer>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a component and a configuration object, add the route to this registry
|
* Given a component and a configuration object, add the route to this registry
|
||||||
|
@ -50,7 +50,7 @@ export class Router {
|
|||||||
private _currentNavigation: Promise<any> = _resolveToTrue;
|
private _currentNavigation: Promise<any> = _resolveToTrue;
|
||||||
private _outlet: RouterOutlet = null;
|
private _outlet: RouterOutlet = null;
|
||||||
|
|
||||||
private _auxRouters: Map<string, Router> = new Map();
|
private _auxRouters = new Map<string, Router>();
|
||||||
private _childRouter: Router;
|
private _childRouter: Router;
|
||||||
|
|
||||||
private _subject: EventEmitter = new EventEmitter();
|
private _subject: EventEmitter = new EventEmitter();
|
||||||
|
@ -52,20 +52,14 @@ var _nextRootElementId = 0;
|
|||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TestComponentBuilder {
|
export class TestComponentBuilder {
|
||||||
_bindingsOverrides: Map<Type, any[]>;
|
_bindingsOverrides = new Map<Type, any[]>();
|
||||||
_directiveOverrides: Map<Type, Map<Type, Type>>;
|
_directiveOverrides = new Map<Type, Map<Type, Type>>();
|
||||||
_templateOverrides: Map<Type, string>;
|
_templateOverrides = new Map<Type, string>();
|
||||||
_viewBindingsOverrides: Map<Type, any[]>;
|
_viewBindingsOverrides = new Map<Type, any[]>();
|
||||||
_viewOverrides: Map<Type, ViewMetadata>;
|
_viewOverrides = new Map<Type, ViewMetadata>();
|
||||||
|
|
||||||
|
|
||||||
constructor(private _injector: Injector) {
|
constructor(private _injector: Injector) {}
|
||||||
this._bindingsOverrides = new Map();
|
|
||||||
this._directiveOverrides = new Map();
|
|
||||||
this._templateOverrides = new Map();
|
|
||||||
this._viewBindingsOverrides = new Map();
|
|
||||||
this._viewOverrides = new Map();
|
|
||||||
}
|
|
||||||
|
|
||||||
_clone(): TestComponentBuilder {
|
_clone(): TestComponentBuilder {
|
||||||
var clone = new TestComponentBuilder(this._injector);
|
var clone = new TestComponentBuilder(this._injector);
|
||||||
@ -117,7 +111,7 @@ export class TestComponentBuilder {
|
|||||||
var clone = this._clone();
|
var clone = this._clone();
|
||||||
var overridesForComponent = clone._directiveOverrides.get(componentType);
|
var overridesForComponent = clone._directiveOverrides.get(componentType);
|
||||||
if (!isPresent(overridesForComponent)) {
|
if (!isPresent(overridesForComponent)) {
|
||||||
clone._directiveOverrides.set(componentType, new Map());
|
clone._directiveOverrides.set(componentType, new Map<Type, Type>());
|
||||||
overridesForComponent = clone._directiveOverrides.get(componentType);
|
overridesForComponent = clone._directiveOverrides.get(componentType);
|
||||||
}
|
}
|
||||||
overridesForComponent.set(from, to);
|
overridesForComponent.set(from, to);
|
||||||
|
@ -179,7 +179,7 @@ export class Serializer {
|
|||||||
*/
|
*/
|
||||||
objectToMap(obj: StringMap<string, any>, type?: Type, data?: any): Map<string, any> {
|
objectToMap(obj: StringMap<string, any>, type?: Type, data?: any): Map<string, any> {
|
||||||
if (isPresent(type)) {
|
if (isPresent(type)) {
|
||||||
var map: Map<string, any> = new Map();
|
var map = new Map<string, any>();
|
||||||
StringMapWrapper.forEach(obj,
|
StringMapWrapper.forEach(obj,
|
||||||
(val, key) => { map.set(key, this.deserialize(val, type, data)); });
|
(val, key) => { map.set(key, this.deserialize(val, type, data)); });
|
||||||
return map;
|
return map;
|
||||||
|
@ -329,7 +329,7 @@ export function humanizeTemplate(template: CompiledTemplate,
|
|||||||
humanizedTemplates: Map<number, StringMap<string, any>> = null):
|
humanizedTemplates: Map<number, StringMap<string, any>> = null):
|
||||||
StringMap<string, any> {
|
StringMap<string, any> {
|
||||||
if (isBlank(humanizedTemplates)) {
|
if (isBlank(humanizedTemplates)) {
|
||||||
humanizedTemplates = new Map();
|
humanizedTemplates = new Map<number, StringMap<string, any>>();
|
||||||
}
|
}
|
||||||
var result = humanizedTemplates.get(template.id);
|
var result = humanizedTemplates.get(template.id);
|
||||||
if (isPresent(result)) {
|
if (isPresent(result)) {
|
||||||
|
@ -608,7 +608,7 @@ function createProtoView(elementBinders = null, type: ViewType = null,
|
|||||||
type = ViewType.COMPONENT;
|
type = ViewType.COMPONENT;
|
||||||
}
|
}
|
||||||
var pv = new AppProtoView(type, isEmbeddedFragment, new RenderProtoViewRef(), null, null,
|
var pv = new AppProtoView(type, isEmbeddedFragment, new RenderProtoViewRef(), null, null,
|
||||||
new Map(), null, null);
|
new Map<string, number>(), null, null);
|
||||||
if (isBlank(elementBinders)) {
|
if (isBlank(elementBinders)) {
|
||||||
elementBinders = [];
|
elementBinders = [];
|
||||||
}
|
}
|
||||||
@ -703,7 +703,7 @@ class DirectiveWithAttributes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FakeViewResolver extends ViewResolver {
|
class FakeViewResolver extends ViewResolver {
|
||||||
_cmpViews: Map<Type, ViewMetadata> = new Map();
|
_cmpViews = new Map<Type, ViewMetadata>();
|
||||||
|
|
||||||
constructor() { super(); }
|
constructor() { super(); }
|
||||||
|
|
||||||
|
@ -151,11 +151,13 @@ export function main() {
|
|||||||
|
|
||||||
it("should not throw when not binding to a name exported by two directives", () => {
|
it("should not throw when not binding to a name exported by two directives", () => {
|
||||||
expect(() => {
|
expect(() => {
|
||||||
createDirectiveVariableBindings(new RenderElementBinder({variableBindings: new Map()}), [
|
createDirectiveVariableBindings(
|
||||||
directiveBinding({metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})}),
|
new RenderElementBinder({variableBindings: new Map<string, string>()}), [
|
||||||
directiveBinding(
|
directiveBinding(
|
||||||
{metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})})
|
{metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})}),
|
||||||
]);
|
directiveBinding(
|
||||||
|
{metadata: RenderDirectiveMetadata.create({exportAs: 'exportName'})})
|
||||||
|
]);
|
||||||
}).not.toThrow();
|
}).not.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -29,7 +29,7 @@ export function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createView(pv) {
|
function createView(pv) {
|
||||||
return new AppView(null, pv, null, null, null, null, new Map(), null, null);
|
return new AppView(null, pv, null, null, null, null, new Map<string, any>(), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
it('should support multiple AppProtoViews', () => {
|
it('should support multiple AppProtoViews', () => {
|
||||||
|
@ -183,12 +183,9 @@ export function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FakeXHR extends XHR {
|
class FakeXHR extends XHR {
|
||||||
_responses: Map<string, string>;
|
_responses = new Map<string, string>();
|
||||||
|
|
||||||
constructor() {
|
constructor() { super(); }
|
||||||
super();
|
|
||||||
this._responses = new Map();
|
|
||||||
}
|
|
||||||
|
|
||||||
get(url: string): Promise<string> {
|
get(url: string): Promise<string> {
|
||||||
var response = this._responses.get(url);
|
var response = this._responses.get(url);
|
||||||
|
@ -194,7 +194,7 @@ export function main() {
|
|||||||
class SomeComponent {}
|
class SomeComponent {}
|
||||||
|
|
||||||
class FakeXHR extends XHR {
|
class FakeXHR extends XHR {
|
||||||
_responses: Map<string, string> = new Map();
|
_responses = new Map<string, string>();
|
||||||
|
|
||||||
constructor() { super(); }
|
constructor() { super(); }
|
||||||
|
|
||||||
|
@ -95,14 +95,14 @@ export function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FakeEventManagerPlugin extends EventManagerPlugin {
|
class FakeEventManagerPlugin extends EventManagerPlugin {
|
||||||
_eventHandler: Map<string, Function> = new Map();
|
_eventHandler = new Map<string, Function>();
|
||||||
constructor(public _supports: string[]) { super(); }
|
constructor(public _supports: string[]) { super(); }
|
||||||
|
|
||||||
supports(eventName: string): boolean { return ListWrapper.contains(this._supports, eventName); }
|
supports(eventName: string): boolean { return ListWrapper.contains(this._supports, eventName); }
|
||||||
|
|
||||||
addEventListener(element, eventName: string, handler: Function) {
|
addEventListener(element, eventName: string, handler: Function) {
|
||||||
this._eventHandler.set(eventName, handler);
|
this._eventHandler.set(eventName, handler);
|
||||||
return () => { MapWrapper.delete(this._eventHandler, eventName) };
|
return () => { MapWrapper.delete(this._eventHandler, eventName); };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ export function main() {
|
|||||||
describe('createRenderView', () => {
|
describe('createRenderView', () => {
|
||||||
var nodeFactory: DomNodeFactory;
|
var nodeFactory: DomNodeFactory;
|
||||||
var eventDispatcher: SpyRenderEventDispatcher;
|
var eventDispatcher: SpyRenderEventDispatcher;
|
||||||
var componentTemplates: Map<number, RenderTemplateCmd[]> = new Map();
|
var componentTemplates = new Map<number, RenderTemplateCmd[]>();
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
nodeFactory = new DomNodeFactory(componentTemplates);
|
nodeFactory = new DomNodeFactory(componentTemplates);
|
||||||
eventDispatcher = new SpyRenderEventDispatcher();
|
eventDispatcher = new SpyRenderEventDispatcher();
|
||||||
@ -523,4 +523,4 @@ function mapAttrs(nodes: Node[], attrName): string[] {
|
|||||||
|
|
||||||
function mapText(nodes: Node[]): string[] {
|
function mapText(nodes: Node[]): string[] {
|
||||||
return nodes.map(node => DOM.getText(node));
|
return nodes.map(node => DOM.getText(node));
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,8 @@ var unused: Response;
|
|||||||
|
|
||||||
class MockBrowserJsonp extends BrowserJsonp {
|
class MockBrowserJsonp extends BrowserJsonp {
|
||||||
src: string;
|
src: string;
|
||||||
callbacks: Map<string, (data: any) => any>;
|
callbacks = new Map<string, (data: any) => any>();
|
||||||
constructor() {
|
constructor() { super(); }
|
||||||
super();
|
|
||||||
this.callbacks = new Map();
|
|
||||||
}
|
|
||||||
|
|
||||||
addEventListener(type: string, cb: (data: any) => any) { this.callbacks.set(type, cb); }
|
addEventListener(type: string, cb: (data: any) => any) { this.callbacks.set(type, cb); }
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class MockBrowserXHR extends BrowserXhr {
|
|||||||
response: any;
|
response: any;
|
||||||
responseText: string;
|
responseText: string;
|
||||||
setRequestHeader: any;
|
setRequestHeader: any;
|
||||||
callbacks: Map<string, Function>;
|
callbacks = new Map<string, Function>();
|
||||||
status: number;
|
status: number;
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -47,7 +47,6 @@ class MockBrowserXHR extends BrowserXhr {
|
|||||||
this.send = sendSpy = spy.spy('send');
|
this.send = sendSpy = spy.spy('send');
|
||||||
this.open = openSpy = spy.spy('open');
|
this.open = openSpy = spy.spy('open');
|
||||||
this.setRequestHeader = setRequestHeaderSpy = spy.spy('setRequestHeader');
|
this.setRequestHeader = setRequestHeaderSpy = spy.spy('setRequestHeader');
|
||||||
this.callbacks = new Map();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatusCode(status) { this.status = status; }
|
setStatusCode(status) { this.status = status; }
|
||||||
|
@ -5,19 +5,18 @@
|
|||||||
"path": "typings",
|
"path": "typings",
|
||||||
"bundle": "typings/tsd.d.ts",
|
"bundle": "typings/tsd.d.ts",
|
||||||
"installed": {
|
"installed": {
|
||||||
"es6-promise/es6-promise.d.ts": {
|
"es6-shim/es6-shim.d.ts": {
|
||||||
"commit": "be0b6b394f77a59e192ad7cfec18078706e44db5"
|
"commit": "4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c"
|
||||||
},
|
},
|
||||||
"hammerjs/hammerjs.d.ts": {
|
"hammerjs/hammerjs.d.ts": {
|
||||||
"commit": "22c44d95912a07f81c103a694330b15b92f7cb40"
|
"commit": "22c44d95912a07f81c103a694330b15b92f7cb40"
|
||||||
},
|
},
|
||||||
"jasmine/jasmine.d.ts": {
|
"jasmine/jasmine.d.ts": {
|
||||||
"commit": "055b3172e8eb374a75826710c4d08677872620d3"
|
"commit": "4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c"
|
||||||
},
|
},
|
||||||
"node/node.d.ts": {
|
"node/node.d.ts": {
|
||||||
"commit": "51738fdf1643d269067861b405e87503b7479236"
|
"commit": "51738fdf1643d269067861b405e87503b7479236"
|
||||||
},
|
},
|
||||||
|
|
||||||
"selenium-webdriver/selenium-webdriver.d.ts": {
|
"selenium-webdriver/selenium-webdriver.d.ts": {
|
||||||
"commit": "be0b6b394f77a59e192ad7cfec18078706e44db5"
|
"commit": "be0b6b394f77a59e192ad7cfec18078706e44db5"
|
||||||
},
|
},
|
||||||
|
@ -10026,7 +10026,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ts2dart": {
|
"ts2dart": {
|
||||||
"version": "0.7.9",
|
"version": "0.7.10",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"source-map": {
|
"source-map": {
|
||||||
"version": "0.4.4",
|
"version": "0.4.4",
|
||||||
|
6
npm-shrinkwrap.json
generated
6
npm-shrinkwrap.json
generated
@ -15496,9 +15496,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ts2dart": {
|
"ts2dart": {
|
||||||
"version": "0.7.9",
|
"version": "0.7.10",
|
||||||
"from": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.9.tgz",
|
"from": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.10.tgz",
|
||||||
"resolved": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.9.tgz",
|
"resolved": "https://registry.npmjs.org/ts2dart/-/ts2dart-0.7.10.tgz",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"source-map": {
|
"source-map": {
|
||||||
"version": "0.4.4",
|
"version": "0.4.4",
|
||||||
|
@ -128,7 +128,7 @@
|
|||||||
"temp": "^0.8.1",
|
"temp": "^0.8.1",
|
||||||
"ternary-stream": "^1.2.3",
|
"ternary-stream": "^1.2.3",
|
||||||
"through2": "^0.6.1",
|
"through2": "^0.6.1",
|
||||||
"ts2dart": "^0.7.9",
|
"ts2dart": "^0.7.10",
|
||||||
"tsd": "^0.6.5-beta",
|
"tsd": "^0.6.5-beta",
|
||||||
"tslint": "^2.5.0",
|
"tslint": "^2.5.0",
|
||||||
"typescript": "^1.6.2",
|
"typescript": "^1.6.2",
|
||||||
|
@ -19,11 +19,7 @@ class TSToDartTranspiler implements DiffingBroccoliPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rebuild(treeDiff: DiffResult) {
|
rebuild(treeDiff: DiffResult) {
|
||||||
// Matches rootFilePaths in node_tree.ts
|
let toEmit = [];
|
||||||
// These files are not compatible with Typescript's ES6 library
|
|
||||||
// so they must be explicitly included when targetting ES5, as ts2dart does.
|
|
||||||
// see https://github.com/angular/angular/issues/3770
|
|
||||||
let toEmit = [path.resolve(this.inputPath, 'angular2/manual_typings/traceur-runtime.d.ts')];
|
|
||||||
let getDartFilePath = (path: string) => path.replace(/((\.js)|(\.ts))$/i, '.dart');
|
let getDartFilePath = (path: string) => path.replace(/((\.js)|(\.ts))$/i, '.dart');
|
||||||
treeDiff.addedPaths.concat(treeDiff.changedPaths)
|
treeDiff.addedPaths.concat(treeDiff.changedPaths)
|
||||||
.forEach((changedPath) => {
|
.forEach((changedPath) => {
|
||||||
|
@ -78,8 +78,7 @@ module.exports = function makeBrowserTree(options, destinationPath) {
|
|||||||
'benchmarks/e2e_test/**',
|
'benchmarks/e2e_test/**',
|
||||||
'angular1_router/**',
|
'angular1_router/**',
|
||||||
// Exclude ES6 polyfill typings when tsc target=ES6
|
// Exclude ES6 polyfill typings when tsc target=ES6
|
||||||
'angular2/manual_typings/traceur-runtime.d.ts',
|
'angular2/typings/es6-*/**',
|
||||||
'angular2/typings/es6-promise/**'
|
|
||||||
],
|
],
|
||||||
destDir: '/'
|
destDir: '/'
|
||||||
});
|
});
|
||||||
|
@ -40,8 +40,7 @@ module.exports = function makeNodeTree(destinationPath) {
|
|||||||
moduleResolution: 1 /* classic */,
|
moduleResolution: 1 /* classic */,
|
||||||
noEmitOnError: true,
|
noEmitOnError: true,
|
||||||
rootDir: '.',
|
rootDir: '.',
|
||||||
rootFilePaths:
|
rootFilePaths: ['angular2/manual_typings/globals.d.ts'],
|
||||||
['angular2/manual_typings/traceur-runtime.d.ts', 'angular2/manual_typings/globals.d.ts'],
|
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
sourceRoot: '.',
|
sourceRoot: '.',
|
||||||
target: 'ES5'
|
target: 'ES5'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user