From b7837389d7469716fc6653f65d577468d8561b4b Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 11 Aug 2015 14:00:54 -0700 Subject: [PATCH] refactor: Remove isDart from public API BREAKING CHANGE: - `IS_DARTIUM` no longer exported --- .../angular2/src/core/application_common.ts | 6 +++--- .../angular2/src/core/platform_bindings.dart | 10 ++++++++++ .../angular2/src/core/platform_bindings.ts | 6 ++++++ modules/angular2/src/facade/lang.dart | 2 -- modules/angular2/src/facade/lang.ts | 2 -- modules/angular2/src/test_lib/test_lib.dart | 2 -- modules/angular2/src/test_lib/test_lib.ts | 3 --- .../change_detection/change_detector_spec.ts | 19 +++++-------------- .../change_detection/parser/parser_spec.ts | 5 +++-- .../angular2/test/core/application_spec.ts | 8 ++++---- .../test/core/compiler/compiler_spec.ts | 1 - .../core/compiler/directive_lifecycle_spec.ts | 1 - .../test/core/compiler/integration_spec.ts | 6 +++--- .../compiler/projection_integration_spec.ts | 1 - .../core/compiler/proto_view_factory_spec.ts | 1 - .../directive_lifecycle_integration_spec.ts | 3 +-- .../test/core/exception_handler_spec.ts | 3 +-- .../angular2/test/debug/debug_element_spec.ts | 1 - .../debug/debug_element_view_listener_spec.ts | 7 ++----- .../angular2/test/directives/ng_if_spec.ts | 6 +++--- modules/angular2/test/facade/async_spec.ts | 3 +-- modules/angular2/test/pipes/json_pipe_spec.ts | 3 +-- modules/angular2/test/platform.dart | 3 +++ modules/angular2/test/platform.ts | 1 + .../test/reflection/reflector_spec.ts | 5 +++-- .../dom/compiler/compiler_common_tests.ts | 1 - .../dom_element_schema_registry_spec.ts | 6 +++--- .../dom/view/proto_view_builder_spec.ts | 6 +++--- modules/angular2/test/render/xhr_mock_spec.ts | 1 - .../test/router/route_registry_spec.ts | 6 +++--- .../angular2/test/router/router_link_spec.ts | 1 - .../angular2/test/test_lib/fake_async_spec.ts | 1 - .../test_lib/test_component_builder_spec.ts | 1 - tools/transpiler/spec/interfaces_spec.js | 2 +- tools/transpiler/spec/types_spec.js | 2 +- 35 files changed, 61 insertions(+), 74 deletions(-) create mode 100644 modules/angular2/src/core/platform_bindings.dart create mode 100644 modules/angular2/src/core/platform_bindings.ts create mode 100644 modules/angular2/test/platform.dart create mode 100644 modules/angular2/test/platform.ts diff --git a/modules/angular2/src/core/application_common.ts b/modules/angular2/src/core/application_common.ts index 463e1f4715..0e632c3b07 100644 --- a/modules/angular2/src/core/application_common.ts +++ b/modules/angular2/src/core/application_common.ts @@ -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> { PipeResolver, Parser, Lexer, - bind(ExceptionHandler).toFactory(() => new ExceptionHandler(DOM, isDart ? false : true), []), + EXCEPTION_BINDING, bind(XHR).toValue(new XHRImpl()), ComponentUrlMapper, UrlResolver, diff --git a/modules/angular2/src/core/platform_bindings.dart b/modules/angular2/src/core/platform_bindings.dart new file mode 100644 index 0000000000..f85c4cf196 --- /dev/null +++ b/modules/angular2/src/core/platform_bindings.dart @@ -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 []); diff --git a/modules/angular2/src/core/platform_bindings.ts b/modules/angular2/src/core/platform_bindings.ts new file mode 100644 index 0000000000..5b462bb053 --- /dev/null +++ b/modules/angular2/src/core/platform_bindings.ts @@ -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), []); diff --git a/modules/angular2/src/facade/lang.dart b/modules/angular2/src/facade/lang.dart index 41be6fbde6..c561285437 100644 --- a/modules/angular2/src/facade/lang.dart +++ b/modules/angular2/src/facade/lang.dart @@ -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 { diff --git a/modules/angular2/src/facade/lang.ts b/modules/angular2/src/facade/lang.ts index 686800f349..7714db62fd 100644 --- a/modules/angular2/src/facade/lang.ts +++ b/modules/angular2/src/facade/lang.ts @@ -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?, diff --git a/modules/angular2/src/test_lib/test_lib.dart b/modules/angular2/src/test_lib/test_lib.dart index fa101c2928..13fbf2267a 100644 --- a/modules/angular2/src/test_lib/test_lib.dart +++ b/modules/angular2/src/test_lib/test_lib.dart @@ -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; diff --git a/modules/angular2/src/test_lib/test_lib.ts b/modules/angular2/src/test_lib/test_lib.ts index 51b0845f53..8ec2dbaed5 100644 --- a/modules/angular2/src/test_lib/test_lib.ts +++ b/modules/angular2/src/test_lib/test_lib.ts @@ -33,9 +33,6 @@ export interface NgMatchers extends jasmine.Matchers { export var expect: (actual: any) => NgMatchers = _global.expect; -// TODO vsavkin: remove it and use lang/isDart instead -export var IS_DARTIUM = false; - export class AsyncTestCompleter { _done: Function; diff --git a/modules/angular2/test/change_detection/change_detector_spec.ts b/modules/angular2/test/change_detection/change_detector_spec.ts index f49dba5d97..7e2fa901fe 100644 --- a/modules/angular2/test/change_detection/change_detector_spec.ts +++ b/modules/angular2/test/change_detection/change_detector_spec.ts @@ -1,15 +1,5 @@ /// -import { - ddescribe, - describe, - it, - iit, - xit, - expect, - beforeEach, - afterEach, - IS_DARTIUM -} from 'angular2/test_lib'; +import {ddescribe, describe, it, iit, xit, expect, beforeEach, afterEach} from 'angular2/test_lib'; import { CONST_EXPR, @@ -51,6 +41,7 @@ import {JitProtoChangeDetector} from 'angular2/src/change_detection/jit_proto_ch import {getDefinition} from './change_detector_config'; import {getFactoryById} from './generated/change_detector_classes'; +import {IS_DART} from '../platform'; const _DEFAULT_CONTEXT = CONST_EXPR(new Object()); @@ -68,8 +59,8 @@ const _DEFAULT_CONTEXT = CONST_EXPR(new Object()); */ export function main() { ListWrapper.forEach(['dynamic', 'JIT', 'Pregen'], (cdType) => { - if (cdType == "JIT" && IS_DARTIUM) return; - if (cdType == "Pregen" && !IS_DARTIUM) return; + if (cdType == "JIT" && IS_DART) return; + if (cdType == "Pregen" && !IS_DART) return; describe(`${cdType} Change Detector`, () => { @@ -141,7 +132,7 @@ export function main() { () => { expect(_bindSimpleValue('1 != 1')).toEqual(['propName=false']); }); it('should support == operations on coerceible', () => { - var expectedValue = IS_DARTIUM ? 'false' : 'true'; + var expectedValue = IS_DART ? 'false' : 'true'; expect(_bindSimpleValue('1 == true')).toEqual([`propName=${expectedValue}`]); }); diff --git a/modules/angular2/test/change_detection/parser/parser_spec.ts b/modules/angular2/test/change_detection/parser/parser_spec.ts index 7e45890954..c8cb3de5f4 100644 --- a/modules/angular2/test/change_detection/parser/parser_spec.ts +++ b/modules/angular2/test/change_detection/parser/parser_spec.ts @@ -1,4 +1,4 @@ -import {ddescribe, describe, it, xit, iit, expect, beforeEach, IS_DARTIUM} from 'angular2/test_lib'; +import {ddescribe, describe, it, xit, iit, expect, beforeEach} from 'angular2/test_lib'; import {BaseException, isBlank, isPresent} from 'angular2/src/facade/lang'; import {reflector} from 'angular2/src/reflection/reflection'; import {MapWrapper, ListWrapper} from 'angular2/src/facade/collection'; @@ -7,6 +7,7 @@ import {Unparser} from './unparser'; import {Lexer} from 'angular2/src/change_detection/parser/lexer'; import {Locals} from 'angular2/src/change_detection/parser/locals'; import {BindingPipe, LiteralPrimitive, AST} from 'angular2/src/change_detection/parser/ast'; +import {IS_DART} from '../../platform'; class TestData { constructor(public a?: any, public b?: any, public fnReturnValue?: any) {} @@ -224,7 +225,7 @@ export function main() { expect(() => { expectEval('null?.a.a', td()).toEqual(null); }).toThrowError(); }); - if (!IS_DARTIUM) { + if (!IS_DART) { it('should return null when accessing a field on undefined', () => { expect(() => { expectEval('_undefined?.a', td()).toEqual(null); }).not.toThrow(); }); diff --git a/modules/angular2/test/core/application_spec.ts b/modules/angular2/test/core/application_spec.ts index 1ea034951a..62f127a188 100644 --- a/modules/angular2/test/core/application_spec.ts +++ b/modules/angular2/test/core/application_spec.ts @@ -8,8 +8,7 @@ import { inject, it, xdescribe, - xit, - IS_DARTIUM + xit } from 'angular2/test_lib'; import {isPresent, stringify} from 'angular2/src/facade/lang'; import {bootstrap, ApplicationRef} from 'angular2/src/core/application'; @@ -21,6 +20,7 @@ import {LifeCycle} from 'angular2/core'; import {ExceptionHandler} from 'angular2/src/core/exception_handler'; import {Testability, TestabilityRegistry} from 'angular2/src/core/testability/testability'; import {DOCUMENT} from 'angular2/src/render/render'; +import {IS_DART} from '../platform'; @Component({selector: 'hello-app'}) @View({template: '{{greeting}} world!'}) @@ -109,7 +109,7 @@ export function main() { it('should throw if no element is found', inject([AsyncTestCompleter], (async) => { var logger = new _ArrayLogger(); - var exceptionHandler = new ExceptionHandler(logger, IS_DARTIUM ? false : true); + var exceptionHandler = new ExceptionHandler(logger, IS_DART ? false : true); var refPromise = bootstrap(HelloRootCmp, [bind(ExceptionHandler).toValue(exceptionHandler)]); @@ -124,7 +124,7 @@ export function main() { it('should invoke the default exception handler when bootstrap fails', inject([AsyncTestCompleter], (async) => { var logger = new _ArrayLogger(); - var exceptionHandler = new ExceptionHandler(logger, IS_DARTIUM ? false : true); + var exceptionHandler = new ExceptionHandler(logger, IS_DART ? false : true); var refPromise = bootstrap(HelloRootCmp, [bind(ExceptionHandler).toValue(exceptionHandler)]); diff --git a/modules/angular2/test/core/compiler/compiler_spec.ts b/modules/angular2/test/core/compiler/compiler_spec.ts index 2a8b24ff0d..2bca4bd222 100644 --- a/modules/angular2/test/core/compiler/compiler_spec.ts +++ b/modules/angular2/test/core/compiler/compiler_spec.ts @@ -8,7 +8,6 @@ import { expect, iit, inject, - IS_DARTIUM, it, SpyObject, proxy diff --git a/modules/angular2/test/core/compiler/directive_lifecycle_spec.ts b/modules/angular2/test/core/compiler/directive_lifecycle_spec.ts index 2b0d387b53..55830087dd 100644 --- a/modules/angular2/test/core/compiler/directive_lifecycle_spec.ts +++ b/modules/angular2/test/core/compiler/directive_lifecycle_spec.ts @@ -8,7 +8,6 @@ import { expect, iit, inject, - IS_DARTIUM, it, SpyObject, proxy diff --git a/modules/angular2/test/core/compiler/integration_spec.ts b/modules/angular2/test/core/compiler/integration_spec.ts index f9acb04764..92ff03894f 100644 --- a/modules/angular2/test/core/compiler/integration_spec.ts +++ b/modules/angular2/test/core/compiler/integration_spec.ts @@ -9,7 +9,6 @@ import { expect, iit, inject, - IS_DARTIUM, beforeEachBindings, it, xit, @@ -78,6 +77,7 @@ import {ElementRef} from 'angular2/src/core/compiler/element_ref'; import {TemplateRef} from 'angular2/src/core/compiler/template_ref'; import {DomRenderer} from 'angular2/src/render/dom/dom_renderer'; +import {IS_DART} from '../../platform'; const ANCHOR_ELEMENT = CONST_EXPR(new OpaqueToken('AnchorElement')); @@ -1330,7 +1330,7 @@ export function main() { }))); } - if (!IS_DARTIUM) { + if (!IS_DART) { it('should report a meaningful error when a directive is undefined', inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { @@ -1431,7 +1431,7 @@ export function main() { })); describe('Property bindings', () => { - if (!IS_DARTIUM) { + if (!IS_DART) { it('should throw on bindings to unknown properties', inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { diff --git a/modules/angular2/test/core/compiler/projection_integration_spec.ts b/modules/angular2/test/core/compiler/projection_integration_spec.ts index 7546e7eb95..87164e46d7 100644 --- a/modules/angular2/test/core/compiler/projection_integration_spec.ts +++ b/modules/angular2/test/core/compiler/projection_integration_spec.ts @@ -9,7 +9,6 @@ import { expect, iit, inject, - IS_DARTIUM, beforeEachBindings, it, xit, diff --git a/modules/angular2/test/core/compiler/proto_view_factory_spec.ts b/modules/angular2/test/core/compiler/proto_view_factory_spec.ts index 3d7934eb1c..8839366038 100644 --- a/modules/angular2/test/core/compiler/proto_view_factory_spec.ts +++ b/modules/angular2/test/core/compiler/proto_view_factory_spec.ts @@ -8,7 +8,6 @@ import { expect, iit, inject, - IS_DARTIUM, it, SpyObject, proxy diff --git a/modules/angular2/test/core/directive_lifecycle_integration_spec.ts b/modules/angular2/test/core/directive_lifecycle_integration_spec.ts index c78f5928c7..7d1884b352 100644 --- a/modules/angular2/test/core/directive_lifecycle_integration_spec.ts +++ b/modules/angular2/test/core/directive_lifecycle_integration_spec.ts @@ -9,8 +9,7 @@ import { it, xdescribe, xit, - TestComponentBuilder, - IS_DARTIUM + TestComponentBuilder } from 'angular2/test_lib'; import {Directive, Component, View, LifecycleEvent} from 'angular2/angular2'; diff --git a/modules/angular2/test/core/exception_handler_spec.ts b/modules/angular2/test/core/exception_handler_spec.ts index 75c77b1af1..d096f11f5c 100644 --- a/modules/angular2/test/core/exception_handler_spec.ts +++ b/modules/angular2/test/core/exception_handler_spec.ts @@ -9,7 +9,6 @@ import { it, xdescribe, xit, - IS_DARTIUM, Log } from 'angular2/test_lib'; import {BaseException} from 'angular2/src/facade/lang'; @@ -91,4 +90,4 @@ export function main() { }); }); }); -} \ No newline at end of file +} diff --git a/modules/angular2/test/debug/debug_element_spec.ts b/modules/angular2/test/debug/debug_element_spec.ts index 0dff4d5625..d0462c1b83 100644 --- a/modules/angular2/test/debug/debug_element_spec.ts +++ b/modules/angular2/test/debug/debug_element_spec.ts @@ -8,7 +8,6 @@ import { expect, iit, inject, - IS_DARTIUM, beforeEachBindings, it, xit, diff --git a/modules/angular2/test/debug/debug_element_view_listener_spec.ts b/modules/angular2/test/debug/debug_element_view_listener_spec.ts index 3edd874da6..827ac5d83e 100644 --- a/modules/angular2/test/debug/debug_element_view_listener_spec.ts +++ b/modules/angular2/test/debug/debug_element_view_listener_spec.ts @@ -8,7 +8,6 @@ import { expect, iit, inject, - IS_DARTIUM, beforeEachBindings, it, xit, @@ -17,17 +16,15 @@ import { Scope, inspectNativeElement } from 'angular2/test_lib'; - import {global} from 'angular2/src/facade/lang'; import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool'; - import {Injectable, bind} from 'angular2/di'; - import { Directive, Component, View, } from 'angular2/annotations'; +import {IS_DART} from '../platform'; @Component({selector: 'my-comp'}) @View({directives: []}) @@ -65,7 +62,7 @@ export function main() { })); - if (!IS_DARTIUM) { + if (!IS_DART) { it('should provide a global function to inspect elements', inject([TestComponentBuilder, AsyncTestCompleter], (tcb, async) => { tcb.overrideTemplate(MyComp, '') diff --git a/modules/angular2/test/directives/ng_if_spec.ts b/modules/angular2/test/directives/ng_if_spec.ts index 7266ea8115..9f05fd3af5 100644 --- a/modules/angular2/test/directives/ng_if_spec.ts +++ b/modules/angular2/test/directives/ng_if_spec.ts @@ -9,7 +9,6 @@ import { expect, iit, inject, - IS_DARTIUM, it, xit, } from 'angular2/test_lib'; @@ -19,6 +18,7 @@ import {DOM} from 'angular2/src/dom/dom_adapter'; import {Component, View} from 'angular2/angular2'; import {NgIf} from 'angular2/src/directives/ng_if'; +import {IS_DART} from '../platform'; export function main() { describe('ng-if directive', () => { @@ -146,7 +146,7 @@ export function main() { })); - if (!IS_DARTIUM) { + if (!IS_DART) { it('should not add the element twice if the condition goes from true to true (JS)', inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { var html = '
hello
'; @@ -187,7 +187,7 @@ export function main() { })); } - if (IS_DARTIUM) { + if (IS_DART) { it('should not create the element if the condition is not a boolean (DART)', inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { var html = '
hello
'; diff --git a/modules/angular2/test/facade/async_spec.ts b/modules/angular2/test/facade/async_spec.ts index 79ac9294c7..5af01f45e5 100644 --- a/modules/angular2/test/facade/async_spec.ts +++ b/modules/angular2/test/facade/async_spec.ts @@ -9,8 +9,7 @@ import { el, SpyObject, AsyncTestCompleter, - inject, - IS_DARTIUM + inject } from 'angular2/test_lib'; import {ObservableWrapper, EventEmitter, PromiseWrapper} from 'angular2/src/facade/async'; diff --git a/modules/angular2/test/pipes/json_pipe_spec.ts b/modules/angular2/test/pipes/json_pipe_spec.ts index 386a2ddf70..001643ad6f 100644 --- a/modules/angular2/test/pipes/json_pipe_spec.ts +++ b/modules/angular2/test/pipes/json_pipe_spec.ts @@ -10,8 +10,7 @@ import { AsyncTestCompleter, inject, proxy, - SpyObject, - IS_DARTIUM + SpyObject } from 'angular2/test_lib'; import {Json, RegExp, NumberWrapper, StringWrapper} from 'angular2/src/facade/lang'; diff --git a/modules/angular2/test/platform.dart b/modules/angular2/test/platform.dart new file mode 100644 index 0000000000..0f2dd598d0 --- /dev/null +++ b/modules/angular2/test/platform.dart @@ -0,0 +1,3 @@ +library angular2.test.platform; + +const IS_DART = true; diff --git a/modules/angular2/test/platform.ts b/modules/angular2/test/platform.ts new file mode 100644 index 0000000000..f4af29fa63 --- /dev/null +++ b/modules/angular2/test/platform.ts @@ -0,0 +1 @@ +export const IS_DART = false; diff --git a/modules/angular2/test/reflection/reflector_spec.ts b/modules/angular2/test/reflection/reflector_spec.ts index 7e6a8d8689..c2839088f1 100644 --- a/modules/angular2/test/reflection/reflector_spec.ts +++ b/modules/angular2/test/reflection/reflector_spec.ts @@ -1,8 +1,9 @@ -import {describe, it, iit, ddescribe, expect, beforeEach, IS_DARTIUM} from 'angular2/test_lib'; +import {describe, it, iit, ddescribe, expect, beforeEach} from 'angular2/test_lib'; import {Reflector, ReflectionInfo} from 'angular2/src/reflection/reflection'; import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities'; import {ClassDecorator, ParamDecorator, classDecorator, paramDecorator} from './reflector_common'; import {List} from 'angular2/src/facade/collection'; +import {IS_DART} from '../platform'; class AType { value; @@ -132,7 +133,7 @@ export function main() { }); }); - if (IS_DARTIUM) { + if (IS_DART) { describe("interfaces", () => { it("should return an array of interfaces for a type", () => { var p = reflector.interfaces(ClassImplementingInterface); diff --git a/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts b/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts index b24d97fe9c..5956044ea0 100644 --- a/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts +++ b/modules/angular2/test/render/dom/compiler/compiler_common_tests.ts @@ -7,7 +7,6 @@ import { expect, iit, inject, - IS_DARTIUM, it, } from 'angular2/test_lib'; diff --git a/modules/angular2/test/render/dom/schema/dom_element_schema_registry_spec.ts b/modules/angular2/test/render/dom/schema/dom_element_schema_registry_spec.ts index d501a0ede0..c84c1000ae 100644 --- a/modules/angular2/test/render/dom/schema/dom_element_schema_registry_spec.ts +++ b/modules/angular2/test/render/dom/schema/dom_element_schema_registry_spec.ts @@ -7,9 +7,9 @@ import { iit, inject, it, - xit, - IS_DARTIUM + xit } from 'angular2/test_lib'; +import {IS_DART} from '../../../platform'; import {DomElementSchemaRegistry} from 'angular2/src/render/dom/schema/dom_element_schema_registry'; import {DOM} from 'angular2/src/dom/dom_adapter'; @@ -17,7 +17,7 @@ import {DOM} from 'angular2/src/dom/dom_adapter'; export function main() { // DOMElementSchema can only be used on the JS side where we can safely // use reflection for DOM elements - if (IS_DARTIUM) return; + if (IS_DART) return; var registry; diff --git a/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts b/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts index 9ba61e31ed..067b859e2c 100644 --- a/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts +++ b/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts @@ -7,8 +7,7 @@ import { xdescribe, expect, beforeEach, - el, - IS_DARTIUM + el } from 'angular2/test_lib'; import {DomElementSchemaRegistry} from 'angular2/src/render/dom/schema/dom_element_schema_registry'; @@ -17,6 +16,7 @@ import {ProtoViewBuilder} from 'angular2/src/render/dom/view/proto_view_builder' import {ASTWithSource, AST} from 'angular2/src/change_detection/change_detection'; import {PropertyBindingType, ViewType, ViewEncapsulation} from 'angular2/src/render/api'; import {DOM} from 'angular2/src/dom/dom_adapter'; +import {IS_DART} from '../../../platform'; export function main() { function emptyExpr() { return new ASTWithSource(new AST(), 'empty', 'empty'); } @@ -30,7 +30,7 @@ export function main() { new ProtoViewBuilder(DOM.createTemplate(''), ViewType.EMBEDDED, ViewEncapsulation.NONE); }); - if (!IS_DARTIUM) { + if (!IS_DART) { describe('verification of properties', () => { it('should throw for unknown properties', () => { diff --git a/modules/angular2/test/render/xhr_mock_spec.ts b/modules/angular2/test/render/xhr_mock_spec.ts index 2eed4482fa..25c799f029 100644 --- a/modules/angular2/test/render/xhr_mock_spec.ts +++ b/modules/angular2/test/render/xhr_mock_spec.ts @@ -7,7 +7,6 @@ import { expect, iit, inject, - IS_DARTIUM, it, } from 'angular2/test_lib'; import {MockXHR} from 'angular2/src/render/xhr_mock'; diff --git a/modules/angular2/test/router/route_registry_spec.ts b/modules/angular2/test/router/route_registry_spec.ts index 43ae784cca..bdf9f8303e 100644 --- a/modules/angular2/test/router/route_registry_spec.ts +++ b/modules/angular2/test/router/route_registry_spec.ts @@ -7,8 +7,7 @@ import { expect, inject, beforeEach, - SpyObject, - IS_DARTIUM + SpyObject } from 'angular2/test_lib'; import {Promise, PromiseWrapper} from 'angular2/src/facade/async'; @@ -17,6 +16,7 @@ import {Type} from 'angular2/src/facade/lang'; import {RouteRegistry} from 'angular2/src/router/route_registry'; import {RouteConfig, Route, AuxRoute, AsyncRoute} from 'angular2/src/router/route_config_decorator'; import {stringifyInstruction} from 'angular2/src/router/instruction'; +import {IS_DART} from '../platform'; export function main() { describe('RouteRegistry', () => { @@ -195,7 +195,7 @@ export function main() { .toThrowError('Component for route "/" is not defined, or is not a class.'); // This would never happen in Dart - if (!IS_DARTIUM) { + if (!IS_DART) { expect(() => registry.config(RootHostCmp, new Route({path: '/', component:(4)}))) .toThrowError('Component for route "/" is not defined, or is not a class.'); } diff --git a/modules/angular2/test/router/router_link_spec.ts b/modules/angular2/test/router/router_link_spec.ts index bc74c40f0b..c525aee39d 100644 --- a/modules/angular2/test/router/router_link_spec.ts +++ b/modules/angular2/test/router/router_link_spec.ts @@ -8,7 +8,6 @@ import { expect, iit, inject, - IS_DARTIUM, beforeEachBindings, it, xit, diff --git a/modules/angular2/test/test_lib/fake_async_spec.ts b/modules/angular2/test/test_lib/fake_async_spec.ts index f7889ff00c..ea751e9229 100644 --- a/modules/angular2/test/test_lib/fake_async_spec.ts +++ b/modules/angular2/test/test_lib/fake_async_spec.ts @@ -8,7 +8,6 @@ import { flushMicrotasks, iit, inject, - IS_DARTIUM, it, Log, tick, diff --git a/modules/angular2/test/test_lib/test_component_builder_spec.ts b/modules/angular2/test/test_lib/test_component_builder_spec.ts index 5a15f1216f..328ed25450 100644 --- a/modules/angular2/test/test_lib/test_component_builder_spec.ts +++ b/modules/angular2/test/test_lib/test_component_builder_spec.ts @@ -8,7 +8,6 @@ import { expect, iit, inject, - IS_DARTIUM, beforeEachBindings, it, xit, diff --git a/tools/transpiler/spec/interfaces_spec.js b/tools/transpiler/spec/interfaces_spec.js index 0186bd0884..5b695f6c5e 100644 --- a/tools/transpiler/spec/interfaces_spec.js +++ b/tools/transpiler/spec/interfaces_spec.js @@ -1,4 +1,4 @@ -import {ddescribe, describe, it, iit, expect, IS_DARTIUM} from 'angular2/test_lib'; +import {ddescribe, describe, it, iit, expect} from 'angular2/test_lib'; import {IMPLEMENTS} from './fixtures/annotations'; class Interface1 { diff --git a/tools/transpiler/spec/types_spec.js b/tools/transpiler/spec/types_spec.js index 9ad2927773..08dbb60234 100644 --- a/tools/transpiler/spec/types_spec.js +++ b/tools/transpiler/spec/types_spec.js @@ -1,4 +1,4 @@ -import {describe, xdescribe, it, expect, IS_DARTIUM} from 'angular2/test_lib'; +import {describe, xdescribe, it, expect} from 'angular2/test_lib'; class A {} class B {}