Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Error Messages #4117

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -31,6 +31,8 @@ pubspec.lock
.idea/
*.swo
modules/.settings
.vscode
modules/.vscode

# Don't check in secret files
*secret.js
Expand Down
3 changes: 1 addition & 2 deletions modules/angular2/src/compiler/template_parser.ts
Expand Up @@ -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';

Expand Down
7 changes: 5 additions & 2 deletions modules/angular2/src/core/application_common.ts
Expand Up @@ -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';
Expand All @@ -27,7 +31,6 @@ import {
KeyValueDiffers,
defaultKeyValueDiffers
} from 'angular2/src/core/change_detection/change_detection';
import {ExceptionHandler} from './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';
Expand Down
@@ -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';
Expand Down
Expand Up @@ -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';
Expand Down
@@ -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';
Expand Down Expand Up @@ -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);
Expand Down
@@ -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';
Expand Down
@@ -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.
Expand Down
@@ -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,
Expand Down
@@ -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';

Expand Down
@@ -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';
Expand Down
@@ -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';
Expand Down
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions 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.
Expand All @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
9 changes: 2 additions & 7 deletions 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,
Expand Down
3 changes: 2 additions & 1 deletion 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 {
Expand Down
6 changes: 3 additions & 3 deletions 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,
Expand Down Expand Up @@ -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}`);
}
}

Expand Down
2 changes: 0 additions & 2 deletions 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.
*
Expand Down
@@ -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';
Expand Down
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/core/compiler/compiler.ts
Expand Up @@ -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';

Expand Down
3 changes: 2 additions & 1 deletion 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,
Expand Down
@@ -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';
Expand Down
3 changes: 2 additions & 1 deletion 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';
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/core/compiler/element_injector.ts
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion 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';

Expand Down
3 changes: 2 additions & 1 deletion 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';

Expand Down
9 changes: 2 additions & 7 deletions 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 {
Expand Down
5 changes: 3 additions & 2 deletions modules/angular2/src/core/compiler/view.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion 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';
Expand Down
2 changes: 1 addition & 1 deletion 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';
Expand Down
3 changes: 2 additions & 1 deletion 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';
Expand Down
2 changes: 1 addition & 1 deletion 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';
Expand Down