refactor(core): move facades out of core

This is part of ongoing work to make core platform-independent.

BREAKING CHANGE

All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
This commit is contained in:
vsavkin
2015-11-06 17:34:07 -08:00
committed by Victor Savkin
parent 3593d85807
commit 79472b77ca
451 changed files with 823 additions and 979 deletions
@@ -10,15 +10,15 @@ import {
xdescribe,
xit
} from 'angular2/testing_internal';
import {IS_DART, isPresent, stringify} from 'angular2/src/core/facade/lang';
import {IS_DART, isPresent, stringify} from 'angular2/src/facade/lang';
import {bootstrap} from 'angular2/bootstrap';
import {ApplicationRef} from 'angular2/src/core/application_ref';
import {Component, Directive, View} from 'angular2/core';
import {DOM} from 'angular2/src/core/dom/dom_adapter';
import {DOCUMENT} from 'angular2/render';
import {PromiseWrapper} from 'angular2/src/core/facade/async';
import {PromiseWrapper} from 'angular2/src/facade/async';
import {provide, Inject, Injector} from 'angular2/core';
import {ExceptionHandler} from 'angular2/src/core/facade/exceptions';
import {ExceptionHandler} from 'angular2/src/facade/exceptions';
import {Testability, TestabilityRegistry} from 'angular2/src/core/testability/testability';
import {ComponentRef_} from "angular2/src/core/linker/dynamic_component_loader";
@@ -1,5 +1,5 @@
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {isBlank, isPresent} from 'angular2/src/core/facade/lang';
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
import {isBlank, isPresent} from 'angular2/src/facade/lang';
import {
ChangeDetectionStrategy,
BindingRecord,
@@ -22,9 +22,9 @@ import {
FunctionWrapper,
NumberWrapper,
normalizeBool
} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {MapWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
import {
ChangeDispatcher,
@@ -52,7 +52,7 @@ import {JitProtoChangeDetector} from 'angular2/src/core/change_detection/jit_pro
import {getDefinition} from './change_detector_config';
import {createObservableModel} from './change_detector_spec_util';
import {getFactoryById} from './generated/change_detector_classes';
import {IS_DART} from 'angular2/src/core/facade/lang';
import {IS_DART} from 'angular2/src/facade/lang';
const _DEFAULT_CONTEXT = CONST_EXPR(new Object());
@@ -8,7 +8,7 @@ import {
beforeEach,
afterEach
} from 'angular2/testing_internal';
import {isBlank} from 'angular2/src/core/facade/lang';
import {isBlank} from 'angular2/src/facade/lang';
import {coalesce} from 'angular2/src/core/change_detection/coalesce';
import {RecordType, ProtoRecord} from 'angular2/src/core/change_detection/proto_record';
@@ -13,8 +13,8 @@ import {
DefaultIterableDifferFactory
} from 'angular2/src/core/change_detection/differs/default_iterable_differ';
import {NumberWrapper} from 'angular2/src/core/facade/lang';
import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
import {NumberWrapper} from 'angular2/src/facade/lang';
import {ListWrapper, MapWrapper} from 'angular2/src/facade/collection';
import {TestIterable} from '../../../core/change_detection/iterable';
import {iterableChangesAsString} from '../../../core/change_detection/util';
@@ -12,7 +12,7 @@ import {
DefaultKeyValueDiffer,
DefaultKeyValueDifferFactory
} from 'angular2/src/core/change_detection/differs/default_keyvalue_differ';
import {NumberWrapper, isJsObject} from 'angular2/src/core/facade/lang';
import {NumberWrapper, isJsObject} from 'angular2/src/facade/lang';
import {kvChangesAsString} from '../../../core/change_detection/util';
// todo(vicb): Update the code & tests for object equality
@@ -1,4 +1,4 @@
import {getSymbolIterator} from 'angular2/src/core/facade/lang';
import {getSymbolIterator} from 'angular2/src/facade/lang';
export class TestIterable {
list: number[];
@@ -2,7 +2,7 @@ import {ddescribe, describe, it, expect} from 'angular2/testing_internal';
import {Lexer, Token} from 'angular2/src/core/change_detection/parser/lexer';
import {StringWrapper} from "angular2/src/core/facade/lang";
import {StringWrapper} from "angular2/src/facade/lang";
function lex(text: string): any[] {
return new Lexer().tokenize(text);
@@ -2,7 +2,7 @@ import {ddescribe, describe, it, xit, iit, expect, beforeEach} from 'angular2/te
import {Locals} from 'angular2/src/core/change_detection/parser/locals';
import {MapWrapper} from 'angular2/src/core/facade/collection';
import {MapWrapper} from 'angular2/src/facade/collection';
export function main() {
describe('Locals', () => {
@@ -1,5 +1,5 @@
import {ddescribe, describe, it, xit, iit, expect, beforeEach} from 'angular2/testing_internal';
import {isBlank, isPresent} from 'angular2/src/core/facade/lang';
import {isBlank, isPresent} from 'angular2/src/facade/lang';
import {reflector} from 'angular2/src/core/reflection/reflection';
import {Parser} from 'angular2/src/core/change_detection/parser/parser';
import {Unparser} from './unparser';
@@ -23,7 +23,7 @@ import {
} from 'angular2/src/core/change_detection/parser/ast';
import {StringWrapper, isPresent, isString} from 'angular2/src/core/facade/lang';
import {StringWrapper, isPresent, isString} from 'angular2/src/facade/lang';
export class Unparser implements AstVisitor {
private static _quoteRegExp = /"/g;
@@ -8,7 +8,7 @@ import {
beforeEach,
afterEach
} from 'angular2/testing_internal';
import {isBlank} from 'angular2/src/core/facade/lang';
import {isBlank} from 'angular2/src/facade/lang';
import {RecordType, ProtoRecord} from 'angular2/src/core/change_detection/proto_record';
@@ -1,4 +1,4 @@
import {isBlank, CONST_EXPR} from 'angular2/src/core/facade/lang';
import {isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
export function iterableChangesAsString({collection = CONST_EXPR([]), previous = CONST_EXPR([]),
additions = CONST_EXPR([]), moves = CONST_EXPR([]),
@@ -16,7 +16,7 @@ import {
import {DOM} from 'angular2/src/core/dom/dom_adapter';
import {PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async';
import {PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {Injectable, NgFor, NgIf} from 'angular2/core';
import {By, Scope} from 'angular2/src/core/debug';
@@ -13,11 +13,11 @@ import {
xit,
TestComponentBuilder,
} from 'angular2/testing_internal';
import {global} from 'angular2/src/core/facade/lang';
import {global} from 'angular2/src/facade/lang';
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/linker/view_pool';
import {provide, Component, Directive, Injectable, View} from 'angular2/core';
import {inspectNativeElement} from 'angular2/src/core/debug';
import {IS_DART} from 'angular2/src/core/facade/lang';
import {IS_DART} from 'angular2/src/facade/lang';
@Component({selector: 'my-comp'})
@View({directives: []})
@@ -10,7 +10,7 @@ import {
xit,
} from 'angular2/testing_internal';
import {forwardRef, resolveForwardRef} from 'angular2/core';
import {Type} from 'angular2/src/core/facade/lang';
import {Type} from 'angular2/src/facade/lang';
export function main() {
describe("forwardRef", function() {
@@ -1,5 +1,5 @@
import {isBlank, stringify} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {isBlank, stringify} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {describe, ddescribe, it, iit, expect, beforeEach} from 'angular2/testing_internal';
import {SpyDependencyProvider} from '../spies';
import {
@@ -2,7 +2,7 @@
library angular2.test.facade.async_dart_spec;
import 'package:angular2/testing_internal.dart';
import 'package:angular2/src/core/facade/async.dart';
import 'package:angular2/src/facade/async.dart';
class MockException implements Error {
var message;
@@ -18,7 +18,7 @@ import {
Subject,
EventEmitter,
PromiseWrapper
} from 'angular2/src/core/facade/async';
} from 'angular2/src/facade/async';
export function main() {
describe('EventEmitter', () => {
@@ -1,6 +1,6 @@
import {describe, it, expect, beforeEach, ddescribe, iit, xit} from 'angular2/testing_internal';
import {ListWrapper, StringMapWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
import {ListWrapper, StringMapWrapper, MapWrapper} from 'angular2/src/facade/collection';
export function main() {
describe('ListWrapper', () => {
@@ -11,11 +11,7 @@ import {
xit,
Log
} from 'angular2/testing_internal';
import {
BaseException,
WrappedException,
ExceptionHandler
} from 'angular2/src/core/facade/exceptions';
import {BaseException, WrappedException, ExceptionHandler} from 'angular2/src/facade/exceptions';
class _CustomException {
context = "some context";
@@ -5,7 +5,7 @@ import {
RegExpMatcherWrapper,
StringWrapper,
CONST_EXPR
} from 'angular2/src/core/facade/lang';
} from 'angular2/src/facade/lang';
export function main() {
describe('RegExp', () => {
@@ -23,7 +23,7 @@ import {
QueryList,
View
} from 'angular2/core';
import {Type} from 'angular2/src/core/facade/lang';
import {Type} from 'angular2/src/facade/lang';
import {asNativeElements} from 'angular2/src/core/debug';
export function main() {
@@ -16,13 +16,13 @@ import {
containsRegexp
} from 'angular2/testing_internal';
import {SpyView, SpyElementRef} from '../spies';
import {isBlank, isPresent, stringify} from 'angular2/src/core/facade/lang';
import {isBlank, isPresent, stringify} from 'angular2/src/facade/lang';
import {
ListWrapper,
MapWrapper,
StringMapWrapper,
iterateListLike
} from 'angular2/src/core/facade/collection';
} from 'angular2/src/facade/collection';
import {
ProtoElementInjector,
ElementInjector,
@@ -33,15 +33,15 @@ import {
isBlank,
CONST,
CONST_EXPR
} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {
PromiseWrapper,
EventEmitter,
ObservableWrapper,
PromiseCompleter,
Promise
} from 'angular2/src/core/facade/async';
} from 'angular2/src/facade/async';
import {
Injector,
@@ -92,7 +92,7 @@ import {ElementRef} from 'angular2/src/core/linker/element_ref';
import {TemplateRef} from 'angular2/src/core/linker/template_ref';
import {DomRenderer} from 'angular2/src/core/render/dom/dom_renderer';
import {IS_DART} from 'angular2/src/core/facade/lang';
import {IS_DART} from 'angular2/src/facade/lang';
const ANCHOR_ELEMENT = CONST_EXPR(new OpaqueToken('AnchorElement'));
@@ -12,8 +12,8 @@ import {
TestComponentBuilder,
} from 'angular2/testing_internal';
import {isPresent} from 'angular2/src/core/facade/lang';
import {ObservableWrapper} from 'angular2/src/core/facade/async';
import {isPresent} from 'angular2/src/facade/lang';
import {ObservableWrapper} from 'angular2/src/facade/async';
import {
Component,
@@ -10,12 +10,17 @@ import {
fakeAsync,
tick
} from 'angular2/testing_internal';
import {MapWrapper, ListWrapper, iterateListLike} from 'angular2/src/core/facade/collection';
import {IS_DART, StringWrapper} from 'angular2/src/core/facade/lang';
import {ObservableWrapper} from 'angular2/src/core/facade/async';
import {MapWrapper, ListWrapper, iterateListLike} from 'angular2/src/facade/collection';
import {IS_DART, StringWrapper} from 'angular2/src/facade/lang';
import {ObservableWrapper} from 'angular2/src/facade/async';
import {QueryList} from 'angular2/src/core/linker/query_list';
import {DOM} from 'angular2/src/core/dom/dom_adapter';
interface _JsQueryList {
filter(c: any): any;
reduce(a: any, b: any): any;
toArray(): any;
}
export function main() {
describe('QueryList', () => {
@@ -48,22 +53,22 @@ export function main() {
if (!IS_DART) {
it('should support filter', () => {
queryList.reset(['one', 'two']);
expect((<any>queryList).filter((x) => x == "one")).toEqual(['one']);
expect((<_JsQueryList>queryList).filter((x) => x == "one")).toEqual(['one']);
});
it('should support reduce', () => {
queryList.reset(["one", "two"]);
expect((<any>queryList).reduce((a, x) => a + x, "start:")).toEqual("start:onetwo");
expect((<_JsQueryList>queryList).reduce((a, x) => a + x, "start:")).toEqual("start:onetwo");
});
it('should support toArray', () => {
queryList.reset(["one", "two"]);
expect((<any>queryList).reduce((a, x) => a + x, "start:")).toEqual("start:onetwo");
expect((<_JsQueryList>queryList).reduce((a, x) => a + x, "start:")).toEqual("start:onetwo");
});
it('should support toArray', () => {
queryList.reset(["one", "two"]);
expect((<any>queryList).toArray()).toEqual(["one", "two"]);
expect((<_JsQueryList>queryList).toArray()).toEqual(["one", "two"]);
});
}
@@ -24,7 +24,7 @@ import {
} from '../spies';
import {Injector, provide} from 'angular2/core';
import {isBlank, isPresent} from 'angular2/src/core/facade/lang';
import {isBlank, isPresent} from 'angular2/src/facade/lang';
import {
AppProtoView,
@@ -17,7 +17,7 @@ import {
} from 'angular2/testing_internal';
import {AppViewPool} from 'angular2/src/core/linker/view_pool';
import {AppProtoView, AppView} from 'angular2/src/core/linker/view';
import {MapWrapper, Map} from 'angular2/src/core/facade/collection';
import {MapWrapper, Map} from 'angular2/src/facade/collection';
export function main() {
describe('AppViewPool', () => {
@@ -18,7 +18,7 @@ import {
propDecorator,
HasGetterAndSetterDecorators
} from './reflector_common';
import {IS_DART} from 'angular2/src/core/facade/lang';
import {IS_DART} from 'angular2/src/facade/lang';
class AType {
value;
@@ -13,7 +13,7 @@ import {
SpyObject,
} from 'angular2/testing_internal';
// import {MapWrapper} from 'angular2/src/core/facade/collection';
// import {MapWrapper} from 'angular2/src/facade/collection';
// import {DOM} from 'angular2/src/core/dom/dom_adapter';
// import {DomTestbed, TestRootView, elRef} from './dom_testbed';
@@ -15,7 +15,7 @@ import {
DomEventsPlugin
} from 'angular2/src/core/render/dom/events/event_manager';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection';
import {ListWrapper, Map, MapWrapper} from 'angular2/src/facade/collection';
import {DOM} from 'angular2/src/core/dom/dom_adapter';
export function main() {
@@ -11,8 +11,8 @@ import {
stringifyElement
} from 'angular2/testing_internal';
import {isPresent} from 'angular2/src/core/facade/lang';
import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
import {isPresent} from 'angular2/src/facade/lang';
import {MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
import * as appCmds from 'angular2/src/core/linker/template_commands';
import {createRenderView, NodeFactory} from 'angular2/src/core/render/view_factory';
import {RenderTemplateCmd, RenderBeginElementCmd} from 'angular2/src/core/render/api';
@@ -13,8 +13,8 @@ import {
} from 'angular2/testing_internal';
import {Testability} from 'angular2/src/core/testability/testability';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
import {normalizeBlank} from 'angular2/src/core/facade/lang';
import {PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async';
import {normalizeBlank} from 'angular2/src/facade/lang';
import {PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
// Schedules a microtasks (using a resolved promise .then())
function microTask(fn: Function): void {
@@ -11,7 +11,7 @@ import {
} from 'angular2/testing_internal';
import {makeDecorator, makeParamDecorator, Class} from 'angular2/src/core/util/decorators';
import {global} from 'angular2/src/core/facade/lang';
import {global} from 'angular2/src/facade/lang';
import {Inject} from 'angular2/angular2';
import {reflector} from 'angular2/src/core/reflection/reflection';
@@ -16,8 +16,8 @@ import {
browserDetection
} from 'angular2/test_lib';
import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/core/facade/async';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/facade/async';
import {BaseException} from 'angular2/src/facade/exceptions';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
@@ -20,8 +20,8 @@ import {
TimerWrapper,
ObservableWrapper,
EventEmitter
} from 'angular2/src/core/facade/async';
import {BaseException} from 'angular2/src/core/facade/exceptions';
} from 'angular2/src/facade/async';
import {BaseException} from 'angular2/src/facade/exceptions';
import {NgZone, NgZoneError} from 'angular2/src/core/zone/ng_zone';