refactor: Remove isDart from public API
BREAKING CHANGE: - `IS_DARTIUM` no longer exported
This commit is contained in:
@ -7,8 +7,7 @@ import {
|
||||
BaseException,
|
||||
assertionsEnabled,
|
||||
print,
|
||||
stringify,
|
||||
isDart
|
||||
stringify
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
|
||||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||
@ -76,6 +75,7 @@ import {
|
||||
import {internalView} from 'angular2/src/core/compiler/view_ref';
|
||||
import {APP_COMPONENT_REF_PROMISE, APP_COMPONENT} from './application_tokens';
|
||||
import {wtfInit} from '../profile/wtf_init';
|
||||
import {EXCEPTION_BINDING} from './platform_bindings';
|
||||
|
||||
var _rootInjector: Injector;
|
||||
|
||||
@ -146,7 +146,7 @@ function _injectorBindings(appComponentType): List<Type | Binding | List<any>> {
|
||||
PipeResolver,
|
||||
Parser,
|
||||
Lexer,
|
||||
bind(ExceptionHandler).toFactory(() => new ExceptionHandler(DOM, isDart ? false : true), []),
|
||||
EXCEPTION_BINDING,
|
||||
bind(XHR).toValue(new XHRImpl()),
|
||||
ComponentUrlMapper,
|
||||
UrlResolver,
|
||||
|
10
modules/angular2/src/core/platform_bindings.dart
Normal file
10
modules/angular2/src/core/platform_bindings.dart
Normal file
@ -0,0 +1,10 @@
|
||||
library angular2.platform_bindings;
|
||||
|
||||
|
||||
import 'package:angular2/di.dart';
|
||||
import './exception_handler.dart';
|
||||
import 'package:angular2/src/dom/dom_adapter.dart';
|
||||
|
||||
exceptionFactory() => new ExceptionHandler(DOM, true);
|
||||
|
||||
const EXCEPTION_BINDING = const Binding(ExceptionHandler, toFactory: exceptionFactory, deps: const []);
|
6
modules/angular2/src/core/platform_bindings.ts
Normal file
6
modules/angular2/src/core/platform_bindings.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import {bind} from 'angular2/di';
|
||||
import {ExceptionHandler} from './exception_handler';
|
||||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||
|
||||
export const EXCEPTION_BINDING =
|
||||
bind(ExceptionHandler).toFactory(() => new ExceptionHandler(DOM, false), []);
|
@ -5,8 +5,6 @@ import 'dart:math' as math;
|
||||
import 'dart:convert' as convert;
|
||||
import 'dart:async' show Future;
|
||||
|
||||
bool isDart = true;
|
||||
|
||||
String getTypeNameForDebugging(Type type) => type.toString();
|
||||
|
||||
class Math {
|
||||
|
@ -15,8 +15,6 @@ export function getTypeNameForDebugging(type: Type): string {
|
||||
return type['name'];
|
||||
}
|
||||
|
||||
export var isDart = false;
|
||||
|
||||
export class BaseException extends Error {
|
||||
stack;
|
||||
constructor(public message?: string, private _originalException?, private _originalStack?,
|
||||
|
@ -28,8 +28,6 @@ import 'package:angular2/src/facade/collection.dart' show StringMapWrapper;
|
||||
import 'test_injector.dart';
|
||||
export 'test_injector.dart' show inject;
|
||||
|
||||
bool IS_DARTIUM = true;
|
||||
|
||||
List _testBindings = [];
|
||||
Injector _injector;
|
||||
bool _isCurrentTestAsync;
|
||||
|
@ -33,9 +33,6 @@ export interface NgMatchers extends jasmine.Matchers {
|
||||
|
||||
export var expect: (actual: any) => NgMatchers = <any>_global.expect;
|
||||
|
||||
// TODO vsavkin: remove it and use lang/isDart instead
|
||||
export var IS_DARTIUM = false;
|
||||
|
||||
export class AsyncTestCompleter {
|
||||
_done: Function;
|
||||
|
||||
|
Reference in New Issue
Block a user