From 5458036de73929bdad8e2f5ff2bc7c3a01b8511b Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 6 Oct 2015 19:39:44 -0700 Subject: [PATCH] fix(typings): update test.typings for abstract superclasses --- docs/typescript-definition-package/index.js | 2 +- .../processors/code_gen.js | 4 ++++ .../processors/readTypeScriptModules.js | 7 +++++++ modules/angular2/src/core/application_ref.ts | 12 ++++++++---- modules/angular2/src/core/compiler/compiler.ts | 3 ++- modules/angular2/src/core/debug.ts | 2 +- modules/angular2/src/core/directives/ng_class.ts | 2 +- modules/angular2/src/core/directives/ng_style.ts | 2 +- modules/angular2/src/core/facade.ts | 4 ++-- modules/angular2/src/core/linker/view.ts | 3 +-- .../src/core/linker/view_manager_utils.ts | 6 ++---- modules/angular2/src/core/render/api.ts | 2 ++ .../angular2/src/core/testability/testability.ts | 3 +-- modules/angular2/src/router/path_recognizer.ts | 3 +-- modules/angular2/src/test_lib/test_injector.ts | 9 ++++++--- modules/angular2/src/tools/common_tools.ts | 3 +-- .../src/web_workers/shared/post_message_bus.ts | 3 +-- .../change_detection/change_detector_ref_spec.ts | 6 ++++-- .../angular2/test/core/linker/compiler_spec.ts | 4 +++- .../test/core/linker/element_injector_spec.ts | 3 +-- .../test/core/linker/integration_spec.ts | 6 +++--- .../test/core/linker/view_container_ref_spec.ts | 9 +++------ .../test/core/linker/view_manager_spec.ts | 16 +++++++++------- .../core/render/dom/events/event_manager_spec.ts | 3 +-- modules/angular2/test/core/spies.ts | 16 +++++++++++++++- .../test/core/testability/testability_spec.ts | 3 +-- modules/angular2/test/core/zone/ng_zone_spec.ts | 3 +-- .../test/http/backends/jsonp_backend_spec.ts | 7 +++++-- .../shared/render_proto_view_ref_store_spec.ts | 3 +-- .../shared/service_message_broker_spec.ts | 6 ++++-- .../worker/renderer_integration_spec.ts | 8 +++++--- .../test/web_workers/worker/xhr_impl_spec.ts | 4 ++-- modules/angular2/web_worker/ui.ts | 13 +++++++++++-- modules/angular2/web_worker/worker.ts | 13 +++++++++++-- 34 files changed, 122 insertions(+), 71 deletions(-) diff --git a/docs/typescript-definition-package/index.js b/docs/typescript-definition-package/index.js index 0f4f2e1cf9..115cdf03d4 100644 --- a/docs/typescript-definition-package/index.js +++ b/docs/typescript-definition-package/index.js @@ -74,7 +74,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, references: ['./angular2.d.ts', '../jasmine/jasmine.d.ts'], remapTypes: { Type: 'ng.Type', Binding: 'ng.Binding', ViewMetadata: 'ng.ViewMetadata', Injector: 'ng.Injector', Predicate: 'ng.Predicate', ElementRef: 'ng.ElementRef', DebugElement: 'ng.DebugElement', - InjectableReference: 'ng.InjectableReference' }, + InjectableReference: 'ng.InjectableReference', ComponentRef: 'ng.ComponentRef' }, modules: {'angular2/test_lib': {namespace: 'ngTestLib', id: 'angular2/test_lib'}} } ]; diff --git a/docs/typescript-definition-package/processors/code_gen.js b/docs/typescript-definition-package/processors/code_gen.js index 5d3c531669..c557f89c34 100644 --- a/docs/typescript-definition-package/processors/code_gen.js +++ b/docs/typescript-definition-package/processors/code_gen.js @@ -59,6 +59,10 @@ DtsSerializer.prototype = { }, interfaceOrClass: function(buffer, ast, isInterface) { + if (ast.abstract) { + buffer.push('abstract '); + } + buffer.push(isInterface ? 'interface ' : 'class '); buffer.push(ast.name); buffer.push(ast.typeParams); diff --git a/docs/typescript-package/processors/readTypeScriptModules.js b/docs/typescript-package/processors/readTypeScriptModules.js index 51e56a4242..9d345bc87f 100644 --- a/docs/typescript-package/processors/readTypeScriptModules.js +++ b/docs/typescript-package/processors/readTypeScriptModules.js @@ -223,6 +223,9 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, if (exportSymbol.flags & ts.SymbolFlags.TypeAlias) { exportDoc.typeDefinition = typeDefinition; } + if (isAbstract(exportSymbol)) { + exportDoc.abstract = true; + } // Compute the original module name from the relative file path exportDoc.originalModule = exportDoc.fileInfo.relativePath @@ -345,6 +348,10 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, } } + function isAbstract(symbol) { + var declaration = symbol.valueDeclaration || symbol.declarations[0]; + return declaration.flags & ts.NodeFlags.Abstract; + } function expandSourceFiles(sourceFiles, basePath) { var filePaths = []; diff --git a/modules/angular2/src/core/application_ref.ts b/modules/angular2/src/core/application_ref.ts index 3d1f14c353..739d02f845 100644 --- a/modules/angular2/src/core/application_ref.ts +++ b/modules/angular2/src/core/application_ref.ts @@ -39,6 +39,9 @@ import {ViewResolver} from './linker/view_resolver'; import {DirectiveResolver} from './linker/directive_resolver'; import {PipeResolver} from './linker/pipe_resolver'; import {Compiler} from 'angular2/src/core/linker/compiler'; +import {DynamicComponentLoader_} from "./linker/dynamic_component_loader"; +import {AppViewManager_} from "./linker/view_manager"; +import {Compiler_} from "./linker/compiler"; /** * Constructs the set of bindings meant for use at the platform level. @@ -71,7 +74,7 @@ function _componentBindings(appComponentType: Type): Array) => p.then(ref => ref.instance), [APP_COMPONENT_REF_PROMISE]), @@ -84,11 +87,12 @@ function _componentBindings(appComponentType: Type): Array { return [ - Compiler, + bind(Compiler) + .toClass(Compiler_), APP_ID_RANDOM_BINDING, AppViewPool, bind(APP_VIEW_POOL_CAPACITY).toValue(10000), - AppViewManager, + bind(AppViewManager).toClass(AppViewManager_), AppViewManagerUtils, AppViewListener, ProtoViewFactory, @@ -98,7 +102,7 @@ export function applicationCommonBindings(): Array { bind(KeyValueDiffers).toValue(defaultKeyValueDiffers), DirectiveResolver, PipeResolver, - DynamicComponentLoader, + bind(DynamicComponentLoader).toClass(DynamicComponentLoader_), bind(LifeCycle).toFactory((exceptionHandler) => new LifeCycle_(null, assertionsEnabled()), [ExceptionHandler]), ]; diff --git a/modules/angular2/src/core/compiler/compiler.ts b/modules/angular2/src/core/compiler/compiler.ts index b064af3af1..f4a5769163 100644 --- a/modules/angular2/src/core/compiler/compiler.ts +++ b/modules/angular2/src/core/compiler/compiler.ts @@ -1,3 +1,4 @@ +import {RuntimeCompiler_} from "./runtime_compiler"; export {TemplateCompiler} from './template_compiler'; export { CompileDirectiveMetadata, @@ -43,7 +44,7 @@ export function compilerBindings(): Array { .toValue( new ChangeDetectorGenConfig(assertionsEnabled(), assertionsEnabled(), false, true)), TemplateCompiler, - RuntimeCompiler, + bind(RuntimeCompiler).toClass(RuntimeCompiler_), bind(Compiler).toAlias(RuntimeCompiler), DomElementSchemaRegistry, bind(ElementSchemaRegistry).toAlias(DomElementSchemaRegistry), diff --git a/modules/angular2/src/core/debug.ts b/modules/angular2/src/core/debug.ts index 2dc562ad3d..47e910330d 100644 --- a/modules/angular2/src/core/debug.ts +++ b/modules/angular2/src/core/debug.ts @@ -1,2 +1,2 @@ -export * from './debug/debug_element'; +export {DebugElement, asNativeElements, By, Scope, inspectElement} from './debug/debug_element'; export {inspectNativeElement, ELEMENT_PROBE_BINDINGS} from './debug/debug_element_view_listener'; diff --git a/modules/angular2/src/core/directives/ng_class.ts b/modules/angular2/src/core/directives/ng_class.ts index bf21256e72..97b4d59076 100644 --- a/modules/angular2/src/core/directives/ng_class.ts +++ b/modules/angular2/src/core/directives/ng_class.ts @@ -40,7 +40,7 @@ export class NgClass implements DoCheck, OnDestroy { private _rawClass; constructor(private _iterableDiffers: IterableDiffers, private _keyValueDiffers: KeyValueDiffers, - private _ngEl: ElementRef_, private _renderer: Renderer) {} + private _ngEl: ElementRef, private _renderer: Renderer) {} set initialClasses(v) { this._applyInitialClasses(true); diff --git a/modules/angular2/src/core/directives/ng_style.ts b/modules/angular2/src/core/directives/ng_style.ts index 2e7788932f..0e21971963 100644 --- a/modules/angular2/src/core/directives/ng_style.ts +++ b/modules/angular2/src/core/directives/ng_style.ts @@ -66,7 +66,7 @@ export class NgStyle implements DoCheck { _rawStyle; _differ: KeyValueDiffer; - constructor(private _differs: KeyValueDiffers, private _ngEl: ElementRef_, + constructor(private _differs: KeyValueDiffers, private _ngEl: ElementRef, private _renderer: Renderer) {} set rawStyle(v) { diff --git a/modules/angular2/src/core/facade.ts b/modules/angular2/src/core/facade.ts index e93eb63147..b6918338d9 100644 --- a/modules/angular2/src/core/facade.ts +++ b/modules/angular2/src/core/facade.ts @@ -1,5 +1,5 @@ // Public API for Facade -export {Type} from './facade/lang'; +export {ConcreteType, Type} from './facade/lang'; export {Observable, EventEmitter} from './facade/async'; export {Predicate} from './facade/collection'; -export {WrappedException} from './facade/exceptions'; \ No newline at end of file +export {WrappedException} from './facade/exceptions'; diff --git a/modules/angular2/src/core/linker/view.ts b/modules/angular2/src/core/linker/view.ts index f023982ca1..eff1f70382 100644 --- a/modules/angular2/src/core/linker/view.ts +++ b/modules/angular2/src/core/linker/view.ts @@ -33,8 +33,7 @@ import {ElementRef} from './element_ref'; import {ProtoPipes} from 'angular2/src/core/pipes/pipes'; import {camelCaseToDashCase} from 'angular2/src/core/render/dom/util'; import {TemplateCmd} from './template_commands'; -import {ViewRef_} from "./view_ref"; -import {ProtoViewRef_} from "./view_ref"; +import {ViewRef_, ProtoViewRef_} from "./view_ref"; export {DebugContext} from 'angular2/src/core/change_detection/interfaces'; diff --git a/modules/angular2/src/core/linker/view_manager_utils.ts b/modules/angular2/src/core/linker/view_manager_utils.ts index 4e2da74f55..0742d79a4b 100644 --- a/modules/angular2/src/core/linker/view_manager_utils.ts +++ b/modules/angular2/src/core/linker/view_manager_utils.ts @@ -4,13 +4,11 @@ import * as eli from './element_injector'; import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; import * as viewModule from './view'; import * as avmModule from './view_manager'; -import {ElementRef} from './element_ref'; -import {TemplateRef} from './template_ref'; +import {ElementRef, ElementRef_} from './element_ref'; +import {TemplateRef, TemplateRef_} from './template_ref'; import {Renderer, RenderViewWithFragments} from 'angular2/src/core/render/api'; import {Locals} from 'angular2/src/core/change_detection/change_detection'; import {Pipes} from 'angular2/src/core/pipes/pipes'; -import {TemplateRef_} from "./template_ref"; -import {ElementRef_} from "./element_ref"; @Injectable() export class AppViewManagerUtils { diff --git a/modules/angular2/src/core/render/api.ts b/modules/angular2/src/core/render/api.ts index cc4d3ef9db..f5935a8dfb 100644 --- a/modules/angular2/src/core/render/api.ts +++ b/modules/angular2/src/core/render/api.ts @@ -152,6 +152,8 @@ export interface RenderElementRef { renderView: RenderViewRef; /** + * @internal + * * Index of the Element (in the depth-first order) inside the Render View. * * This index is used internally by Angular to locate elements. diff --git a/modules/angular2/src/core/testability/testability.ts b/modules/angular2/src/core/testability/testability.ts index f9d48d195c..4b4b9b4f8e 100644 --- a/modules/angular2/src/core/testability/testability.ts +++ b/modules/angular2/src/core/testability/testability.ts @@ -3,9 +3,8 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {CONST, CONST_EXPR} from 'angular2/src/core/facade/lang'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; -import {NgZone} from '../zone/ng_zone'; +import {NgZone, NgZone_} from '../zone/ng_zone'; import {PromiseWrapper} from 'angular2/src/core/facade/async'; -import {NgZone_} from "../zone/ng_zone"; /** diff --git a/modules/angular2/src/router/path_recognizer.ts b/modules/angular2/src/router/path_recognizer.ts index 20a14facce..1c5711cdbe 100644 --- a/modules/angular2/src/router/path_recognizer.ts +++ b/modules/angular2/src/router/path_recognizer.ts @@ -12,8 +12,7 @@ import {Map, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collec import {RouteHandler} from './route_handler'; import {Url, RootUrl, serializeParams} from './url_parser'; -import {ComponentInstruction} from './instruction'; -import {ComponentInstruction_} from "./instruction"; +import {ComponentInstruction, ComponentInstruction_} from "./instruction"; class TouchMap { map: {[key: string]: string} = {}; diff --git a/modules/angular2/src/test_lib/test_injector.ts b/modules/angular2/src/test_lib/test_injector.ts index bd7d70ae6c..d752b46ab7 100644 --- a/modules/angular2/src/test_lib/test_injector.ts +++ b/modules/angular2/src/test_lib/test_injector.ts @@ -57,6 +57,9 @@ import {APP_ID} from 'angular2/src/core/application_tokens'; import {Serializer} from "angular2/src/web_workers/shared/serializer"; import {Log} from './utils'; import {compilerBindings} from 'angular2/src/core/compiler/compiler'; +import {DomRenderer_} from "../core/render/dom/dom_renderer"; +import {DynamicComponentLoader_} from "../core/linker/dynamic_component_loader"; +import {AppViewManager_} from "../core/linker/view_manager"; /** * Returns the root injector bindings. @@ -93,13 +96,13 @@ function _getAppBindings() { compilerBindings(), bind(ChangeDetectorGenConfig).toValue(new ChangeDetectorGenConfig(true, true, false, true)), bind(DOCUMENT).toValue(appDoc), - DomRenderer, + bind(DomRenderer).toClass(DomRenderer_), bind(Renderer).toAlias(DomRenderer), bind(APP_ID).toValue('a'), DomSharedStylesHost, bind(SharedStylesHost).toAlias(DomSharedStylesHost), AppViewPool, - AppViewManager, + bind(AppViewManager).toClass(AppViewManager_), AppViewManagerUtils, Serializer, ELEMENT_PROBE_BINDINGS, @@ -111,7 +114,7 @@ function _getAppBindings() { bind(IterableDiffers).toValue(defaultIterableDiffers), bind(KeyValueDiffers).toValue(defaultKeyValueDiffers), Log, - DynamicComponentLoader, + bind(DynamicComponentLoader).toClass(DynamicComponentLoader_), PipeResolver, bind(ExceptionHandler).toValue(new ExceptionHandler(DOM)), bind(LocationStrategy).toClass(MockLocationStrategy), diff --git a/modules/angular2/src/tools/common_tools.ts b/modules/angular2/src/tools/common_tools.ts index eb87beb831..59174de4bb 100644 --- a/modules/angular2/src/tools/common_tools.ts +++ b/modules/angular2/src/tools/common_tools.ts @@ -1,9 +1,8 @@ import {LifeCycle} from 'angular2/angular2'; -import {ComponentRef} from 'angular2/src/core/linker/dynamic_component_loader'; +import {ComponentRef, ComponentRef_} from 'angular2/src/core/linker/dynamic_component_loader'; import {isPresent, NumberWrapper} from 'angular2/src/core/facade/lang'; import {performance, window} from 'angular2/src/core/facade/browser'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {ComponentRef_} from "../core/linker/dynamic_component_loader"; /** * Entry point for all Angular debug tools. This object corresponds to the `ng` diff --git a/modules/angular2/src/web_workers/shared/post_message_bus.ts b/modules/angular2/src/web_workers/shared/post_message_bus.ts index 96d206b9b7..211e043b99 100644 --- a/modules/angular2/src/web_workers/shared/post_message_bus.ts +++ b/modules/angular2/src/web_workers/shared/post_message_bus.ts @@ -7,8 +7,7 @@ import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptio import {EventEmitter} from 'angular2/src/core/facade/async'; import {StringMapWrapper} from 'angular2/src/core/facade/collection'; import {Injectable} from "angular2/src/core/di"; -import {NgZone} from 'angular2/src/core/zone/ng_zone'; -import {NgZone_} from "../../core/zone/ng_zone"; +import {NgZone, NgZone_} from 'angular2/src/core/zone/ng_zone'; /** * A TypeScript implementation of {@link MessageBus} for communicating via JavaScript's diff --git a/modules/angular2/test/core/change_detection/change_detector_ref_spec.ts b/modules/angular2/test/core/change_detection/change_detector_ref_spec.ts index c5727b23eb..97f39263d3 100644 --- a/modules/angular2/test/core/change_detection/change_detector_ref_spec.ts +++ b/modules/angular2/test/core/change_detection/change_detector_ref_spec.ts @@ -11,9 +11,11 @@ import { fakeAsync } from 'angular2/test_lib'; -import {ChangeDetectorRef} from 'angular2/src/core/change_detection/change_detector_ref'; +import { + ChangeDetectorRef, + ChangeDetectorRef_ +} from 'angular2/src/core/change_detection/change_detector_ref'; import {SpyChangeDetector} from '../spies'; -import {ChangeDetectorRef_} from "../../../src/core/change_detection/change_detector_ref"; export function main() { diff --git a/modules/angular2/test/core/linker/compiler_spec.ts b/modules/angular2/test/core/linker/compiler_spec.ts index d68a5cb46a..0fb703aebe 100644 --- a/modules/angular2/test/core/linker/compiler_spec.ts +++ b/modules/angular2/test/core/linker/compiler_spec.ts @@ -24,6 +24,7 @@ import {Compiler} from 'angular2/src/core/linker/compiler'; import {ProtoViewFactory} from 'angular2/src/core/linker/proto_view_factory'; import {reflector, ReflectionInfo} from 'angular2/src/core/reflection/reflection'; import {AppProtoView} from 'angular2/src/core/linker/view'; +import {Compiler_} from "../../../src/core/linker/compiler"; export function main() { describe('Compiler', () => { @@ -36,7 +37,8 @@ export function main() { protoViewFactorySpy = new SpyProtoViewFactory(); someProtoView = new AppProtoView(null, null, null, null, null, null); protoViewFactorySpy.spy('createHost').andReturn(someProtoView); - return [bind(ProtoViewFactory).toValue(protoViewFactorySpy), Compiler]; + return + [bind(ProtoViewFactory).toValue(protoViewFactorySpy), bind(Compiler).toClass(Compiler_)]; }); beforeEach(inject([Compiler], (_compiler) => { diff --git a/modules/angular2/test/core/linker/element_injector_spec.ts b/modules/angular2/test/core/linker/element_injector_spec.ts index 981ba9041d..682c6a1cc6 100644 --- a/modules/angular2/test/core/linker/element_injector_spec.ts +++ b/modules/angular2/test/core/linker/element_injector_spec.ts @@ -40,12 +40,11 @@ import { import {OnDestroy} from 'angular2/lifecycle_hooks'; import {bind, Injector, Binding, Optional, Inject, Injectable, Self, SkipSelf, InjectMetadata, Host, HostMetadata, SkipSelfMetadata} from 'angular2/core'; import {ViewContainerRef} from 'angular2/src/core/linker/view_container_ref'; -import {TemplateRef} from 'angular2/src/core/linker/template_ref'; +import {TemplateRef, TemplateRef_} from 'angular2/src/core/linker/template_ref'; import {ElementRef} from 'angular2/src/core/linker/element_ref'; import {DynamicChangeDetector, ChangeDetectorRef, Parser, Lexer} from 'angular2/src/core/change_detection/change_detection'; import {QueryList} from 'angular2/src/core/linker/query_list'; import {AppView, AppViewContainer} from "angular2/src/core/linker/view"; -import {TemplateRef_} from "../../../src/core/linker/template_ref"; function createDummyView(detector = null): AppView { var res = new SpyView(); diff --git a/modules/angular2/test/core/linker/integration_spec.ts b/modules/angular2/test/core/linker/integration_spec.ts index 10eecc7ab4..b3e359d56a 100644 --- a/modules/angular2/test/core/linker/integration_spec.ts +++ b/modules/angular2/test/core/linker/integration_spec.ts @@ -82,7 +82,7 @@ import { import {QueryList} from 'angular2/src/core/linker/query_list'; import {ViewContainerRef} from 'angular2/src/core/linker/view_container_ref'; -import {ViewRef} from 'angular2/src/core/linker/view_ref'; +import {ViewRef, ViewRef_} from 'angular2/src/core/linker/view_ref'; import {Compiler} from 'angular2/src/core/linker/compiler'; import {ElementRef} from 'angular2/src/core/linker/element_ref'; @@ -90,7 +90,7 @@ import {TemplateRef} from 'angular2/src/core/linker/template_ref'; import {DomRenderer} from 'angular2/src/core/render/dom/dom_renderer'; import {IS_DART} from '../../platform'; -import {ViewRef_} from "../../../src/core/linker/view_ref"; +import {Compiler_} from "../../../src/core/linker/compiler"; const ANCHOR_ELEMENT = CONST_EXPR(new OpaqueToken('AnchorElement')); @@ -1020,7 +1020,7 @@ export function main() { describe('dynamic ViewContainers', () => { it('should allow to create a ViewContainerRef at any bound location', - inject([TestComponentBuilder, AsyncTestCompleter, Compiler], + inject([TestComponentBuilder, AsyncTestCompleter, bind(Compiler).toClass(Compiler_)], (tcb: TestComponentBuilder, async, compiler) => { tcb.overrideView(MyComp, new ViewMetadata({ template: '
', diff --git a/modules/angular2/test/core/linker/view_container_ref_spec.ts b/modules/angular2/test/core/linker/view_container_ref_spec.ts index 23eaa19cfe..27074c66c8 100644 --- a/modules/angular2/test/core/linker/view_container_ref_spec.ts +++ b/modules/angular2/test/core/linker/view_container_ref_spec.ts @@ -16,12 +16,9 @@ import { import {SpyView, SpyAppViewManager} from '../spies'; import {AppView, AppViewContainer} from 'angular2/src/core/linker/view'; -import {ViewContainerRef} from 'angular2/src/core/linker/view_container_ref'; -import {ElementRef} from 'angular2/src/core/linker/element_ref'; -import {ViewRef} from 'angular2/src/core/linker/view_ref'; -import {ViewContainerRef_} from "../../../src/core/linker/view_container_ref"; -import {ViewRef_} from "../../../src/core/linker/view_ref"; -import {ElementRef_} from "../../../src/core/linker/element_ref"; +import {ViewContainerRef, ViewContainerRef_} from 'angular2/src/core/linker/view_container_ref'; +import {ElementRef, ElementRef_} from 'angular2/src/core/linker/element_ref'; +import {ViewRef, ViewRef_} from 'angular2/src/core/linker/view_ref'; export function main() { // TODO(tbosch): add missing tests diff --git a/modules/angular2/test/core/linker/view_manager_spec.ts b/modules/angular2/test/core/linker/view_manager_spec.ts index b27d281337..1012f02eb0 100644 --- a/modules/angular2/test/core/linker/view_manager_spec.ts +++ b/modules/angular2/test/core/linker/view_manager_spec.ts @@ -17,9 +17,15 @@ import {SpyRenderer, SpyAppViewPool, SpyAppViewListener, SpyProtoViewFactory} fr import {Injector, bind} from 'angular2/core'; import {AppProtoView, AppView, AppViewContainer, ViewType} from 'angular2/src/core/linker/view'; -import {ProtoViewRef, ViewRef, internalView} from 'angular2/src/core/linker/view_ref'; +import { + ProtoViewRef, + ProtoViewRef_, + ViewRef, + ViewRef_, + internalView +} from 'angular2/src/core/linker/view_ref'; import {ElementRef} from 'angular2/src/core/linker/element_ref'; -import {TemplateRef} from 'angular2/src/core/linker/template_ref'; +import {TemplateRef, TemplateRef_} from 'angular2/src/core/linker/template_ref'; import { Renderer, RenderViewRef, @@ -27,7 +33,7 @@ import { RenderFragmentRef, RenderViewWithFragments } from 'angular2/src/core/render/api'; -import {AppViewManager} from 'angular2/src/core/linker/view_manager'; +import {AppViewManager, AppViewManager_} from 'angular2/src/core/linker/view_manager'; import {AppViewManagerUtils} from 'angular2/src/core/linker/view_manager_utils'; import { @@ -38,10 +44,6 @@ import { createNestedElBinder, createProtoElInjector } from './view_manager_utils_spec'; -import {ProtoViewRef_} from "../../../src/core/linker/view_ref"; -import {ViewRef_} from "../../../src/core/linker/view_ref"; -import {AppViewManager_} from "../../../src/core/linker/view_manager"; -import {TemplateRef_} from "../../../src/core/linker/template_ref"; export function main() { // TODO(tbosch): add missing tests diff --git a/modules/angular2/test/core/render/dom/events/event_manager_spec.ts b/modules/angular2/test/core/render/dom/events/event_manager_spec.ts index b8f5f989d0..0d4abc29e5 100644 --- a/modules/angular2/test/core/render/dom/events/event_manager_spec.ts +++ b/modules/angular2/test/core/render/dom/events/event_manager_spec.ts @@ -14,10 +14,9 @@ import { EventManagerPlugin, DomEventsPlugin } from 'angular2/src/core/render/dom/events/event_manager'; -import {NgZone} from 'angular2/src/core/zone/ng_zone'; +import {NgZone, NgZone_} from 'angular2/src/core/zone/ng_zone'; import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {NgZone_} from "../../../../../src/core/zone/ng_zone"; export function main() { var domEventPlugin; diff --git a/modules/angular2/test/core/spies.ts b/modules/angular2/test/core/spies.ts index 7846e5f99d..8bcfdc1ab2 100644 --- a/modules/angular2/test/core/spies.ts +++ b/modules/angular2/test/core/spies.ts @@ -53,7 +53,21 @@ export class SpyAppViewManager extends SpyObject { } export class SpyRenderer extends SpyObject { - constructor() { super(Renderer); } + constructor() { + // Note: Renderer is an abstract class, + // so we can't generates spy functions automatically + // by inspecting the prototype... + super(Renderer); + this.spy('setEventDispatcher'); + this.spy('destroyView'); + this.spy('createView'); + this.spy('createProtoView'); + this.spy('hydrateView'); + this.spy('dehydrateView'); + this.spy('attachFragmentAfterElement'); + this.spy('attachFragmentAfterFragment'); + this.spy('detachFragment'); + } } export class SpyAppViewPool extends SpyObject { diff --git a/modules/angular2/test/core/testability/testability_spec.ts b/modules/angular2/test/core/testability/testability_spec.ts index ca240540b8..39ccb6d9c0 100644 --- a/modules/angular2/test/core/testability/testability_spec.ts +++ b/modules/angular2/test/core/testability/testability_spec.ts @@ -12,10 +12,9 @@ import { SpyObject } from 'angular2/test_lib'; import {Testability} from 'angular2/src/core/testability/testability'; -import {NgZone} from 'angular2/src/core/zone/ng_zone'; +import {NgZone, NgZone_} from 'angular2/src/core/zone/ng_zone'; import {normalizeBlank} from 'angular2/src/core/facade/lang'; import {PromiseWrapper} from 'angular2/src/core/facade/async'; -import {NgZone_} from "../../../src/core/zone/ng_zone"; // Schedules a microtasks (using a resolved promise .then()) function microTask(fn: Function): void { diff --git a/modules/angular2/test/core/zone/ng_zone_spec.ts b/modules/angular2/test/core/zone/ng_zone_spec.ts index 952168447b..419ec4d285 100644 --- a/modules/angular2/test/core/zone/ng_zone_spec.ts +++ b/modules/angular2/test/core/zone/ng_zone_spec.ts @@ -17,8 +17,7 @@ import { import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/core/facade/async'; import {BaseException} from 'angular2/src/core/facade/exceptions'; -import {NgZone} from 'angular2/src/core/zone/ng_zone'; -import {NgZone_} from "../../../src/core/zone/ng_zone"; +import {NgZone, NgZone_} from 'angular2/src/core/zone/ng_zone'; var needsLongerTimers = browserDetection.isSlow || browserDetection.isEdge; var resultTimer = 1000; diff --git a/modules/angular2/test/http/backends/jsonp_backend_spec.ts b/modules/angular2/test/http/backends/jsonp_backend_spec.ts index be1b8ab12b..09a8d7d7ec 100644 --- a/modules/angular2/test/http/backends/jsonp_backend_spec.ts +++ b/modules/angular2/test/http/backends/jsonp_backend_spec.ts @@ -13,7 +13,11 @@ import { } from 'angular2/test_lib'; import {ObservableWrapper} from 'angular2/src/core/facade/async'; import {BrowserJsonp} from 'angular2/src/http/backends/browser_jsonp'; -import {JSONPConnection, JSONPBackend} from 'angular2/src/http/backends/jsonp_backend'; +import { + JSONPConnection, + JSONPConnection_, + JSONPBackend +} from 'angular2/src/http/backends/jsonp_backend'; import {bind, Injector} from 'angular2/core'; import {isPresent, StringWrapper} from 'angular2/src/core/facade/lang'; import {TimerWrapper} from 'angular2/src/core/facade/async'; @@ -23,7 +27,6 @@ import {Map} from 'angular2/src/core/facade/collection'; import {RequestOptions, BaseRequestOptions} from 'angular2/src/http/base_request_options'; import {BaseResponseOptions, ResponseOptions} from 'angular2/src/http/base_response_options'; import {ResponseTypes, ReadyStates, RequestMethods} from 'angular2/src/http/enums'; -import {JSONPConnection_} from "../../../src/http/backends/jsonp_backend"; var addEventListenerSpy; var existingScripts = []; diff --git a/modules/angular2/test/web_workers/shared/render_proto_view_ref_store_spec.ts b/modules/angular2/test/web_workers/shared/render_proto_view_ref_store_spec.ts index a93d4b2a81..8329432d3b 100644 --- a/modules/angular2/test/web_workers/shared/render_proto_view_ref_store_spec.ts +++ b/modules/angular2/test/web_workers/shared/render_proto_view_ref_store_spec.ts @@ -7,12 +7,11 @@ import { it, expect } from "angular2/test_lib"; -import {RenderProtoViewRef} from "angular2/src/core/render/api"; +import {RenderProtoViewRef, RenderProtoViewRef_} from "angular2/src/core/render/api"; import {RenderProtoViewRefStore} from "angular2/src/web_workers/shared/render_proto_view_ref_store"; import { WebWorkerRenderProtoViewRef } from "angular2/src/web_workers/shared/render_proto_view_ref_store"; -import {RenderProtoViewRef_} from "../../../src/core/render/api"; export function main() { describe("RenderProtoViewRefStore", () => { diff --git a/modules/angular2/test/web_workers/shared/service_message_broker_spec.ts b/modules/angular2/test/web_workers/shared/service_message_broker_spec.ts index b9e1caa2cf..ebc4de489a 100644 --- a/modules/angular2/test/web_workers/shared/service_message_broker_spec.ts +++ b/modules/angular2/test/web_workers/shared/service_message_broker_spec.ts @@ -12,7 +12,10 @@ import { } from 'angular2/test_lib'; import {createPairedMessageBuses} from '../shared/web_worker_test_util'; import {Serializer, PRIMITIVE} from 'angular2/src/web_workers/shared/serializer'; -import {ServiceMessageBroker} from 'angular2/src/web_workers/shared/service_message_broker'; +import { + ServiceMessageBroker, + ServiceMessageBroker_ +} from 'angular2/src/web_workers/shared/service_message_broker'; import {ObservableWrapper, PromiseWrapper} from 'angular2/src/core/facade/async'; import {bind} from 'angular2/core'; import {ON_WEB_WORKER} from 'angular2/src/web_workers/shared/api'; @@ -20,7 +23,6 @@ import {RenderProtoViewRefStore} from 'angular2/src/web_workers/shared/render_pr import { RenderViewWithFragmentsStore } from 'angular2/src/web_workers/shared/render_view_with_fragments_store'; -import {ServiceMessageBroker_} from "../../../src/web_workers/shared/service_message_broker"; export function main() { const CHANNEL = "UIMessageBroker Test Channel"; diff --git a/modules/angular2/test/web_workers/worker/renderer_integration_spec.ts b/modules/angular2/test/web_workers/worker/renderer_integration_spec.ts index da560bc46d..c802a1615a 100644 --- a/modules/angular2/test/web_workers/worker/renderer_integration_spec.ts +++ b/modules/angular2/test/web_workers/worker/renderer_integration_spec.ts @@ -26,6 +26,7 @@ import { import {WebWorkerRenderer} from "angular2/src/web_workers/worker/renderer"; import { ClientMessageBrokerFactory, + ClientMessageBrokerFactory_, UiArguments, FnArg } from "angular2/src/web_workers/shared/client_message_broker"; @@ -50,10 +51,11 @@ import { import {WebWorkerApplication} from 'angular2/src/web_workers/ui/impl'; import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer'; import {createPairedMessageBuses, PairedMessageBuses} from '../shared/web_worker_test_util'; -import {ServiceMessageBrokerFactory} from 'angular2/src/web_workers/shared/service_message_broker'; +import { + ServiceMessageBrokerFactory, + ServiceMessageBrokerFactory_ +} from 'angular2/src/web_workers/shared/service_message_broker'; import {WebWorkerEventDispatcher} from 'angular2/src/web_workers/worker/event_dispatcher'; -import {ServiceMessageBrokerFactory_} from "../../../src/web_workers/shared/service_message_broker"; -import {ClientMessageBrokerFactory_} from "../../../src/web_workers/shared/client_message_broker"; export function main() { diff --git a/modules/angular2/test/web_workers/worker/xhr_impl_spec.ts b/modules/angular2/test/web_workers/worker/xhr_impl_spec.ts index 5a4b5c8d71..734e35f867 100644 --- a/modules/angular2/test/web_workers/worker/xhr_impl_spec.ts +++ b/modules/angular2/test/web_workers/worker/xhr_impl_spec.ts @@ -13,11 +13,11 @@ import {Type} from 'angular2/src/core/facade/lang'; import { ClientMessageBroker, UiArguments, - ClientMessageBrokerFactory + ClientMessageBrokerFactory, + ClientMessageBrokerFactory_ } from 'angular2/src/web_workers/shared/client_message_broker'; import {WebWorkerXHRImpl} from "angular2/src/web_workers/worker/xhr_impl"; import {PromiseWrapper} from "angular2/src/core/facade/async"; -import {ClientMessageBrokerFactory_} from "../../../src/web_workers/shared/client_message_broker"; export function main() { describe("WebWorkerXHRImpl", () => { diff --git a/modules/angular2/web_worker/ui.ts b/modules/angular2/web_worker/ui.ts index 1bc668c5ce..d6058940fe 100644 --- a/modules/angular2/web_worker/ui.ts +++ b/modules/angular2/web_worker/ui.ts @@ -1,6 +1,15 @@ export * from '../src/core/facade'; export * from '../src/core/zone'; export * from "../src/web_workers/ui/application"; -export * from "../src/web_workers/shared/client_message_broker"; -export * from "../src/web_workers/shared/service_message_broker"; +export { + ClientMessageBroker, + ClientMessageBrokerFactory, + FnArg, + UiArguments +} from "../src/web_workers/shared/client_message_broker"; +export { + ReceivedMessage, + ServiceMessageBroker, + ServiceMessageBrokerFactory +} from "../src/web_workers/shared/service_message_broker"; export {PRIMITIVE} from '../src/web_workers/shared/serializer'; diff --git a/modules/angular2/web_worker/worker.ts b/modules/angular2/web_worker/worker.ts index cf9be1c3c6..291e818abe 100644 --- a/modules/angular2/web_worker/worker.ts +++ b/modules/angular2/web_worker/worker.ts @@ -40,6 +40,15 @@ export * from '../src/core/change_detection'; export * from '../profile'; export * from '../src/web_workers/worker/application'; -export * from '../src/web_workers/shared/client_message_broker'; -export * from '../src/web_workers/shared/service_message_broker'; +export { + ClientMessageBroker, + ClientMessageBrokerFactory, + FnArg, + UiArguments +} from '../src/web_workers/shared/client_message_broker'; +export { + ReceivedMessage, + ServiceMessageBroker, + ServiceMessageBrokerFactory +} from '../src/web_workers/shared/service_message_broker'; export {PRIMITIVE} from '../src/web_workers/shared/serializer';