fix(exception_handler): fix error messages of wrapped exceptions
Closes #4117
This commit is contained in:
parent
892d2b9652
commit
f6cc573687
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import {ABSTRACT, BaseException, CONST, Type} from 'angular2/src/core/facade/lang';
|
||||
|
||||
/**
|
||||
* To create a Pipe, you must implement this interface.
|
||||
*
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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(); }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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';
|
|
@ -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) ? (<any>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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/// <reference path="../../../manual_typings/globals.d.ts" />
|
||||
|
||||
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 = (<any>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 = (<any>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);
|
||||
}
|
|
@ -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,
|
||||
|
|
|
@ -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 = (<any>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...
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
||||
/**
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 = '';
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@ import {
|
|||
RegExpWrapper,
|
||||
RegExpMatcherWrapper,
|
||||
isPresent,
|
||||
isBlank,
|
||||
BaseException
|
||||
isBlank
|
||||
} from 'angular2/src/core/facade/lang';
|
||||
|
||||
/**
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/// <reference path="../../../../../typings/hammerjs/hammerjs.d.ts"/>
|
||||
|
||||
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()
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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';
|
||||
|
||||
/**
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference path="../../typings/jasmine/jasmine.d.ts"/>
|
||||
|
||||
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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue