diff --git a/modules/angular2/src/compiler/template_parser.ts b/modules/angular2/src/compiler/template_parser.ts index 8717333fb8..a6bec134b5 100644 --- a/modules/angular2/src/compiler/template_parser.ts +++ b/modules/angular2/src/compiler/template_parser.ts @@ -3,13 +3,12 @@ import { RegExpWrapper, isPresent, StringWrapper, - BaseException, StringJoiner, stringify, assertionsEnabled, isBlank } from 'angular2/src/core/facade/lang'; - +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {Parser, AST, ASTWithSource} from 'angular2/src/core/change_detection/change_detection'; import {TemplateBinding} from 'angular2/src/core/change_detection/parser/ast'; diff --git a/modules/angular2/src/core/application_common.ts b/modules/angular2/src/core/application_common.ts index e88241e9e3..463b517271 100644 --- a/modules/angular2/src/core/application_common.ts +++ b/modules/angular2/src/core/application_common.ts @@ -6,11 +6,15 @@ import { Type, isBlank, isPresent, - BaseException, assertionsEnabled, print, stringify } from 'angular2/src/core/facade/lang'; +import { + BaseException, + WrappedException, + ExceptionHandler +} from 'angular2/src/core/facade/exceptions'; import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {Compiler, CompilerCache} from './compiler/compiler'; @@ -27,7 +31,6 @@ import { KeyValueDiffers, defaultKeyValueDiffers } from 'angular2/src/core/change_detection/change_detection'; -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/change_detection/abstract_change_detector.ts b/modules/angular2/src/core/change_detection/abstract_change_detector.ts index 465b49a5e1..03ef64b95e 100644 --- a/modules/angular2/src/core/change_detection/abstract_change_detector.ts +++ b/modules/angular2/src/core/change_detection/abstract_change_detector.ts @@ -1,4 +1,5 @@ -import {isPresent, isBlank, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import {ChangeDetectionUtil} from './change_detection_util'; import {ChangeDetectorRef} from './change_detector_ref'; diff --git a/modules/angular2/src/core/change_detection/change_detection.ts b/modules/angular2/src/core/change_detection/change_detection.ts index 73a1c0139b..d4a5d05a05 100644 --- a/modules/angular2/src/core/change_detection/change_detection.ts +++ b/modules/angular2/src/core/change_detection/change_detection.ts @@ -13,14 +13,7 @@ import { } from './interfaces'; import {Injector, Inject, Injectable, OpaqueToken, Optional, Binding} from 'angular2/src/core/di'; import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; -import { - CONST, - CONST_EXPR, - isPresent, - BaseException, - assertionsEnabled -} from 'angular2/src/core/facade/lang'; - +import {CONST, CONST_EXPR, isPresent, assertionsEnabled} from 'angular2/src/core/facade/lang'; export * from './parser/ast'; export {Lexer} from './parser/lexer'; diff --git a/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts b/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts index adfbf435ed..5305422d47 100644 --- a/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts +++ b/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts @@ -1,10 +1,5 @@ -import { - BaseException, - Type, - isBlank, - isPresent, - StringWrapper -} from 'angular2/src/core/facade/lang'; +import {Type, isBlank, isPresent, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {AbstractChangeDetector} from './abstract_change_detector'; @@ -70,7 +65,7 @@ export class ChangeDetectorJITGenerator { ${this.generateSource()} return function(dispatcher) { return new ${this.typeName}(dispatcher); - } + } `; return new Function(this.abstractChangeDetectorVarName, this.changeDetectionUtilVarName, factorySource)(AbstractChangeDetector, ChangeDetectionUtil); diff --git a/modules/angular2/src/core/change_detection/change_detection_util.ts b/modules/angular2/src/core/change_detection/change_detection_util.ts index 8b329af0a5..61a523bc4a 100644 --- a/modules/angular2/src/core/change_detection/change_detection_util.ts +++ b/modules/angular2/src/core/change_detection/change_detection_util.ts @@ -1,11 +1,5 @@ -import { - CONST_EXPR, - isPresent, - isBlank, - BaseException, - Type, - StringWrapper -} from 'angular2/src/core/facade/lang'; +import {CONST_EXPR, isPresent, isBlank, Type, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {ProtoRecord} from './proto_record'; import {ChangeDetectionStrategy, isDefaultChangeDetectionStrategy} from './constants'; diff --git a/modules/angular2/src/core/change_detection/codegen_logic_util.ts b/modules/angular2/src/core/change_detection/codegen_logic_util.ts index 285740682f..ad7f20b8b6 100644 --- a/modules/angular2/src/core/change_detection/codegen_logic_util.ts +++ b/modules/angular2/src/core/change_detection/codegen_logic_util.ts @@ -1,17 +1,12 @@ import {ListWrapper} from 'angular2/src/core/facade/collection'; -import { - BaseException, - Json, - StringWrapper, - isPresent, - isBlank -} from 'angular2/src/core/facade/lang'; +import {Json, StringWrapper, isPresent, isBlank} from 'angular2/src/core/facade/lang'; import {CodegenNameUtil} from './codegen_name_util'; import {codify, combineGeneratedStrings, rawString} from './codegen_facade'; import {ProtoRecord, RecordType} from './proto_record'; import {BindingTarget} from './binding_record'; import {DirectiveRecord} from './directive_record'; import {ChangeDetectionStrategy} from './constants'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; /** * Class responsible for providing change detection logic for chagne detector classes. diff --git a/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts b/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts index ee12fecab1..e9605febbe 100644 --- a/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts +++ b/modules/angular2/src/core/change_detection/differs/default_iterable_differ.ts @@ -1,4 +1,5 @@ -import {CONST, BaseException} from 'angular2/src/core/facade/lang'; +import {CONST} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import { isListLikeIterable, iterateListLike, diff --git a/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts b/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts index 8c893e3781..77d85c988a 100644 --- a/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts +++ b/modules/angular2/src/core/change_detection/differs/default_keyvalue_differ.ts @@ -1,12 +1,6 @@ import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; -import { - stringify, - looseIdentical, - isJsObject, - CONST, - isBlank, - BaseException -} from 'angular2/src/core/facade/lang'; +import {stringify, looseIdentical, isJsObject, CONST, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ChangeDetectorRef} from '../change_detector_ref'; import {KeyValueDiffer, KeyValueDifferFactory} from '../differs/keyvalue_differs'; diff --git a/modules/angular2/src/core/change_detection/differs/iterable_differs.ts b/modules/angular2/src/core/change_detection/differs/iterable_differs.ts index c4445ac883..c80b591bc1 100644 --- a/modules/angular2/src/core/change_detection/differs/iterable_differs.ts +++ b/modules/angular2/src/core/change_detection/differs/iterable_differs.ts @@ -1,4 +1,5 @@ -import {isBlank, isPresent, BaseException, CONST} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, CONST} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import {ChangeDetectorRef} from '../change_detector_ref'; import {Binding, SkipSelfMetadata, OptionalMetadata, Injectable} from 'angular2/src/core/di'; diff --git a/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts b/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts index 8fa871e65b..cbda4fe6bc 100644 --- a/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts +++ b/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts @@ -1,4 +1,5 @@ -import {isBlank, isPresent, BaseException, CONST} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, CONST} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import {ChangeDetectorRef} from '../change_detector_ref'; import {Binding, SkipSelfMetadata, OptionalMetadata, Injectable} from 'angular2/src/core/di'; diff --git a/modules/angular2/src/core/change_detection/dynamic_change_detector.ts b/modules/angular2/src/core/change_detection/dynamic_change_detector.ts index 58602f55f7..e001ff8d8a 100644 --- a/modules/angular2/src/core/change_detection/dynamic_change_detector.ts +++ b/modules/angular2/src/core/change_detection/dynamic_change_detector.ts @@ -1,10 +1,5 @@ -import { - isPresent, - isBlank, - BaseException, - FunctionWrapper, - StringWrapper -} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, FunctionWrapper, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {AbstractChangeDetector} from './abstract_change_detector'; diff --git a/modules/angular2/src/core/change_detection/exceptions.ts b/modules/angular2/src/core/change_detection/exceptions.ts index 9ca4f26b2f..c1f0b7c7d6 100644 --- a/modules/angular2/src/core/change_detection/exceptions.ts +++ b/modules/angular2/src/core/change_detection/exceptions.ts @@ -1,4 +1,4 @@ -import {BaseException} from "angular2/src/core/facade/lang"; +import {BaseException, WrappedException} from "angular2/src/core/facade/exceptions"; /** * An error thrown if application changes model breaking the top-down data flow. @@ -21,7 +21,7 @@ export class ExpressionChangedAfterItHasBeenCheckedException extends BaseExcepti * * This error wraps the original exception, this is done to attach expression location information. */ -export class ChangeDetectionError extends BaseException { +export class ChangeDetectionError extends WrappedException { /** * Location of the expression. */ diff --git a/modules/angular2/src/core/change_detection/parser/ast.ts b/modules/angular2/src/core/change_detection/parser/ast.ts index 82fb8b48af..27b5fcab05 100644 --- a/modules/angular2/src/core/change_detection/parser/ast.ts +++ b/modules/angular2/src/core/change_detection/parser/ast.ts @@ -1,4 +1,4 @@ -import {isBlank, isPresent, FunctionWrapper, BaseException} from "angular2/src/core/facade/lang"; +import {isBlank, isPresent, FunctionWrapper} from "angular2/src/core/facade/lang"; import {Map, ListWrapper, StringMapWrapper} from "angular2/src/core/facade/collection"; export class AST { diff --git a/modules/angular2/src/core/change_detection/parser/lexer.ts b/modules/angular2/src/core/change_detection/parser/lexer.ts index 56216b0190..b41261177b 100644 --- a/modules/angular2/src/core/change_detection/parser/lexer.ts +++ b/modules/angular2/src/core/change_detection/parser/lexer.ts @@ -1,12 +1,7 @@ import {Injectable} from 'angular2/src/core/di/decorators'; import {ListWrapper, SetWrapper} from "angular2/src/core/facade/collection"; -import { - NumberWrapper, - StringJoiner, - StringWrapper, - BaseException, - isPresent -} from "angular2/src/core/facade/lang"; +import {NumberWrapper, StringJoiner, StringWrapper, isPresent} from "angular2/src/core/facade/lang"; +import {BaseException} from 'angular2/src/core/facade/exceptions'; export enum TokenType { Character, diff --git a/modules/angular2/src/core/change_detection/parser/locals.ts b/modules/angular2/src/core/change_detection/parser/locals.ts index 02eab8bd7a..b6212c6182 100644 --- a/modules/angular2/src/core/change_detection/parser/locals.ts +++ b/modules/angular2/src/core/change_detection/parser/locals.ts @@ -1,4 +1,5 @@ -import {isPresent, BaseException} from 'angular2/src/core/facade/lang'; +import {isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; export class Locals { diff --git a/modules/angular2/src/core/change_detection/parser/parser.ts b/modules/angular2/src/core/change_detection/parser/parser.ts index 92cd77b675..8b47649ba9 100644 --- a/modules/angular2/src/core/change_detection/parser/parser.ts +++ b/modules/angular2/src/core/change_detection/parser/parser.ts @@ -1,5 +1,6 @@ import {Injectable} from 'angular2/src/core/di/decorators'; -import {isBlank, isPresent, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import { Lexer, @@ -51,8 +52,7 @@ var INTERPOLATION_REGEXP = /\{\{(.*?)\}\}/g; class ParseException extends BaseException { constructor(message: string, input: string, errLocation: string, ctxLocation?: any) { - super(`Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`, null, null, - ctxLocation); + super(`Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`); } } diff --git a/modules/angular2/src/core/change_detection/pipe_transform.ts b/modules/angular2/src/core/change_detection/pipe_transform.ts index 966a2da8e7..0495411917 100644 --- a/modules/angular2/src/core/change_detection/pipe_transform.ts +++ b/modules/angular2/src/core/change_detection/pipe_transform.ts @@ -1,5 +1,3 @@ -import {ABSTRACT, BaseException, CONST, Type} from 'angular2/src/core/facade/lang'; - /** * To create a Pipe, you must implement this interface. * diff --git a/modules/angular2/src/core/change_detection/pregen_proto_change_detector.ts b/modules/angular2/src/core/change_detection/pregen_proto_change_detector.ts index 6f000919cc..a3340bae24 100644 --- a/modules/angular2/src/core/change_detection/pregen_proto_change_detector.ts +++ b/modules/angular2/src/core/change_detection/pregen_proto_change_detector.ts @@ -1,4 +1,4 @@ -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ProtoChangeDetector, ChangeDetector} from './interfaces'; import {coalesce} from './coalesce'; diff --git a/modules/angular2/src/core/change_detection/proto_change_detector.ts b/modules/angular2/src/core/change_detection/proto_change_detector.ts index 80d3c71fc8..9ead718fc5 100644 --- a/modules/angular2/src/core/change_detection/proto_change_detector.ts +++ b/modules/angular2/src/core/change_detection/proto_change_detector.ts @@ -1,4 +1,5 @@ -import {BaseException, Type, isBlank, isPresent, isString} from 'angular2/src/core/facade/lang'; +import {Type, isBlank, isPresent, isString} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { diff --git a/modules/angular2/src/core/compiler/compiler.ts b/modules/angular2/src/core/compiler/compiler.ts index d946b25836..28315ba6a4 100644 --- a/modules/angular2/src/core/compiler/compiler.ts +++ b/modules/angular2/src/core/compiler/compiler.ts @@ -5,12 +5,12 @@ import { isBlank, isType, isPresent, - BaseException, normalizeBlank, stringify, isArray, isPromise } from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; diff --git a/modules/angular2/src/core/compiler/directive_resolver.ts b/modules/angular2/src/core/compiler/directive_resolver.ts index c70cf06982..3a3daf5e25 100644 --- a/modules/angular2/src/core/compiler/directive_resolver.ts +++ b/modules/angular2/src/core/compiler/directive_resolver.ts @@ -1,5 +1,6 @@ import {resolveForwardRef, Injectable} from 'angular2/src/core/di'; -import {Type, isPresent, BaseException, stringify} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, stringify} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { DirectiveMetadata, diff --git a/modules/angular2/src/core/compiler/dynamic_component_loader.ts b/modules/angular2/src/core/compiler/dynamic_component_loader.ts index 47eda0efc2..fc7a1de7ce 100644 --- a/modules/angular2/src/core/compiler/dynamic_component_loader.ts +++ b/modules/angular2/src/core/compiler/dynamic_component_loader.ts @@ -1,6 +1,6 @@ import {Key, Injector, ResolvedBinding, Binding, bind, Injectable} from 'angular2/src/core/di'; import {Compiler} from './compiler'; -import {Type, BaseException, stringify, isPresent} from 'angular2/src/core/facade/lang'; +import {Type, stringify, isPresent} from 'angular2/src/core/facade/lang'; import {Promise} from 'angular2/src/core/facade/async'; import {AppViewManager} from 'angular2/src/core/compiler/view_manager'; import {ElementRef} from './element_ref'; diff --git a/modules/angular2/src/core/compiler/element_binder.ts b/modules/angular2/src/core/compiler/element_binder.ts index fef7840648..235516cef4 100644 --- a/modules/angular2/src/core/compiler/element_binder.ts +++ b/modules/angular2/src/core/compiler/element_binder.ts @@ -1,4 +1,5 @@ -import {isBlank, isPresent, BaseException} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import * as eiModule from './element_injector'; import {DirectiveBinding} from './element_injector'; import * as viewModule from './view'; diff --git a/modules/angular2/src/core/compiler/element_injector.ts b/modules/angular2/src/core/compiler/element_injector.ts index 0dca524f7e..adfec2167c 100644 --- a/modules/angular2/src/core/compiler/element_injector.ts +++ b/modules/angular2/src/core/compiler/element_injector.ts @@ -2,11 +2,11 @@ import { isPresent, isBlank, Type, - BaseException, stringify, CONST_EXPR, StringWrapper } from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { diff --git a/modules/angular2/src/core/compiler/element_ref.ts b/modules/angular2/src/core/compiler/element_ref.ts index 1325b0b041..c3ee07ec57 100644 --- a/modules/angular2/src/core/compiler/element_ref.ts +++ b/modules/angular2/src/core/compiler/element_ref.ts @@ -1,4 +1,4 @@ -import {BaseException, isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {ViewRef} from './view_ref'; import {RenderViewRef, RenderElementRef, Renderer} from 'angular2/src/core/render/api'; diff --git a/modules/angular2/src/core/compiler/pipe_resolver.ts b/modules/angular2/src/core/compiler/pipe_resolver.ts index d7e79c94e9..f501546015 100644 --- a/modules/angular2/src/core/compiler/pipe_resolver.ts +++ b/modules/angular2/src/core/compiler/pipe_resolver.ts @@ -1,5 +1,6 @@ import {resolveForwardRef, Injectable} from 'angular2/src/core/di'; -import {Type, isPresent, BaseException, stringify} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, stringify} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {PipeMetadata} from 'angular2/src/core/metadata'; import {reflector} from 'angular2/src/core/reflection/reflection'; diff --git a/modules/angular2/src/core/compiler/proto_view_factory.ts b/modules/angular2/src/core/compiler/proto_view_factory.ts index 6224cc5023..4f691e46a4 100644 --- a/modules/angular2/src/core/compiler/proto_view_factory.ts +++ b/modules/angular2/src/core/compiler/proto_view_factory.ts @@ -1,13 +1,8 @@ import {Injectable} from 'angular2/src/core/di'; import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; -import { - StringWrapper, - isPresent, - isBlank, - BaseException, - assertionsEnabled -} from 'angular2/src/core/facade/lang'; +import {StringWrapper, isPresent, isBlank, assertionsEnabled} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {reflector} from 'angular2/src/core/reflection/reflection'; import { diff --git a/modules/angular2/src/core/compiler/view.ts b/modules/angular2/src/core/compiler/view.ts index e483edf83f..691d9c4cf5 100644 --- a/modules/angular2/src/core/compiler/view.ts +++ b/modules/angular2/src/core/compiler/view.ts @@ -25,7 +25,8 @@ import { DirectiveBinding } from './element_injector'; import {ElementBinder} from './element_binder'; -import {isPresent, isBlank, BaseException} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import * as renderApi from 'angular2/src/core/render/api'; import {RenderEventDispatcher} from 'angular2/src/core/render/api'; import {ViewRef, ProtoViewRef, internalView} from './view_ref'; @@ -318,7 +319,7 @@ class _Context { /** * Wraps an exception thrown by an event handler. */ -class EventEvaluationError extends BaseException { +class EventEvaluationError extends WrappedException { constructor(eventName: string, originalException: any, originalStack: any, context: any) { super(`Error during evaluation of "${eventName}"`, originalException, originalStack, context); } diff --git a/modules/angular2/src/core/compiler/view_manager.ts b/modules/angular2/src/core/compiler/view_manager.ts index d3b21f1a8b..d5bf364216 100644 --- a/modules/angular2/src/core/compiler/view_manager.ts +++ b/modules/angular2/src/core/compiler/view_manager.ts @@ -1,5 +1,6 @@ import {Injector, Binding, Injectable, ResolvedBinding} from 'angular2/src/core/di'; -import {isPresent, isBlank, BaseException} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import * as viewModule from './view'; import {ElementRef} from './element_ref'; import {ProtoViewRef, ViewRef, HostViewRef, internalView, internalProtoView} from './view_ref'; diff --git a/modules/angular2/src/core/compiler/view_manager_utils.ts b/modules/angular2/src/core/compiler/view_manager_utils.ts index 876024166a..ed449728b3 100644 --- a/modules/angular2/src/core/compiler/view_manager_utils.ts +++ b/modules/angular2/src/core/compiler/view_manager_utils.ts @@ -1,7 +1,7 @@ import {Injector, Binding, Injectable, ResolvedBinding} from 'angular2/src/core/di'; import {ListWrapper, MapWrapper, Map, StringMapWrapper} from 'angular2/src/core/facade/collection'; import * as eli from './element_injector'; -import {isPresent, isBlank, BaseException} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; import * as viewModule from './view'; import {internalView} from './view_ref'; import * as avmModule from './view_manager'; diff --git a/modules/angular2/src/core/compiler/view_resolver.ts b/modules/angular2/src/core/compiler/view_resolver.ts index 419dc73438..d268aeb446 100644 --- a/modules/angular2/src/core/compiler/view_resolver.ts +++ b/modules/angular2/src/core/compiler/view_resolver.ts @@ -1,7 +1,8 @@ import {Injectable} from 'angular2/src/core/di'; import {ViewMetadata} from '../metadata/view'; -import {Type, stringify, isBlank, BaseException} from 'angular2/src/core/facade/lang'; +import {Type, stringify, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {reflector} from 'angular2/src/core/reflection/reflection'; diff --git a/modules/angular2/src/core/debug/debug_element.ts b/modules/angular2/src/core/debug/debug_element.ts index cd9dbe3ea7..b7908b8577 100644 --- a/modules/angular2/src/core/debug/debug_element.ts +++ b/modules/angular2/src/core/debug/debug_element.ts @@ -1,4 +1,4 @@ -import {Type, isPresent, BaseException, isBlank} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, isBlank} from 'angular2/src/core/facade/lang'; import {ListWrapper, MapWrapper, Predicate} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; diff --git a/modules/angular2/src/core/di/binding.ts b/modules/angular2/src/core/di/binding.ts index ac846a4e10..e877b20ee5 100644 --- a/modules/angular2/src/core/di/binding.ts +++ b/modules/angular2/src/core/di/binding.ts @@ -4,11 +4,11 @@ import { isPresent, CONST, CONST_EXPR, - BaseException, stringify, isArray, normalizeBool } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {reflector} from 'angular2/src/core/reflection/reflection'; import {Key} from './key'; diff --git a/modules/angular2/src/core/di/exceptions.ts b/modules/angular2/src/core/di/exceptions.ts index 4d7772d032..b4cf1e1c80 100644 --- a/modules/angular2/src/core/di/exceptions.ts +++ b/modules/angular2/src/core/di/exceptions.ts @@ -1,5 +1,6 @@ import {ListWrapper} from 'angular2/src/core/facade/collection'; -import {stringify, BaseException, isBlank} from 'angular2/src/core/facade/lang'; +import {stringify, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {Key} from './key'; import {Injector} from './injector'; @@ -37,9 +38,8 @@ export class AbstractBindingError extends BaseException { injectors: Injector[]; constructResolvingMessage: Function; - constructor(injector: Injector, key: Key, constructResolvingMessage: Function, originalException?, - originalStack?) { - super("DI Exception", originalException, originalStack, null); + constructor(injector: Injector, key: Key, constructResolvingMessage: Function) { + super("DI Exception"); this.keys = [key]; this.injectors = [injector]; this.constructResolvingMessage = constructResolvingMessage; @@ -53,8 +53,6 @@ export class AbstractBindingError extends BaseException { } get context() { return this.injectors[this.injectors.length - 1].debugContext(); } - - toString(): string { return this.message; } } /** @@ -100,16 +98,30 @@ export class CyclicDependencyError extends AbstractBindingError { * The `InstantiationError` class contains the original error plus the dependency graph which caused * this object to be instantiated. */ -export class InstantiationError extends AbstractBindingError { - causeKey: Key; - constructor(injector: Injector, originalException, originalStack, key: Key) { - super(injector, key, function(keys: any[]) { - var first = stringify(ListWrapper.first(keys).token); - return `Error during instantiation of ${first}!${constructResolvingPath(keys)}.`; - }, originalException, originalStack); +export class InstantiationError extends WrappedException { + name: string; + keys: Key[]; + injectors: Injector[]; - this.causeKey = key; + constructor(injector: Injector, originalException, originalStack, key: Key) { + super("DI Exception", originalException, originalStack, null); + this.keys = [key]; + this.injectors = [injector]; } + + addKey(injector: Injector, key: Key): void { + this.injectors.push(injector); + this.keys.push(key); + } + + get wrapperMessage(): string { + var first = stringify(ListWrapper.first(this.keys).token); + return `Error during instantiation of ${first}!${constructResolvingPath(this.keys)}.`; + } + + get causeKey(): Key { return this.keys[0]; } + + get context() { return this.injectors[this.injectors.length - 1].debugContext(); } } /** diff --git a/modules/angular2/src/core/di/injector.ts b/modules/angular2/src/core/di/injector.ts index 2b5bbf169f..d0d05722b6 100644 --- a/modules/angular2/src/core/di/injector.ts +++ b/modules/angular2/src/core/di/injector.ts @@ -647,7 +647,7 @@ export class Injector { d18 = length > 18 ? this._getByDependency(binding, deps[18], visibility) : null; d19 = length > 19 ? this._getByDependency(binding, deps[19], visibility) : null; } catch (e) { - if (e instanceof AbstractBindingError) { + if (e instanceof AbstractBindingError || e instanceof InstantiationError) { e.addKey(this, binding.key); } throw e; diff --git a/modules/angular2/src/core/di/key.ts b/modules/angular2/src/core/di/key.ts index e33bb136fa..5148d94936 100644 --- a/modules/angular2/src/core/di/key.ts +++ b/modules/angular2/src/core/di/key.ts @@ -1,5 +1,6 @@ import {MapWrapper} from 'angular2/src/core/facade/collection'; -import {stringify, CONST, Type, isBlank, BaseException} from 'angular2/src/core/facade/lang'; +import {stringify, CONST, Type, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {TypeLiteral} from './type_literal'; import {resolveForwardRef} from './forward_ref'; diff --git a/modules/angular2/src/core/dom/dom_adapter.ts b/modules/angular2/src/core/dom/dom_adapter.ts index 0a2d58fc27..f667d6452c 100644 --- a/modules/angular2/src/core/dom/dom_adapter.ts +++ b/modules/angular2/src/core/dom/dom_adapter.ts @@ -1,4 +1,5 @@ -import {BaseException, isBlank} from 'angular2/src/core/facade/lang'; +import {isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; export var DOM: DomAdapter; diff --git a/modules/angular2/src/core/dom/parse5_adapter.ts b/modules/angular2/src/core/dom/parse5_adapter.ts index 347e6c9b89..c91a6ddfc4 100644 --- a/modules/angular2/src/core/dom/parse5_adapter.ts +++ b/modules/angular2/src/core/dom/parse5_adapter.ts @@ -9,13 +9,8 @@ var url = require('url'); import {MapWrapper, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {DomAdapter, setRootDomAdapter} from './dom_adapter'; -import { - BaseException, - isPresent, - isBlank, - global, - setValueOnPath -} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, global, setValueOnPath} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {SelectorMatcher, CssSelector} from 'angular2/src/core/render/dom/compiler/selector'; var _attrToPropMap = { diff --git a/modules/angular2/src/core/facade.ts b/modules/angular2/src/core/facade.ts index d772e9362a..e93eb63147 100644 --- a/modules/angular2/src/core/facade.ts +++ b/modules/angular2/src/core/facade.ts @@ -2,3 +2,4 @@ export {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 diff --git a/modules/angular2/src/core/facade/exception_handler.ts b/modules/angular2/src/core/facade/exception_handler.ts index 650975a74d..e07eccbb45 100644 --- a/modules/angular2/src/core/facade/exception_handler.ts +++ b/modules/angular2/src/core/facade/exception_handler.ts @@ -1,4 +1,5 @@ -import {isPresent, isBlank, print, BaseException} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, print} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, isListLikeIterable} from 'angular2/src/core/facade/collection'; class _ArrayLogger { @@ -45,7 +46,7 @@ export class ExceptionHandler { var originalStack = this._findOriginalStack(exception); var context = this._findContext(exception); - this._logger.logGroup(`EXCEPTION: ${exception}`); + this._logger.logGroup(`EXCEPTION: ${this._extractMessage(exception)}`); if (isPresent(stackTrace) && isBlank(originalStack)) { this._logger.logError("STACKTRACE:"); @@ -57,7 +58,7 @@ export class ExceptionHandler { } if (isPresent(originalException)) { - this._logger.logError(`ORIGINAL EXCEPTION: ${originalException}`); + this._logger.logError(`ORIGINAL EXCEPTION: ${this._extractMessage(originalException)}`); } if (isPresent(originalStack)) { @@ -77,6 +78,10 @@ export class ExceptionHandler { if (this._rethrowException) throw exception; } + _extractMessage(exception: any): string { + return exception instanceof WrappedException ? exception.wrapperMessage : exception.toString(); + } + _longStackTrace(stackTrace: any): any { return isListLikeIterable(stackTrace) ? (stackTrace).join("\n\n-----async gap-----\n") : stackTrace.toString(); @@ -84,7 +89,7 @@ export class ExceptionHandler { _findContext(exception: any): any { try { - if (!(exception instanceof BaseException)) return null; + if (!(exception instanceof WrappedException)) return null; return isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); } catch (e) { @@ -94,10 +99,10 @@ export class ExceptionHandler { } _findOriginalException(exception: any): any { - if (!(exception instanceof BaseException)) return null; + if (!(exception instanceof WrappedException)) return null; var e = exception.originalException; - while (e instanceof BaseException && isPresent(e.originalException)) { + while (e instanceof WrappedException && isPresent(e.originalException)) { e = e.originalException; } @@ -105,13 +110,13 @@ export class ExceptionHandler { } _findOriginalStack(exception: any): any { - if (!(exception instanceof BaseException)) return null; + if (!(exception instanceof WrappedException)) return null; var e = exception; var stack = exception.originalStack; - while (e instanceof BaseException && isPresent(e.originalException)) { + while (e instanceof WrappedException && isPresent(e.originalException)) { e = e.originalException; - if (e instanceof BaseException && isPresent(e.originalException)) { + if (e instanceof WrappedException && isPresent(e.originalException)) { stack = e.originalStack; } } diff --git a/modules/angular2/src/core/facade/exceptions.dart b/modules/angular2/src/core/facade/exceptions.dart new file mode 100644 index 0000000000..6f3c1c0d26 --- /dev/null +++ b/modules/angular2/src/core/facade/exceptions.dart @@ -0,0 +1,32 @@ +library angular.core.facade.exceptions; + +import 'exception_handler.dart'; +export 'exception_handler.dart'; + +class BaseException extends Error { + final String message; + + BaseException([this.message]); + + String toString() { + return this.message; + } +} + +class WrappedException extends Error { + final dynamic context; + final String wrapperMessage; + final originalException; + final originalStack; + + WrappedException( + [this.wrapperMessage, this.originalException, this.originalStack, this.context]); + + get message { return ExceptionHandler.exceptionToString(this); } + + String toString() { return this.message; } +} + +Error makeTypeError([String message = ""]) { + return new BaseException(message); +} diff --git a/modules/angular2/src/core/facade/exceptions.ts b/modules/angular2/src/core/facade/exceptions.ts new file mode 100644 index 0000000000..a84ba2f858 --- /dev/null +++ b/modules/angular2/src/core/facade/exceptions.ts @@ -0,0 +1,45 @@ +/// + +import {ExceptionHandler} from './exception_handler'; + +export {ExceptionHandler} from './exception_handler'; + +export class BaseException extends Error { + public stack: any; + constructor(public message?: string) { + super(message); + this.stack = (new Error(message)).stack; + } + + toString(): string { return this.message; } +} + +export class WrappedException extends Error { + private _wrapperStack: any; + + constructor(private _wrapperMessage: string, private _originalException, private _originalStack?, + private _context?) { + super(_wrapperMessage); + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + + get wrapperMessage(): string { return this._wrapperMessage; } + + get wrapperStack(): any { return this._wrapperStack; } + + + get originalException(): any { return this._originalException; } + + get originalStack(): any { return this._originalStack; } + + + get context(): any { return this._context; } + + get message(): string { return ExceptionHandler.exceptionToString(this); } + + toString(): string { return this.message; } +} + +export function makeTypeError(message?: string): Error { + return new TypeError(message); +} \ No newline at end of file diff --git a/modules/angular2/src/core/facade/lang.dart b/modules/angular2/src/core/facade/lang.dart index 0a678e9474..140a0fd12f 100644 --- a/modules/angular2/src/core/facade/lang.dart +++ b/modules/angular2/src/core/facade/lang.dart @@ -193,24 +193,6 @@ class FunctionWrapper { } } -class BaseException extends Error { - final dynamic context; - final String message; - final originalException; - final originalStack; - - BaseException( - [this.message, this.originalException, this.originalStack, this.context]); - - String toString() { - return this.message; - } -} - -Error makeTypeError([String message = ""]) { - return new BaseException(message); -} - const _NAN_KEY = const Object(); // Dart can have identical(str1, str2) == false while str1 == str2. Moreover, diff --git a/modules/angular2/src/core/facade/lang.ts b/modules/angular2/src/core/facade/lang.ts index fa76926f6d..f013f43bca 100644 --- a/modules/angular2/src/core/facade/lang.ts +++ b/modules/angular2/src/core/facade/lang.ts @@ -33,26 +33,6 @@ export function getTypeNameForDebugging(type: Type): string { return type['name']; } -export class BaseException extends Error { - stack; - constructor(public message?: string, private _originalException?, private _originalStack?, - private _context?) { - super(message); - this.stack = (new Error(message)).stack; - } - - get originalException(): any { return this._originalException; } - - get originalStack(): any { return this._originalStack; } - - get context(): any { return this._context; } - - toString(): string { return this.message; } -} - -export function makeTypeError(message?: string): Error { - return new TypeError(message); -} export var Math = _global.Math; export var Date = _global.Date; @@ -211,10 +191,10 @@ export class StringJoiner { toString(): string { return this.parts.join(""); } } -export class NumberParseError extends BaseException { +export class NumberParseError extends Error { name: string; - constructor(public message: string) { super(); } + constructor(public message: string) { super(message); } toString(): string { return this.message; } } @@ -328,11 +308,7 @@ export function isJsObject(o: any): boolean { } export function print(obj: Error | Object) { - if (obj instanceof BaseException) { - console.log(obj.stack); - } else { - console.log(obj); - } + console.log(obj); } // Can't be all uppercase as our transpiler would think it is a special directive... diff --git a/modules/angular2/src/core/forms/directives/shared.ts b/modules/angular2/src/core/forms/directives/shared.ts index ab82ce26f1..204d38b4be 100644 --- a/modules/angular2/src/core/forms/directives/shared.ts +++ b/modules/angular2/src/core/forms/directives/shared.ts @@ -1,5 +1,6 @@ import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; -import {isBlank, BaseException, looseIdentical} from 'angular2/src/core/facade/lang'; +import {isBlank, looseIdentical} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ControlContainer} from './control_container'; import {NgControl} from './ng_control'; diff --git a/modules/angular2/src/core/life_cycle/life_cycle.ts b/modules/angular2/src/core/life_cycle/life_cycle.ts index 00d1c7628d..6b65bc07c8 100644 --- a/modules/angular2/src/core/life_cycle/life_cycle.ts +++ b/modules/angular2/src/core/life_cycle/life_cycle.ts @@ -1,7 +1,8 @@ import {Injectable} from 'angular2/src/core/di'; import {ChangeDetector} from 'angular2/src/core/change_detection/change_detection'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; -import {isPresent, BaseException} from 'angular2/src/core/facade/lang'; +import {isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {wtfLeave, wtfCreateScope, WtfScopeFn} from '../profile/profile'; /** diff --git a/modules/angular2/src/core/pipes/async_pipe.ts b/modules/angular2/src/core/pipes/async_pipe.ts index 6f2203783a..a1fe11c61a 100644 --- a/modules/angular2/src/core/pipes/async_pipe.ts +++ b/modules/angular2/src/core/pipes/async_pipe.ts @@ -1,4 +1,4 @@ -import {isBlank, isPresent, isPromise, CONST, BaseException} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, isPromise, CONST} from 'angular2/src/core/facade/lang'; import {Promise, ObservableWrapper, Observable} from 'angular2/src/core/facade/async'; import {Pipe} from 'angular2/src/core/metadata'; import {Injectable} from 'angular2/src/core/di'; diff --git a/modules/angular2/src/core/pipes/invalid_pipe_argument_exception.ts b/modules/angular2/src/core/pipes/invalid_pipe_argument_exception.ts index 99c55bb30b..399347c66f 100644 --- a/modules/angular2/src/core/pipes/invalid_pipe_argument_exception.ts +++ b/modules/angular2/src/core/pipes/invalid_pipe_argument_exception.ts @@ -1,4 +1,5 @@ -import {ABSTRACT, BaseException, CONST, Type} from 'angular2/src/core/facade/lang'; +import {ABSTRACT, CONST, Type} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; export class InvalidPipeArgumentException extends BaseException { constructor(type: Type, value: Object) { diff --git a/modules/angular2/src/core/pipes/limit_to_pipe.ts b/modules/angular2/src/core/pipes/limit_to_pipe.ts index 4065559ce6..c375e62edd 100644 --- a/modules/angular2/src/core/pipes/limit_to_pipe.ts +++ b/modules/angular2/src/core/pipes/limit_to_pipe.ts @@ -1,11 +1,5 @@ -import { - isBlank, - isString, - isArray, - StringWrapper, - BaseException, - CONST -} from 'angular2/src/core/facade/lang'; +import {isBlank, isString, isArray, StringWrapper, CONST} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Math} from 'angular2/src/core/facade/math'; import {PipeTransform, WrappedValue} from 'angular2/src/core/change_detection'; diff --git a/modules/angular2/src/core/pipes/number_pipe.ts b/modules/angular2/src/core/pipes/number_pipe.ts index f8a5dae636..93e0437626 100644 --- a/modules/angular2/src/core/pipes/number_pipe.ts +++ b/modules/angular2/src/core/pipes/number_pipe.ts @@ -5,10 +5,10 @@ import { StringWrapper, NumberWrapper, RegExpWrapper, - BaseException, CONST, FunctionWrapper } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {NumberFormatter, NumberFormatStyle} from 'angular2/src/core/facade/intl'; import {Injectable} from 'angular2/src/core/di'; import {PipeTransform, WrappedValue} from 'angular2/src/core/change_detection'; diff --git a/modules/angular2/src/core/pipes/pipes.ts b/modules/angular2/src/core/pipes/pipes.ts index 7d0f6b7b24..a37cd6e71e 100644 --- a/modules/angular2/src/core/pipes/pipes.ts +++ b/modules/angular2/src/core/pipes/pipes.ts @@ -1,4 +1,5 @@ -import {isBlank, isPresent, BaseException, CONST, Type} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, CONST, Type} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {StringMapWrapper} from 'angular2/src/core/facade/collection'; import { Injectable, diff --git a/modules/angular2/src/core/platform_bindings.dart b/modules/angular2/src/core/platform_bindings.dart index 57fe126789..315bc4f1f3 100644 --- a/modules/angular2/src/core/platform_bindings.dart +++ b/modules/angular2/src/core/platform_bindings.dart @@ -2,7 +2,7 @@ library angular2.src.core.platform_bindings; import 'package:angular2/core.dart'; -import './exception_handler.dart'; +import 'package:angular2/src/core/facade/exceptions.dart'; import 'package:angular2/src/core/dom/dom_adapter.dart'; exceptionFactory() => new ExceptionHandler(DOM, true); diff --git a/modules/angular2/src/core/platform_bindings.ts b/modules/angular2/src/core/platform_bindings.ts index f2e2dcf1bb..34d249be49 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 'angular2/src/core/facade/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exceptions'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; export const EXCEPTION_BINDING = diff --git a/modules/angular2/src/core/reflection/reflection_capabilities.ts b/modules/angular2/src/core/reflection/reflection_capabilities.ts index 26c0507692..c27dfc94fc 100644 --- a/modules/angular2/src/core/reflection/reflection_capabilities.ts +++ b/modules/angular2/src/core/reflection/reflection_capabilities.ts @@ -1,11 +1,5 @@ -import { - Type, - isPresent, - isFunction, - global, - stringify, - BaseException -} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, isFunction, global, stringify} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import {GetterFn, SetterFn, MethodFn} from './types'; import {PlatformReflectionCapabilities} from 'platform_reflection_capabilities'; diff --git a/modules/angular2/src/core/reflection/reflector.ts b/modules/angular2/src/core/reflection/reflector.ts index 8596dd02b0..54c5258d4a 100644 --- a/modules/angular2/src/core/reflection/reflector.ts +++ b/modules/angular2/src/core/reflection/reflector.ts @@ -1,4 +1,5 @@ -import {Type, isPresent, stringify, BaseException} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, stringify} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import { ListWrapper, Map, diff --git a/modules/angular2/src/core/render/dom/compiler/compiler.ts b/modules/angular2/src/core/render/dom/compiler/compiler.ts index 5bd5ed7a17..a68555689a 100644 --- a/modules/angular2/src/core/render/dom/compiler/compiler.ts +++ b/modules/angular2/src/core/render/dom/compiler/compiler.ts @@ -1,7 +1,7 @@ import {Injectable, Inject} from 'angular2/src/core/di'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; -import {BaseException, isPresent, isBlank} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import { @@ -15,6 +15,7 @@ import { ViewEncapsulation } from '../../api'; import {CompilePipeline} from './compile_pipeline'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ViewLoader, TemplateAndStyles} from 'angular2/src/core/render/dom/compiler/view_loader'; import {CompileStepFactory, DefaultStepFactory} from './compile_step_factory'; import {ElementSchemaRegistry} from '../schema/element_schema_registry'; diff --git a/modules/angular2/src/core/render/dom/compiler/directive_parser.ts b/modules/angular2/src/core/render/dom/compiler/directive_parser.ts index 5c089c3475..91e2444415 100644 --- a/modules/angular2/src/core/render/dom/compiler/directive_parser.ts +++ b/modules/angular2/src/core/render/dom/compiler/directive_parser.ts @@ -1,4 +1,5 @@ -import {isPresent, isBlank, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {Parser} from 'angular2/src/core/change_detection/change_detection'; diff --git a/modules/angular2/src/core/render/dom/compiler/selector.ts b/modules/angular2/src/core/render/dom/compiler/selector.ts index a868e74ec8..1f2aa8978b 100644 --- a/modules/angular2/src/core/render/dom/compiler/selector.ts +++ b/modules/angular2/src/core/render/dom/compiler/selector.ts @@ -4,9 +4,9 @@ import { isBlank, RegExpWrapper, RegExpMatcherWrapper, - StringWrapper, - BaseException + StringWrapper } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; const _EMPTY_ATTR_VALUE = ''; diff --git a/modules/angular2/src/core/render/dom/compiler/shadow_css.ts b/modules/angular2/src/core/render/dom/compiler/shadow_css.ts index fb92f0ac00..b02fc241fa 100644 --- a/modules/angular2/src/core/render/dom/compiler/shadow_css.ts +++ b/modules/angular2/src/core/render/dom/compiler/shadow_css.ts @@ -6,8 +6,7 @@ import { RegExpWrapper, RegExpMatcherWrapper, isPresent, - isBlank, - BaseException + isBlank } from 'angular2/src/core/facade/lang'; /** diff --git a/modules/angular2/src/core/render/dom/compiler/view_loader.ts b/modules/angular2/src/core/render/dom/compiler/view_loader.ts index 0ae093a7ef..a34cd4ec9a 100644 --- a/modules/angular2/src/core/render/dom/compiler/view_loader.ts +++ b/modules/angular2/src/core/render/dom/compiler/view_loader.ts @@ -2,11 +2,11 @@ import {Injectable} from 'angular2/src/core/di'; import { isBlank, isPresent, - BaseException, stringify, isPromise, StringWrapper } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; diff --git a/modules/angular2/src/core/render/dom/compiler/view_splitter.ts b/modules/angular2/src/core/render/dom/compiler/view_splitter.ts index 4395b36098..6ae22f3be9 100644 --- a/modules/angular2/src/core/render/dom/compiler/view_splitter.ts +++ b/modules/angular2/src/core/render/dom/compiler/view_splitter.ts @@ -1,4 +1,5 @@ -import {isBlank, isPresent, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {Parser} from 'angular2/src/core/change_detection/change_detection'; diff --git a/modules/angular2/src/core/render/dom/dom_renderer.ts b/modules/angular2/src/core/render/dom/dom_renderer.ts index b3a475d1ca..a282484a6e 100644 --- a/modules/angular2/src/core/render/dom/dom_renderer.ts +++ b/modules/angular2/src/core/render/dom/dom_renderer.ts @@ -1,11 +1,6 @@ import {Inject, Injectable, OpaqueToken} from 'angular2/src/core/di'; -import { - isPresent, - isBlank, - BaseException, - RegExpWrapper, - CONST_EXPR -} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, RegExpWrapper, CONST_EXPR} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; diff --git a/modules/angular2/src/core/render/dom/events/event_manager.ts b/modules/angular2/src/core/render/dom/events/event_manager.ts index f7229a72e8..3ab40283e5 100644 --- a/modules/angular2/src/core/render/dom/events/event_manager.ts +++ b/modules/angular2/src/core/render/dom/events/event_manager.ts @@ -1,10 +1,5 @@ -import { - isBlank, - BaseException, - isPresent, - StringWrapper, - CONST_EXPR -} from 'angular2/src/core/facade/lang'; +import {CONST_EXPR} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; diff --git a/modules/angular2/src/core/render/dom/events/hammer_gestures.dart b/modules/angular2/src/core/render/dom/events/hammer_gestures.dart index 7a8a42db85..632b4831fe 100644 --- a/modules/angular2/src/core/render/dom/events/hammer_gestures.dart +++ b/modules/angular2/src/core/render/dom/events/hammer_gestures.dart @@ -2,7 +2,7 @@ library angular.events; import 'dart:html'; import './hammer_common.dart'; -import 'package:angular2/src/core/facade/lang.dart' show BaseException; +import 'package:angular2/src/core/facade/exceptions.dart' show BaseException; import "package:angular2/src/core/di.dart" show Injectable; import 'dart:js' as js; diff --git a/modules/angular2/src/core/render/dom/events/hammer_gestures.ts b/modules/angular2/src/core/render/dom/events/hammer_gestures.ts index 666682e50c..400829f612 100644 --- a/modules/angular2/src/core/render/dom/events/hammer_gestures.ts +++ b/modules/angular2/src/core/render/dom/events/hammer_gestures.ts @@ -1,7 +1,8 @@ /// import {HammerGesturesPluginCommon} from './hammer_common'; -import {isPresent, BaseException} from 'angular2/src/core/facade/lang'; +import {isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {Injectable} from 'angular2/src/core/di'; @Injectable() diff --git a/modules/angular2/src/core/render/dom/events/key_events.ts b/modules/angular2/src/core/render/dom/events/key_events.ts index ee1a476fc6..c855b12945 100644 --- a/modules/angular2/src/core/render/dom/events/key_events.ts +++ b/modules/angular2/src/core/render/dom/events/key_events.ts @@ -4,7 +4,6 @@ import { isBlank, StringWrapper, RegExpWrapper, - BaseException, NumberWrapper } from 'angular2/src/core/facade/lang'; import {StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; diff --git a/modules/angular2/src/core/render/dom/view/proto_view_builder.ts b/modules/angular2/src/core/render/dom/view/proto_view_builder.ts index 556effa131..34dd3c5a65 100644 --- a/modules/angular2/src/core/render/dom/view/proto_view_builder.ts +++ b/modules/angular2/src/core/render/dom/view/proto_view_builder.ts @@ -1,4 +1,5 @@ -import {isPresent, isBlank, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import { ListWrapper, MapWrapper, diff --git a/modules/angular2/src/core/render/dom/view/proto_view_merger.ts b/modules/angular2/src/core/render/dom/view/proto_view_merger.ts index 8ac4c41abb..5849192f1e 100644 --- a/modules/angular2/src/core/render/dom/view/proto_view_merger.ts +++ b/modules/angular2/src/core/render/dom/view/proto_view_merger.ts @@ -1,5 +1,5 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {isPresent, isBlank, BaseException, isArray} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, isArray} from 'angular2/src/core/facade/lang'; import {ListWrapper, SetWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import {DomProtoView, DomProtoViewRef, resolveInternalDomProtoView} from './proto_view'; diff --git a/modules/angular2/src/core/render/dom/view/view.ts b/modules/angular2/src/core/render/dom/view/view.ts index bfb4f5c7c7..f3a3de19b1 100644 --- a/modules/angular2/src/core/render/dom/view/view.ts +++ b/modules/angular2/src/core/render/dom/view/view.ts @@ -1,6 +1,6 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {ListWrapper, MapWrapper, Map, StringMapWrapper} from 'angular2/src/core/facade/collection'; -import {isPresent, isBlank, BaseException, stringify} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, stringify} from 'angular2/src/core/facade/lang'; import {DomProtoView} from './proto_view'; diff --git a/modules/angular2/src/core/render/xhr_mock.ts b/modules/angular2/src/core/render/xhr_mock.ts index 4e0d7a9ff4..2f5c3b368a 100644 --- a/modules/angular2/src/core/render/xhr_mock.ts +++ b/modules/angular2/src/core/render/xhr_mock.ts @@ -1,6 +1,7 @@ import {XHR} from 'angular2/src/core/render/xhr'; import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; -import {isBlank, isPresent, normalizeBlank, BaseException} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, normalizeBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {PromiseCompleter, PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; export class MockXHR extends XHR { diff --git a/modules/angular2/src/core/services/url_resolver.ts b/modules/angular2/src/core/services/url_resolver.ts index 88c5f5ba91..aefcd72382 100644 --- a/modules/angular2/src/core/services/url_resolver.ts +++ b/modules/angular2/src/core/services/url_resolver.ts @@ -1,11 +1,6 @@ import {Injectable} from 'angular2/src/core/di'; -import { - isPresent, - isBlank, - RegExpWrapper, - BaseException, - normalizeBlank -} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, RegExpWrapper, normalizeBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; /** diff --git a/modules/angular2/src/core/testability/testability.ts b/modules/angular2/src/core/testability/testability.ts index f9cc1ffe12..a74f22e6fc 100644 --- a/modules/angular2/src/core/testability/testability.ts +++ b/modules/angular2/src/core/testability/testability.ts @@ -1,7 +1,7 @@ import {Injectable} from 'angular2/src/core/di'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; -import {StringWrapper, isBlank, BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import * as getTestabilityModule from './get_testability'; import {NgZone} from '../zone/ng_zone'; import {PromiseWrapper} from 'angular2/src/core/facade/async'; diff --git a/modules/angular2/src/http/backends/jsonp_backend.ts b/modules/angular2/src/http/backends/jsonp_backend.ts index 7ceb114f2d..c9b4d00563 100644 --- a/modules/angular2/src/http/backends/jsonp_backend.ts +++ b/modules/angular2/src/http/backends/jsonp_backend.ts @@ -6,7 +6,8 @@ import {ResponseOptions, BaseResponseOptions} from '../base_response_options'; import {Injectable} from 'angular2/src/core/di'; import {BrowserJsonp} from './browser_jsonp'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {StringWrapper, isPresent, makeTypeError} from 'angular2/src/core/facade/lang'; +import {makeTypeError} from 'angular2/src/core/facade/exceptions'; +import {StringWrapper, isPresent} from 'angular2/src/core/facade/lang'; export class JSONPConnection implements Connection { readyState: ReadyStates; diff --git a/modules/angular2/src/http/backends/mock_backend.ts b/modules/angular2/src/http/backends/mock_backend.ts index 35d64b13e7..4aa0d0124b 100644 --- a/modules/angular2/src/http/backends/mock_backend.ts +++ b/modules/angular2/src/http/backends/mock_backend.ts @@ -5,7 +5,7 @@ import {ReadyStates} from '../enums'; import {Connection, ConnectionBackend} from '../interfaces'; import {ObservableWrapper, EventEmitter} from 'angular2/src/core/facade/async'; import {isPresent} from 'angular2/src/core/facade/lang'; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; /** * diff --git a/modules/angular2/src/http/headers.ts b/modules/angular2/src/http/headers.ts index 68771778b8..1e37ef8d31 100644 --- a/modules/angular2/src/http/headers.ts +++ b/modules/angular2/src/http/headers.ts @@ -1,11 +1,5 @@ -import { - isPresent, - isBlank, - isJsObject, - isType, - StringWrapper, - BaseException -} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, isJsObject, isType, StringWrapper} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import { isListLikeIterable, Map, diff --git a/modules/angular2/src/http/http.ts b/modules/angular2/src/http/http.ts index f54c73ba5d..5fc4c1d808 100644 --- a/modules/angular2/src/http/http.ts +++ b/modules/angular2/src/http/http.ts @@ -1,4 +1,5 @@ -import {isString, isPresent, isBlank, makeTypeError} from 'angular2/src/core/facade/lang'; +import {isString, isPresent, isBlank} from 'angular2/src/core/facade/lang'; +import {makeTypeError} from 'angular2/src/core/facade/exceptions'; import {Injectable} from 'angular2/src/core/di/decorators'; import {RequestOptionsArgs, Connection, ConnectionBackend} from './interfaces'; import {Request} from './static_request'; diff --git a/modules/angular2/src/http/interfaces.ts b/modules/angular2/src/http/interfaces.ts index 9af565f9d1..e7d9adaa6a 100644 --- a/modules/angular2/src/http/interfaces.ts +++ b/modules/angular2/src/http/interfaces.ts @@ -9,7 +9,7 @@ import { ResponseTypes } from './enums'; import {Headers} from './headers'; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {EventEmitter} from 'angular2/src/core/facade/async'; import {Request} from './static_request'; import {URLSearchParamsUnionFixer, URLSearchParams} from './url_search_params'; diff --git a/modules/angular2/src/http/static_request.ts b/modules/angular2/src/http/static_request.ts index 4b2c34b9ee..4d182b3ced 100644 --- a/modules/angular2/src/http/static_request.ts +++ b/modules/angular2/src/http/static_request.ts @@ -2,7 +2,6 @@ import {RequestMethods, RequestModesOpts, RequestCredentialsOpts, RequestCacheOp import {RequestOptions} from './base_request_options'; import {Headers} from './headers'; import { - BaseException, RegExpWrapper, CONST_EXPR, isPresent, @@ -10,6 +9,7 @@ import { StringWrapper } from 'angular2/src/core/facade/lang'; + // TODO(jeffbcross): properly implement body accessors /** * Creates `Request` instances from provided values. diff --git a/modules/angular2/src/http/static_response.ts b/modules/angular2/src/http/static_response.ts index 97e85b6be8..5231a23820 100644 --- a/modules/angular2/src/http/static_response.ts +++ b/modules/angular2/src/http/static_response.ts @@ -1,5 +1,6 @@ import {ResponseTypes} from './enums'; -import {BaseException, CONST_EXPR, isString, isPresent, Json} from 'angular2/src/core/facade/lang'; +import {CONST_EXPR, isString, isPresent, Json} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {Headers} from './headers'; import {ResponseOptions} from './base_response_options'; import {isJsObject} from './http_utils'; diff --git a/modules/angular2/src/mock/directive_resolver_mock.ts b/modules/angular2/src/mock/directive_resolver_mock.ts index f4e35b0174..948f3e4ac0 100644 --- a/modules/angular2/src/mock/directive_resolver_mock.ts +++ b/modules/angular2/src/mock/directive_resolver_mock.ts @@ -1,12 +1,5 @@ import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; -import { - Type, - isPresent, - BaseException, - stringify, - isBlank, - print -} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, stringify, isBlank, print} from 'angular2/src/core/facade/lang'; import {DirectiveMetadata, ComponentMetadata} from '../core/metadata'; import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; diff --git a/modules/angular2/src/mock/view_resolver_mock.ts b/modules/angular2/src/mock/view_resolver_mock.ts index 91a207183d..e20fc314e8 100644 --- a/modules/angular2/src/mock/view_resolver_mock.ts +++ b/modules/angular2/src/mock/view_resolver_mock.ts @@ -1,5 +1,6 @@ import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; -import {Type, isPresent, BaseException, stringify, isBlank} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, stringify, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ViewMetadata} from '../core/metadata'; import {ViewResolver} from 'angular2/src/core/compiler/view_resolver'; diff --git a/modules/angular2/src/router/location.ts b/modules/angular2/src/router/location.ts index c7df8d2848..49c3f5a8aa 100644 --- a/modules/angular2/src/router/location.ts +++ b/modules/angular2/src/router/location.ts @@ -1,7 +1,8 @@ import {LocationStrategy} from './location_strategy'; import {StringWrapper, isPresent, CONST_EXPR} from 'angular2/src/core/facade/lang'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {BaseException, isBlank} from 'angular2/src/core/facade/lang'; +import {isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {OpaqueToken, Injectable, Optional, Inject} from 'angular2/src/core/di'; export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHref')); diff --git a/modules/angular2/src/router/location_strategy.ts b/modules/angular2/src/router/location_strategy.ts index 0ae386641d..4643ff02e2 100644 --- a/modules/angular2/src/router/location_strategy.ts +++ b/modules/angular2/src/router/location_strategy.ts @@ -1,4 +1,4 @@ -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; function _abstract() { return new BaseException('This method is abstract'); diff --git a/modules/angular2/src/router/path_recognizer.ts b/modules/angular2/src/router/path_recognizer.ts index 7a32d94e05..f22a666cce 100644 --- a/modules/angular2/src/router/path_recognizer.ts +++ b/modules/angular2/src/router/path_recognizer.ts @@ -4,9 +4,10 @@ import { RegExpMatcherWrapper, StringWrapper, isPresent, - isBlank, - BaseException + isBlank } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; + import { Map, MapWrapper, diff --git a/modules/angular2/src/router/route_config_nomalizer.ts b/modules/angular2/src/router/route_config_nomalizer.ts index 872e4399ec..7661a191d5 100644 --- a/modules/angular2/src/router/route_config_nomalizer.ts +++ b/modules/angular2/src/router/route_config_nomalizer.ts @@ -1,6 +1,8 @@ import {AsyncRoute, AuxRoute, Route, Redirect, RouteDefinition} from './route_config_decorator'; import {ComponentDefinition} from './route_definition'; -import {Type, BaseException} from 'angular2/src/core/facade/lang'; +import {Type} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; + /** * Given a JS Object that represents... returns a corresponding Route, AsyncRoute, or Redirect diff --git a/modules/angular2/src/router/route_recognizer.ts b/modules/angular2/src/router/route_recognizer.ts index 9eb0ce537e..d7e709c1fa 100644 --- a/modules/angular2/src/router/route_recognizer.ts +++ b/modules/angular2/src/router/route_recognizer.ts @@ -6,9 +6,9 @@ import { isPresent, isType, isStringMap, - BaseException, Type } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import { Map, MapWrapper, diff --git a/modules/angular2/src/router/route_registry.ts b/modules/angular2/src/router/route_registry.ts index 4115213786..ed9f639938 100644 --- a/modules/angular2/src/router/route_registry.ts +++ b/modules/angular2/src/router/route_registry.ts @@ -17,10 +17,10 @@ import { isStringMap, isFunction, StringWrapper, - BaseException, Type, getTypeNameForDebugging } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import { RouteConfig, AsyncRoute, diff --git a/modules/angular2/src/router/router.ts b/modules/angular2/src/router/router.ts index 0434606df6..68efc51a4c 100644 --- a/modules/angular2/src/router/router.ts +++ b/modules/angular2/src/router/router.ts @@ -11,10 +11,9 @@ import { StringWrapper, isPresent, Type, - isArray, - BaseException + isArray } from 'angular2/src/core/facade/lang'; - +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {RouteRegistry} from './route_registry'; import {Pipeline} from './pipeline'; import {ComponentInstruction, Instruction, stringifyInstruction} from './instruction'; diff --git a/modules/angular2/src/router/router_outlet.ts b/modules/angular2/src/router/router_outlet.ts index cc653d1100..7602ac0f9b 100644 --- a/modules/angular2/src/router/router_outlet.ts +++ b/modules/angular2/src/router/router_outlet.ts @@ -1,6 +1,7 @@ import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {StringMapWrapper} from 'angular2/src/core/facade/collection'; -import {isBlank, isPresent, BaseException} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {Directive, Attribute} from 'angular2/src/core/metadata'; import {DynamicComponentLoader, ComponentRef, ElementRef} from 'angular2/src/core/compiler'; diff --git a/modules/angular2/src/router/url_parser.ts b/modules/angular2/src/router/url_parser.ts index 3dbf582f0c..b1f71e8a30 100644 --- a/modules/angular2/src/router/url_parser.ts +++ b/modules/angular2/src/router/url_parser.ts @@ -1,11 +1,6 @@ import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; -import { - isPresent, - isBlank, - BaseException, - RegExpWrapper, - CONST_EXPR -} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, RegExpWrapper, CONST_EXPR} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; /** * This class represents a parsed URL diff --git a/modules/angular2/src/test_lib/benchmark_util.ts b/modules/angular2/src/test_lib/benchmark_util.ts index cb902c3f9d..6402fa5ce0 100644 --- a/modules/angular2/src/test_lib/benchmark_util.ts +++ b/modules/angular2/src/test_lib/benchmark_util.ts @@ -1,6 +1,7 @@ import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter'; import {document, window} from 'angular2/src/core/facade/browser'; -import {NumberWrapper, BaseException, isBlank} from 'angular2/src/core/facade/lang'; +import {NumberWrapper, isBlank} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; var DOM = new BrowserDomAdapter(); diff --git a/modules/angular2/src/test_lib/fake_async.dart b/modules/angular2/src/test_lib/fake_async.dart index facb963baf..550bd9ec75 100644 --- a/modules/angular2/src/test_lib/fake_async.dart +++ b/modules/angular2/src/test_lib/fake_async.dart @@ -2,7 +2,7 @@ library test_lib.fake_async; import 'dart:async' show runZoned, ZoneSpecification; import 'package:quiver/testing/async.dart' as quiver; -import 'package:angular2/src/core/facade/lang.dart' show BaseException; +import 'package:angular2/src/core/facade/exceptions.dart' show BaseException; const _u = const Object(); diff --git a/modules/angular2/src/test_lib/fake_async.ts b/modules/angular2/src/test_lib/fake_async.ts index 7bd169f274..6ba5c4d158 100644 --- a/modules/angular2/src/test_lib/fake_async.ts +++ b/modules/angular2/src/test_lib/fake_async.ts @@ -1,6 +1,7 @@ /// -import {BaseException, global} from 'angular2/src/core/facade/lang'; +import {global} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper} from 'angular2/src/core/facade/collection'; import {NgZoneZone} from 'angular2/src/core/zone/ng_zone'; diff --git a/modules/angular2/src/test_lib/test_component_builder.ts b/modules/angular2/src/test_lib/test_component_builder.ts index 853e6d9027..bc51c01935 100644 --- a/modules/angular2/src/test_lib/test_component_builder.ts +++ b/modules/angular2/src/test_lib/test_component_builder.ts @@ -1,6 +1,6 @@ import {Injector, bind, Injectable} from 'angular2/src/core/di'; -import {Type, isPresent, BaseException, isBlank} from 'angular2/src/core/facade/lang'; +import {Type, isPresent, isBlank} from 'angular2/src/core/facade/lang'; import {Promise} from 'angular2/src/core/facade/async'; import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; diff --git a/modules/angular2/src/test_lib/test_injector.ts b/modules/angular2/src/test_lib/test_injector.ts index 05c1dc7d39..ecb13460f5 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/facade/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exceptions'; 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 d0854d2b7c..b2b842d04b 100644 --- a/modules/angular2/src/test_lib/test_lib.dart +++ b/modules/angular2/src/test_lib/test_lib.dart @@ -22,7 +22,6 @@ 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/facade/exception_handler.dart' show ExceptionHandler; import 'package:angular2/src/core/facade/collection.dart' show StringMapWrapper; import 'test_injector.dart'; @@ -77,7 +76,7 @@ Expect expect(actual, [matcher]) { const _u = const Object(); expectErrorMessage(actual, expectedMessage) { - expect(ExceptionHandler.exceptionToString(actual)).toContain(expectedMessage); + expect(actual.toString()).toContain(expectedMessage); } expectException(Function actual, expectedMessage) { diff --git a/modules/angular2/src/test_lib/test_lib.ts b/modules/angular2/src/test_lib/test_lib.ts index 82ad9c64fa..2d60b23a14 100644 --- a/modules/angular2/src/test_lib/test_lib.ts +++ b/modules/angular2/src/test_lib/test_lib.ts @@ -6,7 +6,6 @@ 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/facade/exception_handler'; import {createTestInjector, FunctionWithParamTokens, inject} from './test_injector'; @@ -285,7 +284,7 @@ _global.beforeEach(function() { toContainError: function() { return { compare: function(actual, expectedText) { - var errorMessage = ExceptionHandler.exceptionToString(actual); + var errorMessage = actual.toString(); return { pass: errorMessage.indexOf(expectedText) > -1, get message() { return 'Expected ' + errorMessage + ' to contain ' + expectedText; } @@ -304,7 +303,7 @@ _global.beforeEach(function() { get message() { return "Was expected to throw, but did not throw"; } }; } catch (e) { - var errorMessage = ExceptionHandler.exceptionToString(e); + var errorMessage = e.toString(); return { pass: errorMessage.indexOf(expectedText) > -1, get message() { return 'Expected ' + errorMessage + ' to contain ' + expectedText; } diff --git a/modules/angular2/src/web_workers/shared/generic_message_bus.dart b/modules/angular2/src/web_workers/shared/generic_message_bus.dart index 7623b67f10..135ea50089 100644 --- a/modules/angular2/src/web_workers/shared/generic_message_bus.dart +++ b/modules/angular2/src/web_workers/shared/generic_message_bus.dart @@ -6,6 +6,7 @@ import 'package:angular2/src/web_workers/shared/message_bus.dart' show MessageBus, MessageBusSink, MessageBusSource; import 'package:angular2/src/core/zone/ng_zone.dart'; import 'package:angular2/src/core/facade/lang.dart'; +import 'package:angular2/src/core/facade/exceptions.dart'; class GenericMessageBus implements MessageBus { final MessageBusSink _sink; diff --git a/modules/angular2/src/web_workers/shared/message_bus.ts b/modules/angular2/src/web_workers/shared/message_bus.ts index 95e6f97885..b2c8151098 100644 --- a/modules/angular2/src/web_workers/shared/message_bus.ts +++ b/modules/angular2/src/web_workers/shared/message_bus.ts @@ -1,5 +1,5 @@ import {EventEmitter} from 'angular2/src/core/facade/async'; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; export {EventEmitter, Observable} from 'angular2/src/core/facade/async'; 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 4ca8c4137e..63abc1b594 100644 --- a/modules/angular2/src/web_workers/shared/post_message_bus.ts +++ b/modules/angular2/src/web_workers/shared/post_message_bus.ts @@ -3,7 +3,7 @@ import { MessageBusSource, MessageBusSink } from "angular2/src/web_workers/shared/message_bus"; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {EventEmitter} from 'angular2/src/core/facade/async'; import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {Injectable} from "angular2/src/core/di"; diff --git a/modules/angular2/src/web_workers/shared/serializer.ts b/modules/angular2/src/web_workers/shared/serializer.ts index eeddf2246b..3d680bc419 100644 --- a/modules/angular2/src/web_workers/shared/serializer.ts +++ b/modules/angular2/src/web_workers/shared/serializer.ts @@ -3,9 +3,10 @@ import { isArray, isPresent, serializeEnum, - deserializeEnum, - BaseException + deserializeEnum } from "angular2/src/core/facade/lang"; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; + import { ListWrapper, Map, diff --git a/modules/angular2/src/web_workers/ui/application.ts b/modules/angular2/src/web_workers/ui/application.ts index 9f5014b0d7..784a55529d 100644 --- a/modules/angular2/src/web_workers/ui/application.ts +++ b/modules/angular2/src/web_workers/ui/application.ts @@ -4,7 +4,7 @@ import { PostMessageBusSource } from 'angular2/src/web_workers/shared/post_message_bus'; import {MessageBus} from 'angular2/src/web_workers/shared/message_bus'; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {bootstrapUICommon, WebWorkerApplication} from 'angular2/src/web_workers/ui/impl'; export {WebWorkerApplication} from 'angular2/src/web_workers/ui/impl'; export * from 'angular2/src/web_workers/shared/message_bus'; diff --git a/modules/angular2/src/web_workers/ui/di_bindings.ts b/modules/angular2/src/web_workers/ui/di_bindings.ts index 8272a56984..0d6bd7baa9 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/facade/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exceptions'; 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/ui/event_dispatcher.ts b/modules/angular2/src/web_workers/ui/event_dispatcher.ts index a969192bc2..b9c4ac956b 100644 --- a/modules/angular2/src/web_workers/ui/event_dispatcher.ts +++ b/modules/angular2/src/web_workers/ui/event_dispatcher.ts @@ -9,7 +9,7 @@ import { serializeGenericEvent, serializeEventWithTarget } from 'angular2/src/web_workers/ui/event_serializer'; -import {BaseException} from "angular2/src/core/facade/lang"; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {StringMapWrapper} from 'angular2/src/core/facade/collection'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; diff --git a/modules/angular2/src/web_workers/ui/renderer.ts b/modules/angular2/src/web_workers/ui/renderer.ts index 5aa6c59650..2db2809cf0 100644 --- a/modules/angular2/src/web_workers/ui/renderer.ts +++ b/modules/angular2/src/web_workers/ui/renderer.ts @@ -9,7 +9,7 @@ import { } from 'angular2/src/core/render/api'; import {WebWorkerElementRef} from 'angular2/src/web_workers/shared/api'; import {EVENT_CHANNEL, RENDERER_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api'; -import {BaseException, Type} from 'angular2/src/core/facade/lang'; +import {Type} from 'angular2/src/core/facade/lang'; import {bind} from './bind'; import {EventDispatcher} from 'angular2/src/web_workers/ui/event_dispatcher'; import { diff --git a/modules/angular2/src/web_workers/worker/application.ts b/modules/angular2/src/web_workers/worker/application.ts index fe2dd1d929..e4764bd6a0 100644 --- a/modules/angular2/src/web_workers/worker/application.ts +++ b/modules/angular2/src/web_workers/worker/application.ts @@ -3,7 +3,7 @@ import { PostMessageBusSink, PostMessageBusSource } from 'angular2/src/web_workers/shared/post_message_bus'; -import {Type, BaseException} from "angular2/src/core/facade/lang"; +import {Type} from "angular2/src/core/facade/lang"; import {Binding, Injectable} from "angular2/src/core/di"; import {Map} from 'angular2/src/core/facade/collection'; import {Promise} from 'angular2/src/core/facade/async'; diff --git a/modules/angular2/src/web_workers/worker/application_common.ts b/modules/angular2/src/web_workers/worker/application_common.ts index 330a35b6e3..1357e5de84 100644 --- a/modules/angular2/src/web_workers/worker/application_common.ts +++ b/modules/angular2/src/web_workers/worker/application_common.ts @@ -6,7 +6,6 @@ import { Type, isBlank, isPresent, - BaseException, assertionsEnabled, print, stringify @@ -25,7 +24,7 @@ import { KeyValueDiffers, defaultKeyValueDiffers } from 'angular2/src/core/change_detection/change_detection'; -import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exceptions'; 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/src/web_workers/worker/renderer.ts b/modules/angular2/src/web_workers/worker/renderer.ts index 2010c017d8..d7f9e8921e 100644 --- a/modules/angular2/src/web_workers/worker/renderer.ts +++ b/modules/angular2/src/web_workers/worker/renderer.ts @@ -19,7 +19,7 @@ import { FnArg, UiArguments } from "angular2/src/web_workers/shared/client_message_broker"; -import {isPresent, print, BaseException} from "angular2/src/core/facade/lang"; +import {isPresent, print} from "angular2/src/core/facade/lang"; import {Injectable} from "angular2/src/core/di"; import { RenderViewWithFragmentsStore, diff --git a/modules/angular2/test/compiler/style_compiler_spec.ts b/modules/angular2/test/compiler/style_compiler_spec.ts index 8fe6a23df1..264b41cfc5 100644 --- a/modules/angular2/test/compiler/style_compiler_spec.ts +++ b/modules/angular2/test/compiler/style_compiler_spec.ts @@ -13,8 +13,9 @@ import { } from 'angular2/test_lib'; import {IS_DART} from '../platform'; import {SpyXHR} from '../core/spies'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; -import {CONST_EXPR, isPresent, BaseException} from 'angular2/src/core/facade/lang'; +import {CONST_EXPR, isPresent} from 'angular2/src/core/facade/lang'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {evalModule} from './eval_module'; import {StyleCompiler} from 'angular2/src/compiler/style_compiler'; diff --git a/modules/angular2/test/compiler/template_parser_spec.ts b/modules/angular2/test/compiler/template_parser_spec.ts index fcf149bdf3..72c463d419 100644 --- a/modules/angular2/test/compiler/template_parser_spec.ts +++ b/modules/angular2/test/compiler/template_parser_spec.ts @@ -614,7 +614,7 @@ Can't bind to 'invalidProp' since it isn't a known native property in TestComp > }); it('should report errors in expressions', () => { - expect(() => parse('
', [])).toThrowError(`Template parse errors: + expect(() => parse('
', [])).toThrowErrorWith(`Template parse errors: Parser Error: Unexpected token 'b' at column 3 in [a b] in TestComp > div:nth-child(0)[[prop]=a b]`); }); diff --git a/modules/angular2/test/core/application_spec.ts b/modules/angular2/test/core/application_spec.ts index eea0a7365d..167dece1e3 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/facade/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exceptions'; import {Testability, TestabilityRegistry} from 'angular2/src/core/testability/testability'; import {IS_DART} from '../platform'; diff --git a/modules/angular2/test/core/change_detection/change_detector_spec.ts b/modules/angular2/test/core/change_detection/change_detector_spec.ts index 6366cdeb8f..f4c1bd5df4 100644 --- a/modules/angular2/test/core/change_detection/change_detector_spec.ts +++ b/modules/angular2/test/core/change_detection/change_detector_spec.ts @@ -16,10 +16,10 @@ import { isPresent, isBlank, isJsObject, - BaseException, FunctionWrapper, normalizeBool } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { @@ -1140,9 +1140,8 @@ export function main() { expect(val.dispatcher.log).toEqual(['propName=Bob']); val.changeDetector.dehydrate(); - var dehydratedException = new DehydratedException(); expect(() => {val.changeDetector.detectChanges()}) - .toThrowError(dehydratedException.toString()); + .toThrowErrorWith("Attempt to detect changes on a dehydrated detector"); expect(val.dispatcher.log).toEqual(['propName=Bob']); }); }); diff --git a/modules/angular2/test/core/change_detection/parser/parser_spec.ts b/modules/angular2/test/core/change_detection/parser/parser_spec.ts index 7f715dd007..ee56824e8b 100644 --- a/modules/angular2/test/core/change_detection/parser/parser_spec.ts +++ b/modules/angular2/test/core/change_detection/parser/parser_spec.ts @@ -1,5 +1,5 @@ import {ddescribe, describe, it, xit, iit, expect, beforeEach} from 'angular2/test_lib'; -import {BaseException, isBlank, isPresent} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent} from 'angular2/src/core/facade/lang'; import {reflector} from 'angular2/src/core/reflection/reflection'; import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {Parser} from 'angular2/src/core/change_detection/parser/parser'; diff --git a/modules/angular2/test/core/compiler/integration_spec.ts b/modules/angular2/test/core/compiler/integration_spec.ts index bf665709ce..cd7db0044e 100644 --- a/modules/angular2/test/core/compiler/integration_spec.ts +++ b/modules/angular2/test/core/compiler/integration_spec.ts @@ -25,7 +25,6 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; import { Type, isPresent, - BaseException, assertionsEnabled, isJsObject, global, @@ -34,6 +33,7 @@ import { CONST, CONST_EXPR } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import { PromiseWrapper, EventEmitter, diff --git a/modules/angular2/test/core/di/injector_spec.ts b/modules/angular2/test/core/di/injector_spec.ts index 1ab6839e2e..09e349c6e3 100644 --- a/modules/angular2/test/core/di/injector_spec.ts +++ b/modules/angular2/test/core/di/injector_spec.ts @@ -1,4 +1,5 @@ -import {isBlank, BaseException, stringify} from 'angular2/src/core/facade/lang'; +import {isBlank, stringify} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {describe, ddescribe, it, iit, expect, beforeEach} from 'angular2/test_lib'; import {SpyDependencyProvider} from '../spies'; import { diff --git a/modules/angular2/test/core/facade/exception_handler_spec.ts b/modules/angular2/test/core/facade/exception_handler_spec.ts index 346c7b7a51..5f1a76677b 100644 --- a/modules/angular2/test/core/facade/exception_handler_spec.ts +++ b/modules/angular2/test/core/facade/exception_handler_spec.ts @@ -11,8 +11,11 @@ import { xit, Log } from 'angular2/test_lib'; -import {BaseException} from 'angular2/src/core/facade/lang'; -import {ExceptionHandler} from 'angular2/src/core/facade/exception_handler'; +import { + BaseException, + WrappedException, + ExceptionHandler +} from 'angular2/src/core/facade/exceptions'; class _CustomException { context = "some context"; @@ -46,13 +49,13 @@ export function main() { describe("context", () => { it("should print context", () => { var e = ExceptionHandler.exceptionToString( - new BaseException("message!", null, null, "context!")); + new WrappedException("message!", null, null, "context!")); expect(e).toContain("context!"); }); it("should print nested context", () => { - var original = new BaseException("message!", null, null, "context!"); - var e = ExceptionHandler.exceptionToString(new BaseException("message", original)); + var original = new WrappedException("message!", null, null, "context!"); + var e = ExceptionHandler.exceptionToString(new WrappedException("message", original)); expect(e).toContain("context!"); }); @@ -65,17 +68,18 @@ export function main() { describe('original exception', () => { it("should print original exception message if available (original is BaseException)", () => { var realOriginal = new BaseException("inner"); - var original = new BaseException("wrapped", realOriginal); - var e = ExceptionHandler.exceptionToString(new BaseException("wrappedwrapped", original)); + var original = new WrappedException("wrapped", realOriginal); + var e = + ExceptionHandler.exceptionToString(new WrappedException("wrappedwrapped", original)); expect(e).toContain("inner"); }); it("should print original exception message if available (original is not BaseException)", () => { var realOriginal = new _CustomException(); - var original = new BaseException("wrapped", realOriginal); + var original = new WrappedException("wrapped", realOriginal); var e = - ExceptionHandler.exceptionToString(new BaseException("wrappedwrapped", original)); + ExceptionHandler.exceptionToString(new WrappedException("wrappedwrapped", original)); expect(e).toContain("custom"); }); }); @@ -83,9 +87,9 @@ export function main() { describe('original stack', () => { it("should print original stack if available", () => { var realOriginal = new BaseException("inner"); - var original = new BaseException("wrapped", realOriginal, "originalStack"); + var original = new WrappedException("wrapped", realOriginal, "originalStack"); var e = ExceptionHandler.exceptionToString( - new BaseException("wrappedwrapped", original, "wrappedStack")); + new WrappedException("wrappedwrapped", original, "wrappedStack")); expect(e).toContain("originalStack"); }); }); diff --git a/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts b/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts index 83b1d5de93..a658ea9e17 100644 --- a/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts +++ b/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts @@ -12,7 +12,8 @@ import { import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {ListWrapper, Map, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; -import {Type, isBlank, stringify, isPresent, BaseException} from 'angular2/src/core/facade/lang'; +import {Type, isBlank, stringify, isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {DomCompiler} from 'angular2/src/core/render/dom/compiler/compiler'; diff --git a/modules/angular2/test/core/zone/ng_zone_spec.ts b/modules/angular2/test/core/zone/ng_zone_spec.ts index 48659bb6a5..078b839d08 100644 --- a/modules/angular2/test/core/zone/ng_zone_spec.ts +++ b/modules/angular2/test/core/zone/ng_zone_spec.ts @@ -15,7 +15,7 @@ import { } from 'angular2/test_lib'; import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/core/facade/async'; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; diff --git a/modules/angular2/test/router/integration/router_integration_spec.ts b/modules/angular2/test/router/integration/router_integration_spec.ts index 06a8039be5..5e735f3b4a 100644 --- a/modules/angular2/test/router/integration/router_integration_spec.ts +++ b/modules/angular2/test/router/integration/router_integration_spec.ts @@ -21,7 +21,7 @@ import {bind} from 'angular2/core'; import {DOCUMENT} from 'angular2/src/core/render/render'; import {RouteConfig, Route, Redirect} from 'angular2/src/router/route_config_decorator'; import {PromiseWrapper} from 'angular2/src/core/facade/async'; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import { ROUTER_BINDINGS, RouteParams, diff --git a/modules/angular2/test/router/route_config_spec.ts b/modules/angular2/test/router/route_config_spec.ts index d63eb22ca0..a43b25c2e9 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/facade/exception_handler'; +import {ExceptionHandler} from 'angular2/src/core/facade/exceptions'; import {LocationStrategy} from 'angular2/src/router/location_strategy'; import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy'; diff --git a/modules/angular2/test/test_lib/fake_async_spec.ts b/modules/angular2/test/test_lib/fake_async_spec.ts index bdc445ca13..0f58ee0906 100644 --- a/modules/angular2/test/test_lib/fake_async_spec.ts +++ b/modules/angular2/test/test_lib/fake_async_spec.ts @@ -14,7 +14,7 @@ import { xit } from 'angular2/test_lib'; import {TimerWrapper, PromiseWrapper} from 'angular2/src/core/facade/async'; -import {BaseException, global} from 'angular2/src/core/facade/lang'; +import {BaseException} from 'angular2/src/core/facade/exceptions'; import {Parser} from 'angular2/src/core/change_detection/change_detection'; export function main() { diff --git a/modules/angular2/test/web_workers/shared/web_worker_test_util.ts b/modules/angular2/test/web_workers/shared/web_worker_test_util.ts index dbfac75fbe..220c495033 100644 --- a/modules/angular2/test/web_workers/shared/web_worker_test_util.ts +++ b/modules/angular2/test/web_workers/shared/web_worker_test_util.ts @@ -5,7 +5,7 @@ import { MessageBus } from 'angular2/src/web_workers/shared/message_bus'; import {MockEventEmitter} from './mock_event_emitter'; -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; /** 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 c5adb4e688..7b8c1b19e1 100644 --- a/modules/angular2/test/web_workers/worker/renderer_integration_spec.ts +++ b/modules/angular2/test/web_workers/worker/renderer_integration_spec.ts @@ -18,7 +18,7 @@ import { FnArg } from "angular2/src/web_workers/shared/client_message_broker"; import {Serializer} from "angular2/src/web_workers/shared/serializer"; -import {isPresent, isBlank, BaseException, Type} from "angular2/src/core/facade/lang"; +import {isPresent, isBlank, Type} from "angular2/src/core/facade/lang"; import {MapWrapper, ListWrapper} from "angular2/src/core/facade/collection"; import { RenderDirectiveMetadata, diff --git a/modules/angular2/web_worker/ui.ts b/modules/angular2/web_worker/ui.ts index 83ca7d34bd..54d5eeb13b 100644 --- a/modules/angular2/web_worker/ui.ts +++ b/modules/angular2/web_worker/ui.ts @@ -1,3 +1,4 @@ +export * from '../src/core/facade'; export * from "../src/web_workers/ui/application"; export * from '../src/core/zone'; export * from "../src/web_workers/shared/client_message_broker"; diff --git a/modules/benchpress/src/metric.ts b/modules/benchpress/src/metric.ts index 917e498a79..350fa8ef76 100644 --- a/modules/benchpress/src/metric.ts +++ b/modules/benchpress/src/metric.ts @@ -1,6 +1,7 @@ import {bind, Binding} from 'angular2/src/core/di'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; -import {ABSTRACT, BaseException} from 'angular2/src/core/facade/lang'; +import {ABSTRACT} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {StringMap} from 'angular2/src/core/facade/collection'; /** diff --git a/modules/benchpress/src/metric/perflog_metric.ts b/modules/benchpress/src/metric/perflog_metric.ts index cf10a0ad38..0b750962aa 100644 --- a/modules/benchpress/src/metric/perflog_metric.ts +++ b/modules/benchpress/src/metric/perflog_metric.ts @@ -2,12 +2,12 @@ import {PromiseWrapper, Promise, TimerWrapper} from 'angular2/src/core/facade/as import { isPresent, isBlank, - BaseException, StringWrapper, Math, RegExpWrapper, NumberWrapper } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {ListWrapper, StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {bind, Binding, OpaqueToken} from 'angular2/src/core/di'; diff --git a/modules/benchpress/src/reporter.ts b/modules/benchpress/src/reporter.ts index 7d8b0beb88..7564351e82 100644 --- a/modules/benchpress/src/reporter.ts +++ b/modules/benchpress/src/reporter.ts @@ -1,6 +1,7 @@ import {bind, Binding} from 'angular2/src/core/di'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; -import {ABSTRACT, BaseException} from 'angular2/src/core/facade/lang'; +import {ABSTRACT} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {MeasureValues} from './measure_values'; /** diff --git a/modules/benchpress/src/validator.ts b/modules/benchpress/src/validator.ts index 4b9bc663a3..00d633bfb7 100644 --- a/modules/benchpress/src/validator.ts +++ b/modules/benchpress/src/validator.ts @@ -1,6 +1,7 @@ import {bind, Binding} from 'angular2/src/core/di'; import {StringMap} from 'angular2/src/core/facade/collection'; -import {ABSTRACT, BaseException} from 'angular2/src/core/facade/lang'; +import {ABSTRACT} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {MeasureValues} from './measure_values'; diff --git a/modules/benchpress/src/web_driver_adapter.ts b/modules/benchpress/src/web_driver_adapter.ts index 3dee4aff22..2d8b995573 100644 --- a/modules/benchpress/src/web_driver_adapter.ts +++ b/modules/benchpress/src/web_driver_adapter.ts @@ -1,6 +1,7 @@ import {bind, Binding} from 'angular2/src/core/di'; import {Promise} from 'angular2/src/core/facade/async'; -import {BaseException, ABSTRACT} from 'angular2/src/core/facade/lang'; +import {ABSTRACT} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {Map} from 'angular2/src/core/facade/collection'; /** diff --git a/modules/benchpress/src/web_driver_extension.ts b/modules/benchpress/src/web_driver_extension.ts index 6ff3179cff..0a200b742b 100644 --- a/modules/benchpress/src/web_driver_extension.ts +++ b/modules/benchpress/src/web_driver_extension.ts @@ -1,6 +1,7 @@ import {bind, Binding, Injector, OpaqueToken} from 'angular2/src/core/di'; -import {BaseException, ABSTRACT, isBlank, isPresent} from 'angular2/src/core/facade/lang'; +import {ABSTRACT, isBlank, isPresent} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; diff --git a/modules/benchpress/src/webdriver/chrome_driver_extension.ts b/modules/benchpress/src/webdriver/chrome_driver_extension.ts index 3e0161229c..91b875e1e9 100644 --- a/modules/benchpress/src/webdriver/chrome_driver_extension.ts +++ b/modules/benchpress/src/webdriver/chrome_driver_extension.ts @@ -6,9 +6,9 @@ import { isBlank, RegExpWrapper, StringWrapper, - BaseException, NumberWrapper } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {WebDriverExtension, PerfLogFeatures} from '../web_driver_extension'; import {WebDriverAdapter} from '../web_driver_adapter'; diff --git a/modules/benchpress/src/webdriver/ios_driver_extension.ts b/modules/benchpress/src/webdriver/ios_driver_extension.ts index 2582cdd507..dc0683fc16 100644 --- a/modules/benchpress/src/webdriver/ios_driver_extension.ts +++ b/modules/benchpress/src/webdriver/ios_driver_extension.ts @@ -5,9 +5,9 @@ import { isPresent, isBlank, RegExpWrapper, - StringWrapper, - BaseException + StringWrapper } from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {WebDriverExtension, PerfLogFeatures} from '../web_driver_extension'; import {WebDriverAdapter} from '../web_driver_adapter'; diff --git a/modules/benchpress/test/sampler_spec.ts b/modules/benchpress/test/sampler_spec.ts index 0ce9382598..ac014ba841 100644 --- a/modules/benchpress/test/sampler_spec.ts +++ b/modules/benchpress/test/sampler_spec.ts @@ -11,14 +11,7 @@ import { xit, } from 'angular2/test_lib'; -import { - isBlank, - isPresent, - BaseException, - stringify, - Date, - DateWrapper -} from 'angular2/src/core/facade/lang'; +import {isBlank, isPresent, stringify, Date, DateWrapper} from 'angular2/src/core/facade/lang'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import { diff --git a/modules/examples/src/material/demo_common.ts b/modules/examples/src/material/demo_common.ts index 7ba36b0751..23992b8127 100644 --- a/modules/examples/src/material/demo_common.ts +++ b/modules/examples/src/material/demo_common.ts @@ -1,12 +1,6 @@ import {print} from 'angular2/src/core/facade/lang'; import {UrlResolver} from 'angular2/src/core/services/url_resolver'; -import { - isPresent, - isBlank, - RegExpWrapper, - StringWrapper, - BaseException -} from 'angular2/src/core/facade/lang'; +import {isPresent, isBlank, RegExpWrapper, StringWrapper} from 'angular2/src/core/facade/lang'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {Injectable} from 'angular2/core'; import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter'; diff --git a/modules/examples/src/sourcemap/index.ts b/modules/examples/src/sourcemap/index.ts index 873dde8ecd..487f3c4710 100644 --- a/modules/examples/src/sourcemap/index.ts +++ b/modules/examples/src/sourcemap/index.ts @@ -1,4 +1,4 @@ -import {BaseException} from 'angular2/src/core/facade/lang'; +import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import {bootstrap} from 'angular2/bootstrap'; import {Component, View} from 'angular2/core'; diff --git a/modules_dart/transform/lib/src/transform/template_compiler/change_detector_codegen.dart b/modules_dart/transform/lib/src/transform/template_compiler/change_detector_codegen.dart index a7442c39a3..a805162a0c 100644 --- a/modules_dart/transform/lib/src/transform/template_compiler/change_detector_codegen.dart +++ b/modules_dart/transform/lib/src/transform/template_compiler/change_detector_codegen.dart @@ -12,7 +12,7 @@ import 'package:angular2/src/core/change_detection/proto_record.dart'; import 'package:angular2/src/core/change_detection/event_binding.dart'; import 'package:angular2/src/core/change_detection/binding_record.dart'; import 'package:angular2/src/core/change_detection/codegen_facade.dart' show codify; -import 'package:angular2/src/core/facade/lang.dart' show BaseException; +import 'package:angular2/src/core/facade/exceptions.dart' show BaseException; /// Responsible for generating change detector classes for Angular 2. ///