From 892d2b9652f2fdce79fd1068406bc317a3696a77 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Thu, 10 Sep 2015 08:42:16 -0700 Subject: [PATCH] refactor(exception_handler): move ExceptionHandler into facade --- modules/angular2/src/core/application_common.ts | 2 +- modules/angular2/src/core/{ => facade}/exception_handler.ts | 2 -- modules/angular2/src/core/platform_bindings.ts | 2 +- modules/angular2/src/test_lib/test_injector.ts | 2 +- modules/angular2/src/test_lib/test_lib.dart | 2 +- modules/angular2/src/test_lib/test_lib.ts | 2 +- modules/angular2/src/web_workers/ui/di_bindings.ts | 2 +- modules/angular2/src/web_workers/worker/application_common.ts | 2 +- modules/angular2/test/core/application_spec.ts | 2 +- .../angular2/test/core/{ => facade}/exception_handler_spec.ts | 2 +- modules/angular2/test/router/route_config_spec.ts | 2 +- 11 files changed, 10 insertions(+), 12 deletions(-) rename modules/angular2/src/core/{ => facade}/exception_handler.ts (98%) rename modules/angular2/test/core/{ => facade}/exception_handler_spec.ts (97%) diff --git a/modules/angular2/src/core/application_common.ts b/modules/angular2/src/core/application_common.ts index 861360c7b5..e88241e9e3 100644 --- a/modules/angular2/src/core/application_common.ts +++ b/modules/angular2/src/core/application_common.ts @@ -27,7 +27,7 @@ import { KeyValueDiffers, defaultKeyValueDiffers } from 'angular2/src/core/change_detection/change_detection'; -import {ExceptionHandler} from './exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {ViewLoader} from 'angular2/src/core/render/dom/compiler/view_loader'; import {StyleUrlResolver} from 'angular2/src/core/render/dom/compiler/style_url_resolver'; import {StyleInliner} from 'angular2/src/core/render/dom/compiler/style_inliner'; diff --git a/modules/angular2/src/core/exception_handler.ts b/modules/angular2/src/core/facade/exception_handler.ts similarity index 98% rename from modules/angular2/src/core/exception_handler.ts rename to modules/angular2/src/core/facade/exception_handler.ts index 66d389b863..650975a74d 100644 --- a/modules/angular2/src/core/exception_handler.ts +++ b/modules/angular2/src/core/facade/exception_handler.ts @@ -1,4 +1,3 @@ -import {Injectable} from 'angular2/src/core/di'; import {isPresent, isBlank, print, BaseException} from 'angular2/src/core/facade/lang'; import {ListWrapper, isListLikeIterable} from 'angular2/src/core/facade/collection'; @@ -31,7 +30,6 @@ class _ArrayLogger { * * ``` */ -@Injectable() export class ExceptionHandler { constructor(private _logger: any, private _rethrowException: boolean = true) {} diff --git a/modules/angular2/src/core/platform_bindings.ts b/modules/angular2/src/core/platform_bindings.ts index 6ac771e32e..f2e2dcf1bb 100644 --- a/modules/angular2/src/core/platform_bindings.ts +++ b/modules/angular2/src/core/platform_bindings.ts @@ -1,5 +1,5 @@ import {bind} from 'angular2/src/core/di'; -import {ExceptionHandler} from './exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; export const EXCEPTION_BINDING = diff --git a/modules/angular2/src/test_lib/test_injector.ts b/modules/angular2/src/test_lib/test_injector.ts index f92cb5925e..05c1dc7d39 100644 --- a/modules/angular2/src/test_lib/test_injector.ts +++ b/modules/angular2/src/test_lib/test_injector.ts @@ -13,7 +13,7 @@ import { KeyValueDiffers, defaultKeyValueDiffers } from 'angular2/src/core/change_detection/change_detection'; -import {ExceptionHandler} from 'angular2/src/core/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {ViewLoader} from 'angular2/src/core/render/dom/compiler/view_loader'; import {ViewResolver} from 'angular2/src/core/compiler/view_resolver'; import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; diff --git a/modules/angular2/src/test_lib/test_lib.dart b/modules/angular2/src/test_lib/test_lib.dart index 0c94cbe234..d0854d2b7c 100644 --- a/modules/angular2/src/test_lib/test_lib.dart +++ b/modules/angular2/src/test_lib/test_lib.dart @@ -22,7 +22,7 @@ import 'package:angular2/src/core/reflection/reflection_capabilities.dart'; import 'package:angular2/src/core/di/binding.dart' show bind; import 'package:angular2/src/core/di/injector.dart' show Injector; -import 'package:angular2/src/core/exception_handler.dart' show ExceptionHandler; +import 'package:angular2/src/core/facade/exception_handler.dart' show ExceptionHandler; import 'package:angular2/src/core/facade/collection.dart' show StringMapWrapper; import 'test_injector.dart'; diff --git a/modules/angular2/src/test_lib/test_lib.ts b/modules/angular2/src/test_lib/test_lib.ts index 8fda3f8a5a..82ad9c64fa 100644 --- a/modules/angular2/src/test_lib/test_lib.ts +++ b/modules/angular2/src/test_lib/test_lib.ts @@ -6,7 +6,7 @@ import {global, isFunction} from 'angular2/src/core/facade/lang'; import {NgZoneZone} from 'angular2/src/core/zone/ng_zone'; import {bind} from 'angular2/src/core/di'; -import {ExceptionHandler} from 'angular2/src/core/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {createTestInjector, FunctionWithParamTokens, inject} from './test_injector'; diff --git a/modules/angular2/src/web_workers/ui/di_bindings.ts b/modules/angular2/src/web_workers/ui/di_bindings.ts index 9884936a75..8272a56984 100644 --- a/modules/angular2/src/web_workers/ui/di_bindings.ts +++ b/modules/angular2/src/web_workers/ui/di_bindings.ts @@ -48,7 +48,7 @@ import {ProtoViewFactory} from 'angular2/src/core/compiler/proto_view_factory'; import {ViewResolver} from 'angular2/src/core/compiler/view_resolver'; import {ViewLoader} from 'angular2/src/core/render/dom/compiler/view_loader'; import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; -import {ExceptionHandler} from 'angular2/src/core/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper'; import {StyleInliner} from 'angular2/src/core/render/dom/compiler/style_inliner'; import {DynamicComponentLoader} from 'angular2/src/core/compiler/dynamic_component_loader'; diff --git a/modules/angular2/src/web_workers/worker/application_common.ts b/modules/angular2/src/web_workers/worker/application_common.ts index 1521c64139..330a35b6e3 100644 --- a/modules/angular2/src/web_workers/worker/application_common.ts +++ b/modules/angular2/src/web_workers/worker/application_common.ts @@ -25,7 +25,7 @@ import { KeyValueDiffers, defaultKeyValueDiffers } from 'angular2/src/core/change_detection/change_detection'; -import {ExceptionHandler} from 'angular2/src/core/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; import {StyleUrlResolver} from 'angular2/src/core/render/dom/compiler/style_url_resolver'; import {PipeResolver} from 'angular2/src/core/compiler/pipe_resolver'; diff --git a/modules/angular2/test/core/application_spec.ts b/modules/angular2/test/core/application_spec.ts index 4c54034843..eea0a7365d 100644 --- a/modules/angular2/test/core/application_spec.ts +++ b/modules/angular2/test/core/application_spec.ts @@ -18,7 +18,7 @@ import {DOCUMENT} from 'angular2/render'; import {PromiseWrapper} from 'angular2/src/core/facade/async'; import {bind, Inject, Injector, LifeCycle} from 'angular2/core'; import {ApplicationRef} from 'angular2/src/core/application_ref'; -import {ExceptionHandler} from 'angular2/src/core/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {Testability, TestabilityRegistry} from 'angular2/src/core/testability/testability'; import {IS_DART} from '../platform'; diff --git a/modules/angular2/test/core/exception_handler_spec.ts b/modules/angular2/test/core/facade/exception_handler_spec.ts similarity index 97% rename from modules/angular2/test/core/exception_handler_spec.ts rename to modules/angular2/test/core/facade/exception_handler_spec.ts index 36242728b2..346c7b7a51 100644 --- a/modules/angular2/test/core/exception_handler_spec.ts +++ b/modules/angular2/test/core/facade/exception_handler_spec.ts @@ -12,7 +12,7 @@ import { Log } from 'angular2/test_lib'; import {BaseException} from 'angular2/src/core/facade/lang'; -import {ExceptionHandler} from 'angular2/src/core/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; class _CustomException { context = "some context"; diff --git a/modules/angular2/test/router/route_config_spec.ts b/modules/angular2/test/router/route_config_spec.ts index 7f3ca829b2..d63eb22ca0 100644 --- a/modules/angular2/test/router/route_config_spec.ts +++ b/modules/angular2/test/router/route_config_spec.ts @@ -26,7 +26,7 @@ import { ROUTER_DIRECTIVES } from 'angular2/router'; -import {ExceptionHandler} from 'angular2/src/core/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; import {LocationStrategy} from 'angular2/src/router/location_strategy'; import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';