@angular/platform-browser
Advanced tools
Comparing version 2.2.0-beta.0 to 2.2.0-beta.1
/** | ||
* @license Angular v2.2.0-beta.0 | ||
* @license Angular v2.2.0-beta.1 | ||
* (c) 2010-2016 Google, Inc. https://angular.io/ | ||
@@ -42,3 +42,3 @@ * License: MIT | ||
function isPresent(obj) { | ||
return obj !== undefined && obj !== null; | ||
return obj != null; | ||
} | ||
@@ -82,3 +82,3 @@ | ||
else { | ||
return isPresent(getDOM()) ? getDOM().getUserAgent() : ''; | ||
return getDOM() ? getDOM().getUserAgent() : ''; | ||
} | ||
@@ -85,0 +85,0 @@ }, |
{ | ||
"name": "@angular/platform-browser", | ||
"version": "2.2.0-beta.0", | ||
"version": "2.2.0-beta.1", | ||
"description": "Angular - library for using Angular in a web browser", | ||
@@ -11,4 +11,4 @@ "main": "bundles/platform-browser.umd.js", | ||
"peerDependencies": { | ||
"@angular/core": "2.2.0-beta.0", | ||
"@angular/common": "2.2.0-beta.0" | ||
"@angular/core": "2.2.0-beta.1", | ||
"@angular/common": "2.2.0-beta.1" | ||
}, | ||
@@ -15,0 +15,0 @@ "repository": { |
@@ -10,3 +10,2 @@ /** | ||
import { getDOM } from '../dom/dom_adapter'; | ||
import { ListWrapper } from '../facade/collection'; | ||
import { global, isPresent } from '../facade/lang'; | ||
@@ -44,3 +43,3 @@ export var BrowserGetTestability = (function () { | ||
if (!global['frameworkStabilizers']) { | ||
global['frameworkStabilizers'] = ListWrapper.createGrowableSize(0); | ||
global['frameworkStabilizers'] = []; | ||
} | ||
@@ -47,0 +46,0 @@ global['frameworkStabilizers'].push(whenAllStable); |
@@ -52,3 +52,3 @@ /** | ||
modifierKeys.forEach(function (modifierName) { | ||
if (ListWrapper.contains(parts, modifierName)) { | ||
if (parts.indexOf(modifierName) > -1) { | ||
ListWrapper.remove(parts, modifierName); | ||
@@ -55,0 +55,0 @@ fullKey += modifierName + '.'; |
@@ -33,28 +33,7 @@ export declare class MapWrapper { | ||
export declare class ListWrapper { | ||
static createFixedSize(size: number): any[]; | ||
static createGrowableSize(size: number): any[]; | ||
static clone<T>(array: T[]): T[]; | ||
static forEachWithIndex<T>(array: T[], fn: (t: T, n: number) => void): void; | ||
static first<T>(array: T[]): T; | ||
static last<T>(array: T[]): T; | ||
static indexOf<T>(array: T[], value: T, startIndex?: number): number; | ||
static contains<T>(list: T[], el: T): boolean; | ||
static reversed<T>(array: T[]): T[]; | ||
static concat(a: any[], b: any[]): any[]; | ||
static insert<T>(list: T[], index: number, value: T): void; | ||
static removeAt<T>(list: T[], index: number): T; | ||
static removeAll<T>(list: T[], items: T[]): void; | ||
static remove<T>(list: T[], el: T): boolean; | ||
static clear(list: any[]): void; | ||
static isEmpty(list: any[]): boolean; | ||
static fill(list: any[], value: any, start?: number, end?: number): void; | ||
static equals(a: any[], b: any[]): boolean; | ||
static slice<T>(l: T[], from?: number, to?: number): T[]; | ||
static splice<T>(l: T[], from: number, length: number): T[]; | ||
static sort<T>(l: T[], compareFn?: (a: T, b: T) => number): void; | ||
static toString<T>(l: T[]): string; | ||
static toJSON<T>(l: T[]): string; | ||
static maximum<T>(list: T[], predicate: (t: T) => number): T; | ||
static flatten<T>(list: Array<T | T[]>): T[]; | ||
static addAll<T>(list: Array<T>, source: Array<T>): void; | ||
} | ||
@@ -61,0 +40,0 @@ export declare function isListLikeIterable(obj: any): boolean; |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
import { getSymbolIterator, isBlank, isJsObject, isPresent } from './lang'; | ||
import { getSymbolIterator, isJsObject, isPresent } from './lang'; | ||
// Safari doesn't implement MapIterator.next(), which is used is Traceur's polyfill of Array.from | ||
@@ -82,38 +82,2 @@ // TODO(mlaval): remove the work around once we have a working polyfill of Array.from | ||
} | ||
// JS has no way to express a statically fixed size list, but dart does so we | ||
// keep both methods. | ||
ListWrapper.createFixedSize = function (size) { return new Array(size); }; | ||
ListWrapper.createGrowableSize = function (size) { return new Array(size); }; | ||
ListWrapper.clone = function (array) { return array.slice(0); }; | ||
ListWrapper.forEachWithIndex = function (array, fn) { | ||
for (var i = 0; i < array.length; i++) { | ||
fn(array[i], i); | ||
} | ||
}; | ||
ListWrapper.first = function (array) { | ||
if (!array) | ||
return null; | ||
return array[0]; | ||
}; | ||
ListWrapper.last = function (array) { | ||
if (!array || array.length == 0) | ||
return null; | ||
return array[array.length - 1]; | ||
}; | ||
ListWrapper.indexOf = function (array, value, startIndex) { | ||
if (startIndex === void 0) { startIndex = 0; } | ||
return array.indexOf(value, startIndex); | ||
}; | ||
ListWrapper.contains = function (list, el) { return list.indexOf(el) !== -1; }; | ||
ListWrapper.reversed = function (array) { | ||
var a = ListWrapper.clone(array); | ||
return a.reverse(); | ||
}; | ||
ListWrapper.concat = function (a, b) { return a.concat(b); }; | ||
ListWrapper.insert = function (list, index, value) { list.splice(index, 0, value); }; | ||
ListWrapper.removeAt = function (list, index) { | ||
var res = list[index]; | ||
list.splice(index, 1); | ||
return res; | ||
}; | ||
ListWrapper.removeAll = function (list, items) { | ||
@@ -133,9 +97,2 @@ for (var i = 0; i < items.length; ++i) { | ||
}; | ||
ListWrapper.clear = function (list) { list.length = 0; }; | ||
ListWrapper.isEmpty = function (list) { return list.length == 0; }; | ||
ListWrapper.fill = function (list, value, start, end) { | ||
if (start === void 0) { start = 0; } | ||
if (end === void 0) { end = null; } | ||
list.fill(value, start, end === null ? list.length : end); | ||
}; | ||
ListWrapper.equals = function (a, b) { | ||
@@ -150,18 +107,2 @@ if (a.length != b.length) | ||
}; | ||
ListWrapper.slice = function (l, from, to) { | ||
if (from === void 0) { from = 0; } | ||
if (to === void 0) { to = null; } | ||
return l.slice(from, to === null ? undefined : to); | ||
}; | ||
ListWrapper.splice = function (l, from, length) { return l.splice(from, length); }; | ||
ListWrapper.sort = function (l, compareFn) { | ||
if (isPresent(compareFn)) { | ||
l.sort(compareFn); | ||
} | ||
else { | ||
l.sort(); | ||
} | ||
}; | ||
ListWrapper.toString = function (l) { return l.toString(); }; | ||
ListWrapper.toJSON = function (l) { return JSON.stringify(l); }; | ||
ListWrapper.maximum = function (list, predicate) { | ||
@@ -175,3 +116,3 @@ if (list.length == 0) { | ||
var candidate = list[index]; | ||
if (isBlank(candidate)) { | ||
if (candidate == null) { | ||
continue; | ||
@@ -192,7 +133,2 @@ } | ||
}; | ||
ListWrapper.addAll = function (list, source) { | ||
for (var i = 0; i < source.length; i++) { | ||
list.push(source[i]); | ||
} | ||
}; | ||
return ListWrapper; | ||
@@ -199,0 +135,0 @@ }()); |
@@ -31,3 +31,3 @@ | ||
export declare function scheduleMicroTask(fn: Function): void; | ||
declare var _global: BrowserNodeGlobal; | ||
declare const _global: BrowserNodeGlobal; | ||
export { _global as global }; | ||
@@ -39,3 +39,2 @@ export declare function getTypeNameForDebugging(type: any): string; | ||
export declare function isDate(obj: any): obj is Date; | ||
export declare function noop(): void; | ||
export declare function stringify(token: any): string; | ||
@@ -48,4 +47,2 @@ export declare class NumberWrapper { | ||
export declare function looseIdentical(a: any, b: any): boolean; | ||
export declare function normalizeBlank(obj: Object): any; | ||
export declare function normalizeBool(obj: boolean): boolean; | ||
export declare function isJsObject(o: any): boolean; | ||
@@ -52,0 +49,0 @@ export declare function print(obj: Error | Object): void; |
@@ -38,6 +38,6 @@ /** | ||
export function isPresent(obj) { | ||
return obj !== undefined && obj !== null; | ||
return obj != null; | ||
} | ||
export function isBlank(obj) { | ||
return obj === undefined || obj === null; | ||
return obj == null; | ||
} | ||
@@ -51,3 +51,2 @@ var STRING_MAP_PROTO = Object.getPrototypeOf({}); | ||
} | ||
export function noop() { } | ||
export function stringify(token) { | ||
@@ -106,8 +105,2 @@ if (typeof token === 'string') { | ||
} | ||
export function normalizeBlank(obj) { | ||
return isBlank(obj) ? null : obj; | ||
} | ||
export function normalizeBool(obj) { | ||
return isBlank(obj) ? false : obj; | ||
} | ||
export function isJsObject(o) { | ||
@@ -141,4 +134,4 @@ return o !== null && (typeof o === 'function' || typeof o === 'object'); | ||
export function getSymbolIterator() { | ||
if (isBlank(_symbolIterator)) { | ||
if (isPresent(globalScope.Symbol) && isPresent(Symbol.iterator)) { | ||
if (!_symbolIterator) { | ||
if (globalScope.Symbol && Symbol.iterator) { | ||
_symbolIterator = Symbol.iterator; | ||
@@ -145,0 +138,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":61,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":81,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":143,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":143,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":155,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":155,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":210,"character":19}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":60,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":199,"character":19}}}} |
@@ -9,3 +9,3 @@ /** | ||
import { NgZone } from '@angular/core'; | ||
import { ListWrapper } from './facade/collection'; | ||
import { MapWrapper } from './facade/collection'; | ||
import { global, isPresent } from './facade/lang'; | ||
@@ -23,3 +23,3 @@ import { getDOM } from './private_import_platform-browser'; | ||
else { | ||
return isPresent(getDOM()) ? getDOM().getUserAgent() : ''; | ||
return getDOM() ? getDOM().getUserAgent() : ''; | ||
} | ||
@@ -143,5 +143,3 @@ }, | ||
var attributeMap = getDOM().attributeMap(el); | ||
var keys = []; | ||
attributeMap.forEach(function (v, k) { return keys.push(k); }); | ||
ListWrapper.sort(keys); | ||
var keys = MapWrapper.keys(attributeMap).sort(); | ||
for (var i = 0; i < keys.length; i++) { | ||
@@ -165,3 +163,3 @@ var key = keys[i]; | ||
// Closing tag | ||
if (!ListWrapper.contains(_singleTagWhitelist, tagName)) { | ||
if (_singleTagWhitelist.indexOf(tagName) == -1) { | ||
result += "</" + tagName + ">"; | ||
@@ -168,0 +166,0 @@ } |
@@ -33,28 +33,7 @@ export declare class MapWrapper { | ||
export declare class ListWrapper { | ||
static createFixedSize(size: number): any[]; | ||
static createGrowableSize(size: number): any[]; | ||
static clone<T>(array: T[]): T[]; | ||
static forEachWithIndex<T>(array: T[], fn: (t: T, n: number) => void): void; | ||
static first<T>(array: T[]): T; | ||
static last<T>(array: T[]): T; | ||
static indexOf<T>(array: T[], value: T, startIndex?: number): number; | ||
static contains<T>(list: T[], el: T): boolean; | ||
static reversed<T>(array: T[]): T[]; | ||
static concat(a: any[], b: any[]): any[]; | ||
static insert<T>(list: T[], index: number, value: T): void; | ||
static removeAt<T>(list: T[], index: number): T; | ||
static removeAll<T>(list: T[], items: T[]): void; | ||
static remove<T>(list: T[], el: T): boolean; | ||
static clear(list: any[]): void; | ||
static isEmpty(list: any[]): boolean; | ||
static fill(list: any[], value: any, start?: number, end?: number): void; | ||
static equals(a: any[], b: any[]): boolean; | ||
static slice<T>(l: T[], from?: number, to?: number): T[]; | ||
static splice<T>(l: T[], from: number, length: number): T[]; | ||
static sort<T>(l: T[], compareFn?: (a: T, b: T) => number): void; | ||
static toString<T>(l: T[]): string; | ||
static toJSON<T>(l: T[]): string; | ||
static maximum<T>(list: T[], predicate: (t: T) => number): T; | ||
static flatten<T>(list: Array<T | T[]>): T[]; | ||
static addAll<T>(list: Array<T>, source: Array<T>): void; | ||
} | ||
@@ -61,0 +40,0 @@ export declare function isListLikeIterable(obj: any): boolean; |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
import { getSymbolIterator, isBlank, isJsObject, isPresent } from './lang'; | ||
import { getSymbolIterator, isJsObject, isPresent } from './lang'; | ||
// Safari doesn't implement MapIterator.next(), which is used is Traceur's polyfill of Array.from | ||
@@ -82,38 +82,2 @@ // TODO(mlaval): remove the work around once we have a working polyfill of Array.from | ||
} | ||
// JS has no way to express a statically fixed size list, but dart does so we | ||
// keep both methods. | ||
ListWrapper.createFixedSize = function (size) { return new Array(size); }; | ||
ListWrapper.createGrowableSize = function (size) { return new Array(size); }; | ||
ListWrapper.clone = function (array) { return array.slice(0); }; | ||
ListWrapper.forEachWithIndex = function (array, fn) { | ||
for (var i = 0; i < array.length; i++) { | ||
fn(array[i], i); | ||
} | ||
}; | ||
ListWrapper.first = function (array) { | ||
if (!array) | ||
return null; | ||
return array[0]; | ||
}; | ||
ListWrapper.last = function (array) { | ||
if (!array || array.length == 0) | ||
return null; | ||
return array[array.length - 1]; | ||
}; | ||
ListWrapper.indexOf = function (array, value, startIndex) { | ||
if (startIndex === void 0) { startIndex = 0; } | ||
return array.indexOf(value, startIndex); | ||
}; | ||
ListWrapper.contains = function (list, el) { return list.indexOf(el) !== -1; }; | ||
ListWrapper.reversed = function (array) { | ||
var a = ListWrapper.clone(array); | ||
return a.reverse(); | ||
}; | ||
ListWrapper.concat = function (a, b) { return a.concat(b); }; | ||
ListWrapper.insert = function (list, index, value) { list.splice(index, 0, value); }; | ||
ListWrapper.removeAt = function (list, index) { | ||
var res = list[index]; | ||
list.splice(index, 1); | ||
return res; | ||
}; | ||
ListWrapper.removeAll = function (list, items) { | ||
@@ -133,9 +97,2 @@ for (var i = 0; i < items.length; ++i) { | ||
}; | ||
ListWrapper.clear = function (list) { list.length = 0; }; | ||
ListWrapper.isEmpty = function (list) { return list.length == 0; }; | ||
ListWrapper.fill = function (list, value, start, end) { | ||
if (start === void 0) { start = 0; } | ||
if (end === void 0) { end = null; } | ||
list.fill(value, start, end === null ? list.length : end); | ||
}; | ||
ListWrapper.equals = function (a, b) { | ||
@@ -150,18 +107,2 @@ if (a.length != b.length) | ||
}; | ||
ListWrapper.slice = function (l, from, to) { | ||
if (from === void 0) { from = 0; } | ||
if (to === void 0) { to = null; } | ||
return l.slice(from, to === null ? undefined : to); | ||
}; | ||
ListWrapper.splice = function (l, from, length) { return l.splice(from, length); }; | ||
ListWrapper.sort = function (l, compareFn) { | ||
if (isPresent(compareFn)) { | ||
l.sort(compareFn); | ||
} | ||
else { | ||
l.sort(); | ||
} | ||
}; | ||
ListWrapper.toString = function (l) { return l.toString(); }; | ||
ListWrapper.toJSON = function (l) { return JSON.stringify(l); }; | ||
ListWrapper.maximum = function (list, predicate) { | ||
@@ -175,3 +116,3 @@ if (list.length == 0) { | ||
var candidate = list[index]; | ||
if (isBlank(candidate)) { | ||
if (candidate == null) { | ||
continue; | ||
@@ -192,7 +133,2 @@ } | ||
}; | ||
ListWrapper.addAll = function (list, source) { | ||
for (var i = 0; i < source.length; i++) { | ||
list.push(source[i]); | ||
} | ||
}; | ||
return ListWrapper; | ||
@@ -199,0 +135,0 @@ }()); |
@@ -31,3 +31,3 @@ | ||
export declare function scheduleMicroTask(fn: Function): void; | ||
declare var _global: BrowserNodeGlobal; | ||
declare const _global: BrowserNodeGlobal; | ||
export { _global as global }; | ||
@@ -39,3 +39,2 @@ export declare function getTypeNameForDebugging(type: any): string; | ||
export declare function isDate(obj: any): obj is Date; | ||
export declare function noop(): void; | ||
export declare function stringify(token: any): string; | ||
@@ -48,4 +47,2 @@ export declare class NumberWrapper { | ||
export declare function looseIdentical(a: any, b: any): boolean; | ||
export declare function normalizeBlank(obj: Object): any; | ||
export declare function normalizeBool(obj: boolean): boolean; | ||
export declare function isJsObject(o: any): boolean; | ||
@@ -52,0 +49,0 @@ export declare function print(obj: Error | Object): void; |
@@ -38,6 +38,6 @@ /** | ||
export function isPresent(obj) { | ||
return obj !== undefined && obj !== null; | ||
return obj != null; | ||
} | ||
export function isBlank(obj) { | ||
return obj === undefined || obj === null; | ||
return obj == null; | ||
} | ||
@@ -51,3 +51,2 @@ var STRING_MAP_PROTO = Object.getPrototypeOf({}); | ||
} | ||
export function noop() { } | ||
export function stringify(token) { | ||
@@ -106,8 +105,2 @@ if (typeof token === 'string') { | ||
} | ||
export function normalizeBlank(obj) { | ||
return isBlank(obj) ? null : obj; | ||
} | ||
export function normalizeBool(obj) { | ||
return isBlank(obj) ? false : obj; | ||
} | ||
export function isJsObject(o) { | ||
@@ -141,4 +134,4 @@ return o !== null && (typeof o === 'function' || typeof o === 'object'); | ||
export function getSymbolIterator() { | ||
if (isBlank(_symbolIterator)) { | ||
if (isPresent(globalScope.Symbol) && isPresent(Symbol.iterator)) { | ||
if (!_symbolIterator) { | ||
if (globalScope.Symbol && Symbol.iterator) { | ||
_symbolIterator = Symbol.iterator; | ||
@@ -145,0 +138,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":61,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":81,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":143,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":143,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":155,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":155,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":210,"character":19}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":60,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"!=","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":140,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":144,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":199,"character":19}}}} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
689090
8120