repackaging: all the repackaging changes squashed

This commit is contained in:
Igor Minar
2016-04-28 17:50:03 -07:00
committed by Misko Hevery
parent 505da6c0a8
commit a66cdb469f
860 changed files with 7869 additions and 4985 deletions
@@ -1,7 +1,8 @@
import {MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
import {isBlank, isPresent, global, setValueOnPath, DateWrapper} from 'angular2/src/facade/lang';
import {setRootDomAdapter} from 'angular2/src/platform/dom/dom_adapter';
import {ListWrapper} from '../../src/facade/collection';
import {isBlank, isPresent, global, setValueOnPath, DateWrapper} from '../../src/facade/lang';
import {GenericBrowserDomAdapter} from './generic_browser_adapter';
import {setRootDomAdapter} from '../dom/dom_adapter';
var _attrToPropMap = {
'class': 'className',
@@ -1,7 +1,6 @@
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
import {isPresent, isFunction, Type} from 'angular2/src/facade/lang';
import {DomAdapter} from 'angular2/src/platform/dom/dom_adapter';
import {XHRImpl} from 'angular2/src/platform/browser/xhr_impl';
import {StringMapWrapper} from '../../src/facade/collection';
import {isPresent, isFunction, Type} from '../../src/facade/lang';
import {DomAdapter} from '../dom/dom_adapter';
/**
@@ -42,7 +41,6 @@ export abstract class GenericBrowserDomAdapter extends DomAdapter {
}
}
getXHR(): Type { return XHRImpl; }
getDistributedNodes(el: HTMLElement): Node[] { return (<any>el).getDistributedNodes(); }
resolveAndSetHref(el: HTMLAnchorElement, baseUrl: string, href: string) {
el.href = href == null ? baseUrl : baseUrl + '/../' + href;
@@ -1,7 +1,9 @@
import {Injectable} from 'angular2/src/core/di/decorators';
import {UrlChangeListener, PlatformLocation} from './platform_location';
import {History, Location} from 'angular2/src/facade/browser';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {Injectable} from '@angular/core';
import {History, Location} from '../../../src/facade/browser';
import {UrlChangeListener, PlatformLocation} from '@angular/common';
import {getDOM} from '../../dom/dom_adapter';
/**
* `PlatformLocation` encapsulates all of the direct calls to platform APIs.
@@ -21,21 +23,21 @@ export class BrowserPlatformLocation extends PlatformLocation {
// This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it
/** @internal */
_init() {
this._location = DOM.getLocation();
this._history = DOM.getHistory();
this._location = getDOM().getLocation();
this._history = getDOM().getHistory();
}
/** @internal */
get location(): Location { return this._location; }
getBaseHrefFromDOM(): string { return DOM.getBaseHref(); }
getBaseHrefFromDOM(): string { return getDOM().getBaseHref(); }
onPopState(fn: UrlChangeListener): void {
DOM.getGlobalEventTarget('window').addEventListener('popstate', fn, false);
getDOM().getGlobalEventTarget('window').addEventListener('popstate', fn, false);
}
onHashChange(fn: UrlChangeListener): void {
DOM.getGlobalEventTarget('window').addEventListener('hashchange', fn, false);
getDOM().getGlobalEventTarget('window').addEventListener('hashchange', fn, false);
}
get pathname(): string { return this._location.pathname; }
@@ -1,6 +1,6 @@
import {PromiseWrapper} from 'angular2/src/facade/async';
import {DomAdapter} from 'angular2/src/platform/dom/dom_adapter';
import {ElementRef} from 'angular2/src/core/linker/element_ref';
import {PromiseWrapper} from '../../src/facade/async';
import {DomAdapter} from '@angular/platform-browser/src/dom/dom_adapter';
import {ElementRef} from '@angular/core/src/linker/element_ref';
export class Rectangle {
left;
@@ -126,7 +126,7 @@ class BrowserGetTestability implements GetTestability {
}
return _jsify(result);
};
js.context['getAllAngularTestabilities'] =
js.context['getAllAngularTestabilities'] =
_jsify(getAllAngularTestabilities);
var whenAllStable = _jsify((callback) {
@@ -162,10 +162,10 @@ class BrowserGetTestability implements GetTestability {
} else if (!findInAncestors) {
return null;
}
if (DOM.isShadowRoot(elem)) {
return this.findTestabilityInTree(registry, DOM.getHost(elem), true);
if (getDOM().isShadowRoot(elem)) {
return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);
}
return this.findTestabilityInTree(registry, DOM.parentElement(elem), true);
return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);
}
js.JsObject _createRegistry(TestabilityRegistry registry) {
@@ -1,17 +1,16 @@
import {Map, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
import {global, isPresent} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {PromiseWrapper, ObservableWrapper} from 'angular2/src/facade/async';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {
Injectable,
TestabilityRegistry,
Testability,
GetTestability,
setTestabilityGetter
} from 'angular2/core';
} from '@angular/core';
import {ListWrapper} from '../../src/facade/collection';
import {global, isPresent} from '../../src/facade/lang';
import {getDOM} from '../dom/dom_adapter';
class PublicTestability {
/** @internal */
@@ -82,9 +81,9 @@ export class BrowserGetTestability implements GetTestability {
} else if (!findInAncestors) {
return null;
}
if (DOM.isShadowRoot(elem)) {
return this.findTestabilityInTree(registry, DOM.getHost(elem), true);
if (getDOM().isShadowRoot(elem)) {
return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);
}
return this.findTestabilityInTree(registry, DOM.parentElement(elem), true);
return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);
}
}
@@ -1,5 +1,4 @@
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {getDOM} from '../dom/dom_adapter';
/**
* A service that can be used to get and set the title of a current HTML document.
*
@@ -13,11 +12,11 @@ export class Title {
* Get the title of the current HTML document.
* @returns {string}
*/
getTitle(): string { return DOM.getTitle(); }
getTitle(): string { return getDOM().getTitle(); }
/**
* Set the title of the current HTML document.
* @param newTitle
*/
setTitle(newTitle: string) { DOM.setTitle(newTitle); }
setTitle(newTitle: string) { getDOM().setTitle(newTitle); }
}
@@ -1,8 +1,8 @@
import {ApplicationRef} from 'angular2/src/core/application_ref';
import {ComponentRef} from 'angular2/src/core/linker/component_factory';
import {isPresent, NumberWrapper} from 'angular2/src/facade/lang';
import {window} from 'angular2/src/facade/browser';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {ApplicationRef, ComponentRef} from '@angular/core';
import {isPresent, NumberWrapper} from '../../../src/facade/lang';
import {window} from '../../../src/facade/browser';
import {getDOM} from '../../dom/dom_adapter';
export class ChangeDetectionPerfRecord {
constructor(public msPerTick: number, public numTicks: number) {}
@@ -51,13 +51,13 @@ export class AngularProfiler {
if (record && isProfilerAvailable) {
window.console.profile(profileName);
}
var start = DOM.performanceNow();
var start = getDOM().performanceNow();
var numTicks = 0;
while (numTicks < 5 || (DOM.performanceNow() - start) < 500) {
while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {
this.appRef.tick();
numTicks++;
}
var end = DOM.performanceNow();
var end = getDOM().performanceNow();
if (record && isProfilerAvailable) {
// need to cast to <any> because type checker thinks there's no argument
// while in fact there is:
@@ -1,5 +1,6 @@
import {global} from 'angular2/src/facade/lang';
import {ComponentRef} from 'angular2/src/core/linker/component_factory';
import {ComponentRef} from '@angular/core';
import {global} from '../../../src/facade/lang';
import {AngularTools} from './common_tools';
var context = <any>global;