refactor: remove keys() and values() from MapWrapper

This commit is contained in:
Victor Berchet
2016-11-03 16:58:27 -07:00
committed by vikerman
parent 121e5080aa
commit ec92f4b198
19 changed files with 138 additions and 216 deletions
@@ -8,18 +8,17 @@
import {NgZone} from '@angular/core';
import {MapWrapper} from './facade/collection';
import {global, isPresent} from './facade/lang';
import {global} from './facade/lang';
import {getDOM} from './private_import_platform-browser';
export class BrowserDetection {
private _overrideUa: string;
private get _ua(): string {
if (isPresent(this._overrideUa)) {
if (typeof this._overrideUa === 'string') {
return this._overrideUa;
} else {
return getDOM() ? getDOM().getUserAgent() : '';
}
return getDOM() ? getDOM().getUserAgent() : '';
}
static setup() { browserDetection = new BrowserDetection(null); }
@@ -102,7 +101,7 @@ export function stringifyElement(el: any /** TODO #9100 */): string {
// Attributes in an ordered way
var attributeMap = getDOM().attributeMap(el);
var keys: string[] = MapWrapper.keys(attributeMap).sort();
var keys: string[] = Array.from(attributeMap.keys()).sort();
for (let i = 0; i < keys.length; i++) {
var key = keys[i];
var attValue = attributeMap.get(key);
@@ -116,7 +115,7 @@ export function stringifyElement(el: any /** TODO #9100 */): string {
// Children
var childrenRoot = getDOM().templateAwareRoot(el);
var children = isPresent(childrenRoot) ? getDOM().childNodes(childrenRoot) : [];
var children = childrenRoot ? getDOM().childNodes(childrenRoot) : [];
for (let j = 0; j < children.length; j++) {
result += stringifyElement(children[j]);
}