2015-08-27 10:39:39 -07:00
|
|
|
// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492
|
|
|
|
declare var WorkerGlobalScope;
|
|
|
|
var globalScope: BrowserNodeGlobal;
|
|
|
|
if (typeof window === 'undefined') {
|
|
|
|
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
|
|
|
// TODO: Replace any with WorkerGlobalScope from lib.webworker.d.ts #3492
|
|
|
|
globalScope = <any>self;
|
|
|
|
} else {
|
|
|
|
globalScope = <any>global;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
globalScope = <any>window;
|
|
|
|
};
|
|
|
|
|
2015-11-05 14:07:57 -08:00
|
|
|
export const IS_DART = false;
|
|
|
|
|
2015-08-27 10:39:39 -07:00
|
|
|
// Need to declare a new variable for global here since TypeScript
|
|
|
|
// exports the original value of the symbol.
|
|
|
|
var _global: BrowserNodeGlobal = globalScope;
|
|
|
|
|
2015-04-01 10:45:56 -07:00
|
|
|
export {_global as global};
|
|
|
|
|
|
|
|
export var Type = Function;
|
2015-07-28 14:41:36 -07:00
|
|
|
|
|
|
|
/**
|
2015-09-21 12:19:51 -07:00
|
|
|
* Runtime representation a type that a Component or other object is instances of.
|
2015-07-28 14:41:36 -07:00
|
|
|
*
|
2015-09-21 12:19:51 -07:00
|
|
|
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
|
|
|
|
* the `MyCustomComponent` constructor function.
|
2015-07-28 14:41:36 -07:00
|
|
|
*/
|
2015-10-06 06:53:39 -07:00
|
|
|
export interface Type extends Function {}
|
2015-12-03 15:49:09 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Runtime representation of a type that is constructable (non-abstract).
|
|
|
|
*/
|
2015-10-06 06:53:39 -07:00
|
|
|
export interface ConcreteType extends Type { new (...args): any; }
|
2015-04-24 13:17:36 -07:00
|
|
|
|
2015-07-13 14:22:43 -07:00
|
|
|
export function getTypeNameForDebugging(type: Type): string {
|
|
|
|
return type['name'];
|
|
|
|
}
|
|
|
|
|
2015-07-14 19:53:04 -05:00
|
|
|
|
2015-04-01 10:45:56 -07:00
|
|
|
export var Math = _global.Math;
|
|
|
|
export var Date = _global.Date;
|
|
|
|
|
2015-12-15 08:34:44 -08:00
|
|
|
var _devMode: boolean = true;
|
|
|
|
var _modeLocked: boolean = false;
|
2015-11-03 15:19:18 -08:00
|
|
|
|
2015-12-15 08:34:44 -08:00
|
|
|
export function lockMode() {
|
|
|
|
_modeLocked = true;
|
2015-11-03 15:19:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-12-15 08:34:44 -08:00
|
|
|
* Disable Angular's development mode, which turns off assertions and other
|
2015-11-03 15:19:18 -08:00
|
|
|
* checks within the framework.
|
|
|
|
*
|
2015-12-15 08:34:44 -08:00
|
|
|
* One important assertion this disables verifies that a change detection pass
|
2015-11-03 15:19:18 -08:00
|
|
|
* does not result in additional changes to any bindings (also known as
|
|
|
|
* unidirectional data flow).
|
|
|
|
*/
|
2015-12-15 08:34:44 -08:00
|
|
|
export function enableProdMode() {
|
|
|
|
if (_modeLocked) {
|
2015-11-03 15:19:18 -08:00
|
|
|
// Cannot use BaseException as that ends up importing from facade/lang.
|
2015-12-15 08:34:44 -08:00
|
|
|
throw 'Cannot enable prod mode after platform setup.';
|
2015-11-03 15:19:18 -08:00
|
|
|
}
|
2015-12-15 08:34:44 -08:00
|
|
|
_devMode = false;
|
2015-11-03 15:19:18 -08:00
|
|
|
}
|
|
|
|
|
2015-05-20 17:19:46 -07:00
|
|
|
export function assertionsEnabled(): boolean {
|
2015-11-03 15:19:18 -08:00
|
|
|
return _devMode;
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
2015-05-18 09:24:52 -07:00
|
|
|
|
2015-05-20 17:19:46 -07:00
|
|
|
// TODO: remove calls to assert in production environment
|
|
|
|
// Note: Can't just export this and import in in other files
|
|
|
|
// as `assert` is a reserved keyword in Dart
|
2015-06-19 10:18:44 -07:00
|
|
|
_global.assert = function assert(condition) {
|
2015-10-28 18:21:47 +01:00
|
|
|
// TODO: to be fixed properly via #2830, noop for now
|
2015-06-19 10:18:44 -07:00
|
|
|
};
|
2015-06-19 12:14:12 -07:00
|
|
|
|
2015-05-10 13:26:33 +02:00
|
|
|
// This function is needed only to properly support Dart's const expressions
|
|
|
|
// see https://github.com/angular/ts2dart/pull/151 for more info
|
|
|
|
export function CONST_EXPR<T>(expr: T): T {
|
|
|
|
return expr;
|
2015-05-11 21:52:41 +02:00
|
|
|
}
|
2015-05-18 09:24:52 -07:00
|
|
|
|
2015-10-05 16:02:21 -07:00
|
|
|
export function CONST(): ClassDecorator & PropertyDecorator {
|
2015-04-24 15:19:11 -07:00
|
|
|
return (target) => target;
|
2015-05-11 21:52:41 +02:00
|
|
|
}
|
2015-05-18 09:24:52 -07:00
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isPresent(obj: any): boolean {
|
2015-04-01 10:45:56 -07:00
|
|
|
return obj !== undefined && obj !== null;
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isBlank(obj: any): boolean {
|
2015-04-01 10:45:56 -07:00
|
|
|
return obj === undefined || obj === null;
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isString(obj: any): boolean {
|
2015-04-01 10:45:56 -07:00
|
|
|
return typeof obj === "string";
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isFunction(obj: any): boolean {
|
2015-04-01 10:45:56 -07:00
|
|
|
return typeof obj === "function";
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isType(obj: any): boolean {
|
2015-04-15 17:56:14 -07:00
|
|
|
return isFunction(obj);
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isStringMap(obj: any): boolean {
|
2015-05-29 14:19:10 -07:00
|
|
|
return typeof obj === 'object' && obj !== null;
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isPromise(obj: any): boolean {
|
2015-06-11 19:32:55 +02:00
|
|
|
return obj instanceof (<any>_global).Promise;
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isArray(obj: any): boolean {
|
2015-06-11 19:32:55 +02:00
|
|
|
return Array.isArray(obj);
|
|
|
|
}
|
|
|
|
|
2015-07-04 22:25:43 +04:30
|
|
|
export function isNumber(obj): boolean {
|
|
|
|
return typeof obj === 'number';
|
|
|
|
}
|
|
|
|
|
2015-07-04 22:34:54 +04:30
|
|
|
export function isDate(obj): boolean {
|
|
|
|
return obj instanceof Date && !isNaN(obj.valueOf());
|
|
|
|
}
|
|
|
|
|
2015-10-29 19:57:28 -07:00
|
|
|
export function noop() {}
|
|
|
|
|
2015-04-01 10:45:56 -07:00
|
|
|
export function stringify(token): string {
|
|
|
|
if (typeof token === 'string') {
|
|
|
|
return token;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (token === undefined || token === null) {
|
|
|
|
return '' + token;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (token.name) {
|
|
|
|
return token.name;
|
|
|
|
}
|
|
|
|
|
2015-07-22 11:59:16 -07:00
|
|
|
var res = token.toString();
|
|
|
|
var newLineIndex = res.indexOf("\n");
|
|
|
|
return (newLineIndex === -1) ? res : res.substring(0, newLineIndex);
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
|
|
|
|
2015-07-10 16:09:18 -07:00
|
|
|
// serialize / deserialize enum exist only for consistency with dart API
|
|
|
|
// enums in typescript don't need to be serialized
|
|
|
|
|
2015-08-20 16:25:34 -07:00
|
|
|
export function serializeEnum(val): number {
|
2015-07-10 16:09:18 -07:00
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
2015-08-20 16:25:34 -07:00
|
|
|
export function deserializeEnum(val, values: Map<number, any>): any {
|
2015-07-10 16:09:18 -07:00
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
2015-04-01 10:45:56 -07:00
|
|
|
export class StringWrapper {
|
2015-08-20 16:25:34 -07:00
|
|
|
static fromCharCode(code: number): string { return String.fromCharCode(code); }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
2015-08-20 16:25:34 -07:00
|
|
|
static charCodeAt(s: string, index: number): number { return s.charCodeAt(index); }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
2015-08-28 11:29:19 -07:00
|
|
|
static split(s: string, regExp: RegExp): string[] { return s.split(regExp); }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
|
|
|
static equals(s: string, s2: string): boolean { return s === s2; }
|
|
|
|
|
2015-12-05 02:21:38 -08:00
|
|
|
static stripLeft(s: string, charVal: string): string {
|
|
|
|
if (s && s.length) {
|
|
|
|
var pos = 0;
|
|
|
|
for (var i = 0; i < s.length; i++) {
|
|
|
|
if (s[i] != charVal) break;
|
|
|
|
pos++;
|
|
|
|
}
|
|
|
|
s = s.substring(pos);
|
|
|
|
}
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
static stripRight(s: string, charVal: string): string {
|
|
|
|
if (s && s.length) {
|
|
|
|
var pos = s.length;
|
|
|
|
for (var i = s.length - 1; i >= 0; i--) {
|
|
|
|
if (s[i] != charVal) break;
|
|
|
|
pos--;
|
|
|
|
}
|
|
|
|
s = s.substring(0, pos);
|
|
|
|
}
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
2015-04-01 10:45:56 -07:00
|
|
|
static replace(s: string, from: string, replace: string): string {
|
|
|
|
return s.replace(from, replace);
|
|
|
|
}
|
|
|
|
|
|
|
|
static replaceAll(s: string, from: RegExp, replace: string): string {
|
|
|
|
return s.replace(from, replace);
|
|
|
|
}
|
|
|
|
|
2015-08-30 17:04:15 -07:00
|
|
|
static slice<T>(s: string, from: number = 0, to: number = null): string {
|
|
|
|
return s.slice(from, to === null ? undefined : to);
|
|
|
|
}
|
|
|
|
|
2015-04-01 10:45:56 -07:00
|
|
|
static replaceAllMapped(s: string, from: RegExp, cb: Function): string {
|
2015-06-02 09:51:40 -07:00
|
|
|
return s.replace(from, function(...matches) {
|
2015-04-01 10:45:56 -07:00
|
|
|
// Remove offset & string from the result array
|
|
|
|
matches.splice(-2, 2);
|
|
|
|
// The callback receives match, p1, ..., pn
|
|
|
|
return cb(matches);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static contains(s: string, substr: string): boolean { return s.indexOf(substr) != -1; }
|
2015-07-20 13:37:50 -07:00
|
|
|
|
2015-08-20 16:25:34 -07:00
|
|
|
static compare(a: string, b: string): number {
|
2015-07-20 13:37:50 -07:00
|
|
|
if (a < b) {
|
|
|
|
return -1;
|
|
|
|
} else if (a > b) {
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export class StringJoiner {
|
|
|
|
constructor(public parts = []) {}
|
|
|
|
|
2015-06-09 16:51:40 +02:00
|
|
|
add(part: string): void { this.parts.push(part); }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
|
|
|
toString(): string { return this.parts.join(""); }
|
|
|
|
}
|
|
|
|
|
2015-09-10 15:25:36 -07:00
|
|
|
export class NumberParseError extends Error {
|
2015-04-01 10:45:56 -07:00
|
|
|
name: string;
|
|
|
|
|
2015-10-01 19:49:45 -07:00
|
|
|
constructor(public message: string) { super(); }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
2015-06-26 11:10:52 -07:00
|
|
|
toString(): string { return this.message; }
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export class NumberWrapper {
|
2015-08-20 16:25:34 -07:00
|
|
|
static toFixed(n: number, fractionDigits: number): string { return n.toFixed(fractionDigits); }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
static equal(a: number, b: number): boolean { return a === b; }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
2015-08-20 16:25:34 -07:00
|
|
|
static parseIntAutoRadix(text: string): number {
|
|
|
|
var result: number = parseInt(text);
|
2015-04-01 10:45:56 -07:00
|
|
|
if (isNaN(result)) {
|
|
|
|
throw new NumberParseError("Invalid integer literal when parsing " + text);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2015-08-20 16:25:34 -07:00
|
|
|
static parseInt(text: string, radix: number): number {
|
2015-04-01 10:45:56 -07:00
|
|
|
if (radix == 10) {
|
|
|
|
if (/^(\-|\+)?[0-9]+$/.test(text)) {
|
|
|
|
return parseInt(text, radix);
|
|
|
|
}
|
|
|
|
} else if (radix == 16) {
|
|
|
|
if (/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text)) {
|
|
|
|
return parseInt(text, radix);
|
|
|
|
}
|
|
|
|
} else {
|
2015-08-20 16:25:34 -07:00
|
|
|
var result: number = parseInt(text, radix);
|
2015-04-01 10:45:56 -07:00
|
|
|
if (!isNaN(result)) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw new NumberParseError("Invalid integer literal when parsing " + text + " in base " +
|
|
|
|
radix);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: NaN is a valid literal but is returned by parseFloat to indicate an error.
|
|
|
|
static parseFloat(text: string): number { return parseFloat(text); }
|
|
|
|
|
|
|
|
static get NaN(): number { return NaN; }
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
static isNaN(value: any): boolean { return isNaN(value); }
|
2015-04-01 10:45:56 -07:00
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
static isInteger(value: any): boolean { return Number.isInteger(value); }
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export var RegExp = _global.RegExp;
|
|
|
|
|
|
|
|
export class RegExpWrapper {
|
2015-07-07 20:03:00 -07:00
|
|
|
static create(regExpStr: string, flags: string = ''): RegExp {
|
2015-04-01 10:45:56 -07:00
|
|
|
flags = flags.replace(/g/g, '');
|
|
|
|
return new _global.RegExp(regExpStr, flags + 'g');
|
|
|
|
}
|
2015-10-01 19:49:45 -07:00
|
|
|
static firstMatch(regExp: RegExp, input: string): RegExpExecArray {
|
2015-04-01 10:45:56 -07:00
|
|
|
// Reset multimatch regex state
|
|
|
|
regExp.lastIndex = 0;
|
|
|
|
return regExp.exec(input);
|
|
|
|
}
|
2015-07-28 18:38:35 -07:00
|
|
|
static test(regExp: RegExp, input: string): boolean {
|
|
|
|
regExp.lastIndex = 0;
|
|
|
|
return regExp.test(input);
|
|
|
|
}
|
2015-07-07 20:03:00 -07:00
|
|
|
static matcher(regExp: RegExp, input: string): {
|
2015-06-26 11:10:52 -07:00
|
|
|
re: RegExp;
|
|
|
|
input: string
|
|
|
|
}
|
|
|
|
{
|
2015-04-01 10:45:56 -07:00
|
|
|
// Reset regex state for the case
|
|
|
|
// someone did not loop over all matches
|
|
|
|
// last time.
|
|
|
|
regExp.lastIndex = 0;
|
|
|
|
return {re: regExp, input: input};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class RegExpMatcherWrapper {
|
2015-07-07 20:03:00 -07:00
|
|
|
static next(matcher: {
|
|
|
|
re: RegExp;
|
|
|
|
input: string
|
2015-10-01 19:49:45 -07:00
|
|
|
}): RegExpExecArray {
|
2015-07-07 20:03:00 -07:00
|
|
|
return matcher.re.exec(matcher.input);
|
|
|
|
}
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export class FunctionWrapper {
|
2015-07-07 20:03:00 -07:00
|
|
|
static apply(fn: Function, posArgs: any): any { return fn.apply(null, posArgs); }
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// JS has NaN !== NaN
|
|
|
|
export function looseIdentical(a, b): boolean {
|
|
|
|
return a === b || typeof a === "number" && typeof b === "number" && isNaN(a) && isNaN(b);
|
|
|
|
}
|
|
|
|
|
|
|
|
// JS considers NaN is the same as NaN for map Key (while NaN !== NaN otherwise)
|
|
|
|
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
|
2015-07-07 20:03:00 -07:00
|
|
|
export function getMapKey<T>(value: T): T {
|
2015-04-01 10:45:56 -07:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function normalizeBlank(obj: Object): any {
|
2015-04-01 10:45:56 -07:00
|
|
|
return isBlank(obj) ? null : obj;
|
|
|
|
}
|
|
|
|
|
2015-06-12 07:50:45 -07:00
|
|
|
export function normalizeBool(obj: boolean): boolean {
|
2015-05-27 10:14:37 -07:00
|
|
|
return isBlank(obj) ? false : obj;
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function isJsObject(o: any): boolean {
|
2015-04-01 10:45:56 -07:00
|
|
|
return o !== null && (typeof o === "function" || typeof o === "object");
|
|
|
|
}
|
|
|
|
|
2015-07-07 20:03:00 -07:00
|
|
|
export function print(obj: Error | Object) {
|
2015-09-10 15:25:36 -07:00
|
|
|
console.log(obj);
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// Can't be all uppercase as our transpiler would think it is a special directive...
|
2015-05-18 09:24:52 -07:00
|
|
|
export class Json {
|
2015-06-26 11:10:52 -07:00
|
|
|
static parse(s: string): Object { return _global.JSON.parse(s); }
|
2015-07-07 20:03:00 -07:00
|
|
|
static stringify(data: Object): string {
|
2015-05-18 09:24:52 -07:00
|
|
|
// Dart doesn't take 3 arguments
|
|
|
|
return _global.JSON.stringify(data, null, 2);
|
|
|
|
}
|
|
|
|
}
|
2015-04-01 10:45:56 -07:00
|
|
|
|
|
|
|
export class DateWrapper {
|
2015-08-20 16:25:34 -07:00
|
|
|
static create(year: number, month: number = 1, day: number = 1, hour: number = 0,
|
|
|
|
minutes: number = 0, seconds: number = 0, milliseconds: number = 0): Date {
|
2015-07-04 22:34:54 +04:30
|
|
|
return new Date(year, month - 1, day, hour, minutes, seconds, milliseconds);
|
|
|
|
}
|
2015-10-13 12:04:38 -07:00
|
|
|
static fromISOString(str: string): Date { return new Date(str); }
|
2015-08-20 16:25:34 -07:00
|
|
|
static fromMillis(ms: number): Date { return new Date(ms); }
|
|
|
|
static toMillis(date: Date): number { return date.getTime(); }
|
2015-06-26 11:10:52 -07:00
|
|
|
static now(): Date { return new Date(); }
|
2015-07-04 22:34:54 +04:30
|
|
|
static toJson(date: Date): string { return date.toJSON(); }
|
2015-04-01 10:45:56 -07:00
|
|
|
}
|
2015-08-28 10:36:58 -07:00
|
|
|
|
|
|
|
export function setValueOnPath(global: any, path: string, value: any) {
|
|
|
|
var parts = path.split('.');
|
|
|
|
var obj: any = global;
|
|
|
|
while (parts.length > 1) {
|
|
|
|
var name = parts.shift();
|
2015-11-26 19:38:14 +01:00
|
|
|
if (obj.hasOwnProperty(name) && isPresent(obj[name])) {
|
2015-08-28 10:36:58 -07:00
|
|
|
obj = obj[name];
|
|
|
|
} else {
|
|
|
|
obj = obj[name] = {};
|
|
|
|
}
|
|
|
|
}
|
2015-09-09 15:21:02 +02:00
|
|
|
if (obj === undefined || obj === null) {
|
|
|
|
obj = {};
|
|
|
|
}
|
2015-08-28 10:36:58 -07:00
|
|
|
obj[parts.shift()] = value;
|
|
|
|
}
|
2015-09-17 00:35:59 +02:00
|
|
|
|
|
|
|
// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim
|
2015-09-29 11:11:06 -07:00
|
|
|
declare var Symbol;
|
2015-09-17 00:35:59 +02:00
|
|
|
var _symbolIterator = null;
|
|
|
|
export function getSymbolIterator(): string | symbol {
|
|
|
|
if (isBlank(_symbolIterator)) {
|
|
|
|
if (isPresent(Symbol) && isPresent(Symbol.iterator)) {
|
|
|
|
_symbolIterator = Symbol.iterator;
|
|
|
|
} else {
|
|
|
|
// es6-shim specific logic
|
|
|
|
var keys = Object.getOwnPropertyNames(Map.prototype);
|
|
|
|
for (var i = 0; i < keys.length; ++i) {
|
|
|
|
var key = keys[i];
|
|
|
|
if (key !== 'entries' && key !== 'size' &&
|
|
|
|
Map.prototype[key] === Map.prototype['entries']) {
|
|
|
|
_symbolIterator = key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return _symbolIterator;
|
|
|
|
}
|