Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.google.javascript.jscomp.resources.json Maven / Gradle / Ivy
{"js/build_polyfill_table.js":"#!/usr/bin/env node\n\n/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use strict';\n\nconst fs = require('fs');\n\n/**\n * Provides an ordering to ensure lower-versioned polyfills don't\n * depend on higher versions.\n */\nconst ORDER = ['es3', 'es5', 'es6-impl', 'es6'];\n\n/**\n * Prints to stderr and exits.\n * @param {string} message\n */\nfunction fail(message) {\n console.error(message);\n process.exit(1);\n}\n\n/**\n * Builds up a table of polyfills.\n */\nclass PolyfillTable {\n constructor() {\n /** @const {!Map>} */\n this.symbolToFile = new Map();\n /** @const {!Map>} */\n this.deps = new Map();\n /** @const {!Map} */\n this.versions = new Map();\n /** @const {!Array>} */\n this.rows = [];\n }\n\n /**\n * Returns a shim for $jscomp.polyfill.\n * @param {string} lib Library currently being scanned.\n * @return {function(string, ?Function, string, string)}\n */\n polyfill(lib) {\n return (polyfill, impl, fromLang, toLang) => {\n this.symbolToFile.set(polyfill, this.symbolToFile.get(polyfill) || []);\n this.symbolToFile.get(polyfill).push(lib);\n const row = [polyfill, fromLang, toLang];\n if (impl) {\n row.push(lib);\n this.versions.set(lib, maxVersion(this.versions.get(lib), toLang));\n }\n this.rows.push(row);\n };\n }\n\n /**\n * Reads a JS file and adds it to the table.\n * @param {string} lib Name of the library.\n * @param {string} data Contents of the file.\n */\n readFile(lib, data) {\n // Look for 'require' directives and add it to the dependency map.\n const deps = new Set();\n this.deps.set(lib, deps);\n const re = /'require ([^']+)'/g;\n let match;\n while (match = re.exec(data)) {\n match[1].split(' ').forEach(dep => deps.add(dep));\n }\n // Now run the file.\n try {\n new Function('$jscomp', data)({\n global: global,\n polyfill: this.polyfill(lib, table),\n });\n } catch (err) {\n throw new Error('Failed to parse file: ' + lib + ': ' + err);\n }\n }\n\n /**\n * Concatenates the table into a string. Throws an error if\n * there are any symbols provided by multiple files.\n * @return {string}\n */\n build() {\n const errors = new Set();\n try {\n // First check for duplicate provided symbols.\n for (const entry of this.symbolToFile.entries()) {\n if (entry[1].length != 1) {\n errors.add(\n `ERROR - ${entry[0]} provided by multiple files:${\n entry[1].map(f => '\\n ' + f).join('')}`);\n }\n }\n // Next ensure all deps have nonincreasing versions.\n checkDeps(errors, this.deps, this.versions);\n // If there are any errors, we should fail; otherwise concatenate.\n } catch (err) {\n errors.add('ERROR - uncaught exception: ' + err.stack);\n }\n if (errors.size) {\n fail(Array.from(errors).join('\\n\\n'));\n }\n return this.rows.sort().map(row => row.join(' ')).join('\\n');\n }\n}\n\n/**\n * Checks dependencies for the following issues:\n * (1) cyclic dependencies\n * (2) missing dependencies\n * (3) version mismatches\n * @param {!Set} errors\n * @param {!Map>} deps\n * @param {!Map} versions\n */\nfunction checkDeps(errors, deps, versions) {\n for (const file of deps.keys()) {\n const seen = new Set([file]);\n const queue = [file];\n const version = versions.get(file);\n while (queue.length) {\n const next = queue.shift();\n for (const dep of deps.get(next) || []) {\n if (dep == file) errors.add('ERROR - Cyclic dependency:\\n ' + dep);\n if (seen.has(dep)) continue;\n seen.add(dep);\n queue.push(dep);\n if (!deps.has(dep)) {\n errors.add(\n 'ERROR - missing dependency:\\n ' + dep +\n ' required from\\n ' + file);\n }\n const depVersion = versions.get(dep);\n if (version && maxVersion(depVersion, version) != version) {\n errors.add(\n 'ERROR - lower version depends on higher version:\\n ' +\n version + ': ' + file + '\\n ' + depVersion + ': ' + dep);\n }\n }\n }\n }\n}\n\n/**\n * Returns the higher order of the given versions.\n * @param {string} version1\n * @param {string} version2\n * @return {string} The max version.\n */\nfunction maxVersion(version1, version2) {\n return ORDER[Math.max(ORDER.indexOf(version1), ORDER.indexOf(version2))];\n}\n\nconst table = new PolyfillTable();\n\nconst reads = process.argv.slice(2).map(filename =>\n new Promise((fulfill, reject) =>\n fs.readFile(filename, 'utf8', (err, data) => {\n try {\n if (err) {\n reject(err);\n } else {\n const lib = filename.replace(/^.*?\\/js\\/|\\.js$/g, '');\n table.readFile(lib, data);\n fulfill('');\n }\n } catch (err) {\n reject(err);\n }\n })));\n\nPromise.all(reads).then(\n success => console.log(table.build()),\n failure => fail(failure.stack));\n","js/polyfills.txt":"Array.from es6-impl es3 es6/array/from\nArray.of es6-impl es3 es6/array/of\nArray.prototype.copyWithin es6-impl es3 es6/array/copywithin\nArray.prototype.entries es6-impl es3 es6/array/entries\nArray.prototype.fill es6-impl es3 es6/array/fill\nArray.prototype.find es6-impl es3 es6/array/find\nArray.prototype.findIndex es6-impl es3 es6/array/findindex\nArray.prototype.keys es6-impl es3 es6/array/keys\nArray.prototype.values es6 es3 es6/array/values\nMap es6-impl es3 es6/map\nMath.acosh es6-impl es3 es6/math/acosh\nMath.asinh es6-impl es3 es6/math/asinh\nMath.atanh es6-impl es3 es6/math/atanh\nMath.cbrt es6-impl es3 es6/math/cbrt\nMath.clz32 es6-impl es3 es6/math/clz32\nMath.cosh es6-impl es3 es6/math/cosh\nMath.expm1 es6-impl es3 es6/math/exp1m\nMath.hypot es6-impl es3 es6/math/hypot\nMath.imul es6-impl es3 es6/math/imul\nMath.log10 es6-impl es3 es6/math/log10\nMath.log1p es6-impl es3 es6/math/log1p\nMath.log2 es6-impl es3 es6/math/log2\nMath.sign es6-impl es3 es6/math/sign\nMath.sinh es6-impl es3 es6/math/sinh\nMath.tanh es6-impl es3 es6/math/tanh\nMath.trunc es6-impl es3 es6/math/trunc\nNumber.EPSILON es6-impl es3 es6/number/constants\nNumber.MAX_SAFE_INTEGER es6-impl es3 es6/number/constants\nNumber.MIN_SAFE_INTEGER es6-impl es3 es6/number/constants\nNumber.isFinite es6-impl es3 es6/number/isfinite\nNumber.isInteger es6-impl es3 es6/number/isinteger\nNumber.isNaN es6-impl es3 es6/number/isnan\nNumber.isSafeInteger es6-impl es3 es6/number/issafeinteger\nObject.assign es6-impl es3 es6/object/assign\nObject.getOwnPropertySymbols es6-impl es5 es6/object/getownpropertysymbols\nObject.is es6-impl es3 es6/object/is\nObject.setPrototypeOf es6-impl es6-impl\nProxy es6 es6\nReflect es6-impl es6-impl\nSet es6-impl es3 es6/set\nString.fromCodePoint es6-impl es3 es6/string/fromcodepoint\nString.prototype.codePointAt es6-impl es3 es6/string/codepointat\nString.prototype.endsWith es6-impl es3 es6/string/endswith\nString.prototype.includes es6-impl es3 es6/string/includes\nString.prototype.normalize es6-impl es6-impl\nString.prototype.repeat es6-impl es3 es6/string/repeat\nString.prototype.startsWith es6-impl es3 es6/string/startswith\nString.raw es6-impl es6-impl\nWeakMap es6-impl es3 es6/weakmap\nWeakSet es6-impl es3 es6/weakset\n","js/base.js":"/*\n * Copyright 2012 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @fileoverview The base namespace for code injected by the compiler\n * at compile-time.\n *\n * @author [email protected] (Nick Santos)\n */\n\n/** @const */\nvar $jscomp = {};\n\n/** @const Locals for goog.scope */\n$jscomp.scope = {};\n","js/es6/array/copywithin.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Array.prototype.copyWithin', function(orig) {\n if (orig) return orig;\n\n /**\n * Copies elements from one part of the array to another.\n *\n * @this {!IArrayLike}\n * @param {number} target Start index to copy elements to.\n * @param {number} start Start index to copy elements from.\n * @param {number=} opt_end Index from which to end copying.\n * @return {!IArrayLike} The array, with the copy performed in-place.\n * @template VALUE\n */\n var polyfill = function(target, start, opt_end) {\n var len = this.length;\n target = Number(target);\n start = Number(start);\n opt_end = Number(opt_end != null ? opt_end : len);\n if (target < start) {\n opt_end = Math.min(opt_end, len);\n while (start < opt_end) {\n if (start in this) {\n this[target++] = this[start++];\n } else {\n delete this[target++];\n start++;\n }\n }\n } else {\n opt_end = Math.min(opt_end, len + start - target);\n target += opt_end - start;\n while (opt_end > start) {\n if (--opt_end in this) {\n this[--target] = this[opt_end];\n } else {\n delete this[target];\n }\n }\n }\n return this;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/entries.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill es6/util/iteratorfromarray';\n\n$jscomp.polyfill('Array.prototype.entries', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns an iterator of [key, value] arrays, one for each entry\n * in the given array.\n *\n * @this {!IArrayLike}\n * @return {!IteratorIterable>}\n * @template VALUE\n */\n var polyfill = function() {\n return $jscomp.iteratorFromArray(\n this, function(i, v) { return [i, v]; });\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/fill.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Array.prototype.fill', function(orig) {\n if (orig) return orig;\n\n /**\n * Fills elements of an array with a constant value.\n *\n * @this {!IArrayLike}\n * @param {VALUE} value Value to fill.\n * @param {number=} opt_start Start index, or zero if omitted.\n * @param {number=} opt_end End index, or length if omitted.\n * @return {!IArrayLike} The array, with the fill performed in-place.\n * @template VALUE\n */\n var polyfill = function(value, opt_start, opt_end) {\n var length = this.length || 0;\n if (opt_start < 0) {\n opt_start = Math.max(0, length + /** @type {number} */ (opt_start));\n }\n if (opt_end == null || opt_end > length) opt_end = length;\n opt_end = Number(opt_end);\n if (opt_end < 0) opt_end = Math.max(0, length + opt_end);\n for (var i = Number(opt_start || 0); i < opt_end; i++) {\n this[i] = value;\n }\n return this;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/find.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/findinternal util/polyfill';\n\n$jscomp.polyfill('Array.prototype.find', function(orig) {\n if (orig) return orig;\n\n /**\n * Finds and returns an element that satisfies the given predicate.\n *\n * @this {!IArrayLike}\n * @param {function(this: THIS, VALUE, number, !IArrayLike): *}\n * callback\n * @param {THIS=} opt_thisArg\n * @return {VALUE|undefined} The found value, or undefined.\n * @template VALUE, THIS\n */\n var polyfill = function(callback, opt_thisArg) {\n return $jscomp.findInternal(this, callback, opt_thisArg).v;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/findindex.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/findinternal util/polyfill';\n\n$jscomp.polyfill('Array.prototype.findIndex', function(orig) {\n if (orig) return orig;\n\n /**\n * Finds an element that satisfies the given predicate, returning its index.\n *\n * @this {!IArrayLike}\n * @param {function(this: THIS, VALUE, number, !IArrayLike): *}\n * callback\n * @param {THIS=} opt_thisArg\n * @return {number} The found value, or undefined.\n * @template VALUE, THIS\n */\n var polyfill = function(callback, opt_thisArg) {\n return $jscomp.findInternal(this, callback, opt_thisArg).i;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/from.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/symbol util/polyfill';\n\n$jscomp.polyfill('Array.from', function(orig) {\n if (orig) return orig;\n\n /**\n * Creates a new Array from an array-like or iterable object.\n *\n * Polyfills the static function Array.from(). Does not support\n * constructor inheritance (i.e. (subclass of Array).from), and\n * relies on the compiler to check the validity of inputs rather\n * than producing spec-compliant TypeErrors.\n *\n * @param {!IArrayLike |!Iterable } arrayLike\n * An array-like or iterable.\n * @param {(function(this: THIS, INPUT): OUTPUT)=} opt_mapFn\n * Function to call on each argument.\n * @param {THIS=} opt_thisArg\n * Object to use as 'this' when calling mapFn.\n * @return {!Array}\n * @template INPUT, OUTPUT, THIS\n */\n var polyfill = function(arrayLike, opt_mapFn, opt_thisArg) {\n $jscomp.initSymbolIterator();\n opt_mapFn = opt_mapFn != null ? opt_mapFn : function(x) { return x; };\n var result = [];\n // NOTE: this is cast to ? because [] on @struct is an error\n var iteratorFunction = /** @type {?} */ (arrayLike)[Symbol.iterator];\n if (typeof iteratorFunction == 'function') {\n arrayLike = iteratorFunction.call(arrayLike);\n var next;\n while (!(next = arrayLike.next()).done) {\n result.push(\n opt_mapFn.call(/** @type {?} */ (opt_thisArg), next.value));\n }\n } else {\n var len = arrayLike.length; // need to support non-iterables\n for (var i = 0; i < len; i++) {\n result.push(\n opt_mapFn.call(/** @type {?} */ (opt_thisArg), arrayLike[i]));\n }\n }\n return result;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/keys.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/util/iteratorfromarray util/polyfill';\n\n$jscomp.polyfill('Array.prototype.keys', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns an iterator of keys of the given array.\n *\n * @this {!IArrayLike}\n * @return {!IteratorIterable}\n */\n var polyfill = function() {\n return $jscomp.iteratorFromArray(this, function(i) { return i; });\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/of.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/array/from util/polyfill';\n\n$jscomp.polyfill('Array.of', function(orig) {\n if (orig) return orig;\n\n /**\n * Creates an array from a fixed set of arguments.\n *\n * Polyfills the static function Array.of(). Does not support\n * constructor inheritance (i.e. (subclass of Array).of).\n *\n * @param {...T} var_args Elements to include in the array.\n * @return {!Array}\n * @template T\n */\n var polyfill = function(var_args) {\n return Array.from(arguments);\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/array/values.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/util/iteratorfromarray util/polyfill';\n\n$jscomp.polyfill('Array.prototype.values', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns an iterator of values of the given array.\n *\n * @this {!IArrayLike}\n * @return {!IteratorIterable}\n * @template VALUE\n */\n var polyfill = function() {\n return $jscomp.iteratorFromArray(this, function(k, v) { return v; });\n };\n\n return polyfill;\n}, 'es6', 'es3');\n","js/es6/array.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Brings in all ES6 Array polyfills.\n */\n'require es6/array/copywithin es6/array/entries es6/array/fill';\n'require es6/array/find es6/array/findindex es6/array/from';\n'require es6/array/keys es6/array/of es6/array/values';\n","js/es6/map.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/symbol es6/util/makeiterator es6/weakmap util/owns util/polyfill';\n\n/**\n * Whether to skip the conformance check and simply use the polyfill always.\n * @define {boolean}\n */\n$jscomp.ASSUME_NO_NATIVE_MAP = false;\n\n$jscomp.polyfill('Map', function(NativeMap) {\n\n // Perform a conformance check to ensure correct native implementation.\n var isConformant = !$jscomp.ASSUME_NO_NATIVE_MAP && (function() {\n if (!NativeMap ||\n !NativeMap.prototype.entries ||\n typeof Object.seal != 'function') {\n return false;\n }\n // Some implementations don't support constructor arguments.\n /** @preserveTry */\n try {\n NativeMap = /** @type {function(new: Map, !Iterator=)} */ (NativeMap);\n var key = Object.seal({x: 4});\n var map = new NativeMap($jscomp.makeIterator([[key, 's']]));\n if (map.get(key) != 's' || map.size != 1 || map.get({x: 4}) ||\n map.set({x: 4}, 't') != map || map.size != 2) {\n return false;\n }\n var /** !Iterator */ iter = map.entries();\n var item = iter.next();\n if (item.done || item.value[0] != key || item.value[1] != 's') {\n return false;\n }\n item = iter.next();\n if (item.done || item.value[0].x != 4 ||\n item.value[1] != 't' || !iter.next().done) {\n return false;\n }\n return true;\n } catch (err) { // This should hopefully never happen, but let's be safe.\n return false;\n }\n })();\n if (isConformant) return NativeMap;\n\n // We depend on Symbol.iterator, so ensure it's loaded.\n $jscomp.initSymbol();\n $jscomp.initSymbolIterator();\n\n\n /** @const {!WeakMap} */\n var idMap = new WeakMap();\n\n\n /**\n * Internal record type for entries.\n * @record\n * @template KEY, VALUE\n */\n var MapEntry = function() {};\n\n\n /** @type {!MapEntry} */\n MapEntry.prototype.previous;\n\n\n /** @type {!MapEntry} */\n MapEntry.prototype.next;\n\n\n /** @type {?Object} */\n MapEntry.prototype.head;\n\n\n /** @type {KEY} */\n MapEntry.prototype.key;\n\n\n /** @type {VALUE} */\n MapEntry.prototype.value;\n\n\n /**\n * Polyfill for the global Map data type.\n * @constructor\n * @struct\n * @implements {Iterable>}\n * @template KEY, VALUE\n * @param {!Iterable>|!Array>|null=}\n * opt_iterable Optional data to populate the map.\n */\n // TODO(sdh): fix param type if heterogeneous arrays ever supported.\n var PolyfillMap = function(opt_iterable) {\n /** @private {!Object>>} */\n this.data_ = {};\n\n /** @private {!MapEntry} */\n this.head_ = createHead();\n\n // Note: this property should not be changed. If we're willing to give up\n // ES3 support, we could define it as a property directly. It should be\n // marked readonly if such an annotation ever comes into existence.\n /** @type {number} */\n this.size = 0;\n\n if (opt_iterable) {\n var iter = $jscomp.makeIterator(opt_iterable);\n var entry;\n while (!(entry = iter.next()).done) {\n var item =\n /** @type {!IIterableResult>} */ (entry).value;\n this.set(/** @type {KEY} */ (item[0]), /** @type {VALUE} */ (item[1]));\n }\n }\n };\n\n\n /**\n * Adds or updates a value in the map.\n * @param {KEY} key\n * @param {VALUE} value\n */\n PolyfillMap.prototype.set = function(key, value) {\n var r = maybeGetEntry(this, key);\n if (!r.list) {\n r.list = (this.data_[r.id] = []);\n }\n if (!r.entry) {\n r.entry = {\n next: this.head_,\n previous: this.head_.previous,\n head: this.head_,\n key: key,\n value: value,\n };\n r.list.push(r.entry);\n this.head_.previous.next = r.entry;\n this.head_.previous = r.entry;\n this.size++;\n } else {\n r.entry.value = value;\n }\n return this;\n };\n\n\n /**\n * Deletes an element from the map.\n * @param {KEY} key\n * @return {boolean} Whether the entry was deleted.\n */\n PolyfillMap.prototype.delete = function(key) {\n var r = maybeGetEntry(this, key);\n if (r.entry && r.list) {\n r.list.splice(r.index, 1);\n if (!r.list.length) delete this.data_[r.id];\n r.entry.previous.next = r.entry.next;\n r.entry.next.previous = r.entry.previous;\n r.entry.head = null;\n this.size--;\n return true;\n }\n return false;\n };\n\n\n /**\n * Clears the map.\n */\n PolyfillMap.prototype.clear = function() {\n this.data_ = {};\n this.head_ = this.head_.previous = createHead();\n this.size = 0;\n };\n\n\n /**\n * Checks whether the given key is in the map.\n * @param {KEY} key\n * @return {boolean} True if the map contains the given key.\n */\n PolyfillMap.prototype.has = function(key) {\n return !!(maybeGetEntry(this, key).entry);\n };\n\n\n /**\n * Retrieves an element from the map, by key.\n * @param {KEY} key\n * @return {VALUE}\n */\n PolyfillMap.prototype.get = function(key) {\n var entry = maybeGetEntry(this, key).entry;\n // NOTE: this cast is a lie, but so is the extern.\n return /** @type {VALUE} */ (entry && entry.value);\n };\n\n\n /**\n * Returns an iterator of entries.\n * @return {!IteratorIterable>}\n */\n PolyfillMap.prototype.entries = function() {\n return makeIterator(\n this, function(entry) { return [entry.key, entry.value]; });\n };\n\n\n /**\n * Returns an iterator of keys.\n * @return {!IteratorIterable}\n */\n PolyfillMap.prototype.keys = function() {\n return makeIterator(this, function(entry) { return entry.key; });\n };\n\n\n /**\n * Returns an iterator of values.\n * @return {!IteratorIterable}\n */\n PolyfillMap.prototype.values = function() {\n return makeIterator(this, function(entry) { return entry.value; });\n };\n\n\n /**\n * Iterates over the map, running the given function on each element.\n * @param {function(this: THIS, VALUE, KEY, !PolyfillMap)}\n * callback\n * @param {THIS=} opt_thisArg\n * @template THIS\n */\n PolyfillMap.prototype.forEach = function(callback, opt_thisArg) {\n var iter = this.entries();\n var item;\n while (!(item = iter.next()).done) {\n var entry = item.value;\n callback.call(\n /** @type {?} */ (opt_thisArg),\n /** @type {VALUE} */ (entry[1]),\n /** @type {KEY} */ (entry[0]),\n this);\n }\n };\n\n\n /**\n * Returns an iterator of entries.\n * @return {!IteratorIterable>}\n */\n PolyfillMap.prototype[Symbol.iterator] = PolyfillMap.prototype.entries;\n\n\n /**\n * Returns an entry or undefined.\n * @param {!PolyfillMap} map\n * @param {KEY} key\n * @return {{id: string,\n * list: (!Array>|undefined),\n * index: number,\n * entry: (!MapEntry|undefined)}}\n * @template KEY, VALUE\n */\n var maybeGetEntry = function(map, key) {\n var id = getId(key);\n var list = map.data_[id];\n if (list && $jscomp.owns(map.data_, id)) {\n for (var index = 0; index < list.length; index++) {\n var entry = list[index];\n if ((key !== key && entry.key !== entry.key) || key === entry.key) {\n return {id: id, list: list, index: index, entry: entry};\n }\n }\n }\n return {id: id, list: list, index: -1, entry: undefined};\n };\n\n\n /**\n * Maps over the entries with the given function.\n * @param {!PolyfillMap} map\n * @param {function(!MapEntry): T} func\n * @return {!IteratorIterable}\n * @template KEY, VALUE, T\n * @private\n */\n var makeIterator = function(map, func) {\n var entry = map.head_;\n var iter = {\n next: function() {\n if (entry) {\n while (entry.head != map.head_) {\n entry = entry.previous;\n }\n while (entry.next != entry.head) {\n entry = entry.next;\n return {done: false, value: func(entry)};\n }\n entry = null; // make sure depletion is permanent\n }\n return {done: true, value: void 0};\n }\n };\n iter[Symbol.iterator] = function() {\n return /** @type {!Iterator} */ (iter);\n };\n return /** @type {!IteratorIterable} */ (iter);\n };\n\n\n /**\n * Makes a new \"head\" element.\n * @return {!MapEntry}\n * @template KEY, VALUE\n * @suppress {checkTypes} ignore missing key/value for head only\n */\n var createHead = function() {\n var head = /** type {!MapEntry} */ ({});\n head.previous = head.next = head.head = head;\n return head;\n };\n\n\n /**\n * Counter for generating IDs.\n * @private {number}\n */\n var mapIndex = 0;\n\n\n /**\n * @param {*} obj An extensible object.\n * @return {string} A unique ID.\n */\n var getId = function(obj) {\n var type = obj && typeof obj;\n if (type == 'object' || type == 'function') {\n obj = /** @type {!Object} */ (obj);\n if (!idMap.has(obj)) {\n var id = '' + (++mapIndex);\n idMap.set(obj, id);\n return id;\n }\n return idMap.get(obj);\n }\n // Add a prefix since obj could be '__proto__';\n return 'p_' + obj;\n };\n\n\n return PolyfillMap;\n}, 'es6-impl', 'es3');\n","js/es6/math/acosh.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.acosh', function(orig) {\n if (orig) return orig;\n\n /**\n * Computes the inverse hyperbolic cosine.\n *\n * Polyfills the static function Math.acosh().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The inverse hyperbolic cosine of x.\n */\n var polyfill = function(x) {\n x = Number(x);\n return Math.log(x + Math.sqrt(x * x - 1));\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/asinh.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.asinh', function(orig) {\n if (orig) return orig;\n\n /**\n * Computes the inverse hyperbolic sine.\n *\n *
Polyfills the static function Math.asinh().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The inverse hyperbolic sine of x.\n */\n var polyfill = function(x) {\n x = Number(x);\n if (x === 0) return x;\n var y = Math.log(Math.abs(x) + Math.sqrt(x * x + 1));\n return x < 0 ? -y : y;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/atanh.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill es6/math/log1p';\n\n$jscomp.polyfill('Math.atanh', function(orig) {\n if (orig) return orig;\n var log1p = Math.log1p;\n\n /**\n * Computes the inverse hyperbolic tangent.\n *\n *
Polyfills the static function Math.atanh().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The inverse hyperbolic tangent +x.\n */\n var polyfill = function(x) {\n x = Number(x);\n return (log1p(x) - log1p(-x)) / 2;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/cbrt.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.cbrt', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns the cube root of the number, handling negatives safely.\n *\n *
Polyfills the static function Math.cbrt().\n *\n * @param {number} x Any number, or value that can be coerced into a number.\n * @return {number} The cube root of x.\n */\n var polyfill = function(x) {\n if (x === 0) return x;\n x = Number(x);\n var y = Math.pow(Math.abs(x), 1 / 3);\n return x < 0 ? -y : y;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/clz32.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.clz32', function(orig) {\n if (orig) return orig;\n\n /**\n * Counts the leading zeros in the 32-bit binary representation.\n *\n *
Polyfills the static function Math.clz32().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The number of leading zero bits.\n */\n var polyfill = function(x) {\n // This binary search algorithm is taken from v8.\n x = Number(x) >>> 0; // first ensure we have a 32-bit unsigned integer.\n if (x === 0) return 32;\n var result = 0;\n if ((x & 0xFFFF0000) === 0) {\n x <<= 16;\n result += 16;\n }\n if ((x & 0xFF000000) === 0) {\n x <<= 8;\n result += 8;\n }\n if ((x & 0xF0000000) === 0) {\n x <<= 4;\n result += 4;\n }\n if ((x & 0xC0000000) === 0) {\n x <<= 2;\n result += 2;\n }\n if ((x & 0x80000000) === 0) result++;\n return result;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/cosh.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.cosh', function(orig) {\n if (orig) return orig;\n var exp = Math.exp;\n\n /**\n * Computes the hyperbolic cosine.\n *\n *
Polyfills the static function Math.cosh().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The hyperbolic cosine of x.\n */\n var polyfill = function(x) {\n x = Number(x);\n return (exp(x) + exp(-x)) / 2;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/exp1m.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.expm1', function(orig) {\n if (orig) return orig;\n\n /**\n * Exponentiates x and then subtracts one. This is implemented in a\n * way that is accurate for numbers close to zero.\n *\n *
Polyfills the static function Math.expm1().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The exponential of x, less 1.\n */\n var polyfill = function(x) {\n // This implementation is based on the Taylor expansion\n // exp(x) ~ 1 + x + x^2/2 + x^3/6 + x^4/24 + ...\n x = Number(x);\n if (x < .25 && x > -.25) {\n var y = x;\n var d = 1;\n var z = x;\n var zPrev = 0;\n while (zPrev != z) {\n y *= x / (++d);\n z = (zPrev = z) + y;\n }\n return z;\n }\n return Math.exp(x) - 1;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/hypot.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.hypot', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns the sum of its arguments in quadrature.\n *\n *
Polyfills the static function Math.hypot().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @param {number} y Any number, or value that can be coerced to a number.\n * @param {...*} var_args More numbers.\n * @return {number} The square root of the sum of the squares.\n */\n var polyfill = function(x, y, var_args) {\n // Make the type checker happy.\n x = Number(x);\n y = Number(y);\n var i, z, sum;\n // Note: we need to normalize the numbers in case of over/underflow.\n var max = Math.max(Math.abs(x), Math.abs(y));\n for (i = 2; i < arguments.length; i++) {\n max = Math.max(max, Math.abs(arguments[i]));\n }\n if (max > 1e100 || max < 1e-100) {\n x = x / max;\n y = y / max;\n sum = x * x + y * y;\n for (i = 2; i < arguments.length; i++) {\n z = Number(arguments[i]) / max;\n sum += z * z;\n }\n return Math.sqrt(sum) * max;\n } else {\n sum = x * x + y * y;\n for (i = 2; i < arguments.length; i++) {\n z = Number(arguments[i]);\n sum += z * z;\n }\n return Math.sqrt(sum);\n }\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/imul.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.imul', function(orig) {\n if (orig) return orig;\n\n /**\n * Performs C-like 32-bit signed integer multiplication.\n *\n *
Polyfills the static function Math.imul().\n *\n * @param {number} a Any number, or value that can be coerced to a number.\n * @param {number} b Any number, or value that can be coerced to a number.\n * @return {number} The 32-bit integer product of a and b.\n */\n var polyfill = function(a, b) {\n // This algorithm is taken from v8.\n // Note: If multiplication overflows 32 bits, then we risk losing\n // precision. We must therefore break the inputs into 16-bit\n // words and multiply separately.\n a = Number(a);\n b = Number(b);\n var ah = (a >>> 16) & 0xFFFF; // Treat individual words as unsigned\n var al = a & 0xFFFF;\n var bh = (b >>> 16) & 0xFFFF;\n var bl = b & 0xFFFF;\n var lh = ((ah * bl + al * bh) << 16) >>> 0; // >>> 0 casts to uint\n return (al * bl + lh) | 0; // | 0 casts back to signed\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/log10.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.log10', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns the base-10 logarithm.\n *\n *
Polyfills the static function Math.log10().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The common log of x.\n */\n var polyfill = function(x) {\n return Math.log(x) / Math.LN10;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/log1p.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.log1p', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns the natural logarithm of 1+x, implemented in a way that is\n * accurate for numbers close to zero.\n *\n *
Polyfills the static function Math.log1p().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The natural log of 1+x.\n */\n var polyfill = function(x) {\n // This implementation is based on the Taylor expansion\n // log(1 + x) ~ x - x^2/2 + x^3/3 - x^4/4 + x^5/5 - ...\n x = Number(x);\n if (x < 0.25 && x > -0.25) {\n var y = x;\n var d = 1;\n var z = x;\n var zPrev = 0;\n var s = 1;\n while (zPrev != z) {\n y *= x;\n s *= -1;\n z = (zPrev = z) + s * y / (++d);\n }\n return z;\n }\n return Math.log(1 + x);\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/log2.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.log2', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns the base-2 logarithm.\n *\n *
Polyfills the static function Math.log2().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The base-2 log of x.\n */\n var polyfill = function(x) {\n return Math.log(x) / Math.LN2;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/sign.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.sign', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns the sign of the number, indicating whether it is\n * positive, negative, or zero.\n *\n *
Polyfills the static function Math.sign().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The sign, +1 if x is positive, -1 if x is\n * negative, or 0 if x is zero.\n */\n var polyfill = function(x) {\n x = Number(x);\n return x === 0 || isNaN(x) ? x : x > 0 ? 1 : -1;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/sinh.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.sinh', function(orig) {\n if (orig) return orig;\n var exp = Math.exp;\n\n /**\n * Computes the hyperbolic sine.\n *\n *
Polyfills the static function Math.sinh().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The hyperbolic sine of x.\n */\n var polyfill = function(x) {\n x = Number(x);\n if (x === 0) return x;\n return (exp(x) - exp(-x)) / 2;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/tanh.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.tanh', function(orig) {\n if (orig) return orig;\n\n /**\n * Computes the hyperbolic tangent.\n *\n *
Polyfills the static function Math.tanh().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number} The hyperbolic tangent of x.\n */\n var polyfill = function(x) {\n x = Number(x);\n if (x === 0) return x;\n // Ensure exponent is negative to prevent overflow.\n var y = Math.exp(-2 * Math.abs(x));\n var z = (1 - y) / (1 + y);\n return x < 0 ? -z : z;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math/trunc.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Math.trunc', function(orig) {\n if (orig) return orig;\n\n /**\n * Truncates any fractional digits from its argument (towards zero).\n *\n *
Polyfills the static function Math.trunc().\n *\n * @param {number} x Any number, or value that can be coerced to a number.\n * @return {number}\n */\n var polyfill = function(x) {\n x = Number(x);\n if (isNaN(x) || x === Infinity || x === -Infinity || x === 0) return x;\n var y = Math.floor(Math.abs(x));\n return x < 0 ? -y : y;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/math.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Brings in all ES6 Math polyfills.\n */\n'require es6/math/acosh es6/math/asinh es6/math/atanh es6/math/cbrt';\n'require es6/math/clz32 es6/math/cosh es6/math/exp1m es6/math/hypot';\n'require es6/math/imul es6/math/log10 es6/math/log1p es6/math/log2';\n'require es6/math/sign es6/math/sinh es6/math/tanh es6/math/trunc';\n","js/es6/nopolyfill.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @fileoverview Specifies objects that the compiler does NOT polyfill.\n * NOTE: this file should never be injected, since all the implementations\n * are null.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Proxy', null, 'es6', 'es6');\n\n$jscomp.polyfill('Reflect', null, 'es6-impl', 'es6-impl');\n$jscomp.polyfill('Object.setPrototypeOf', null, 'es6-impl', 'es6-impl');\n$jscomp.polyfill('String.raw', null, 'es6-impl', 'es6-impl');\n$jscomp.polyfill('String.prototype.normalize', null, 'es6-impl', 'es6-impl');\n","js/es6/number/constants.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n\n$jscomp.polyfill('Number.EPSILON', function(orig) {\n /**\n * The difference 1 and the smallest number greater than 1.\n *\n *
Polyfills the static field Number.EPSILON.\n */\n return Math.pow(2, -52);\n}, 'es6-impl', 'es3');\n\n\n$jscomp.polyfill('Number.MAX_SAFE_INTEGER', function() {\n /**\n * The maximum safe integer, 2^53 - 1.\n *\n *
Polyfills the static field Number.MAX_SAFE_INTEGER.\n */\n return 0x1fffffffffffff;\n}, 'es6-impl', 'es3');\n\n\n$jscomp.polyfill('Number.MIN_SAFE_INTEGER', function() {\n /**\n * The minimum safe integer, -(2^53 - 1).\n *\n *
Polyfills the static field Number.MIN_SAFE_INTEGER.\n */\n return -0x1fffffffffffff;\n}, 'es6-impl', 'es3');\n","js/es6/number/isfinite.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Number.isFinite', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns whether the given argument is a finite number.\n *\n *
Polyfills the static function Number.isFinite().\n *\n * @param {number} x Any value.\n * @return {boolean} True if x is a number and not NaN or infinite.\n */\n var polyfill = function(x) {\n if (typeof x !== 'number') return false;\n return !isNaN(x) && x !== Infinity && x !== -Infinity;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/number/isinteger.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/number/isfinite util/polyfill';\n\n$jscomp.polyfill('Number.isInteger', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns whether the given argument is an integer.\n *\n *
Polyfills the static function Number.isInteger().\n *\n * @param {number} x Any value.\n * @return {boolean} True if x is an integer.\n */\n var polyfill = function(x) {\n if (!Number.isFinite(x)) return false;\n return x === Math.floor(x);\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/number/isnan.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Number.isNaN', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns whether the given argument is the value NaN,\n * guaranteeing not to coerce to a number first.\n *\n *
Polyfills the static function Number.isNaN().\n *\n * @param {number} x Any value.\n * @return {boolean} True if x is exactly NaN.\n */\n var polyfill = function(x) {\n return typeof x === 'number' && isNaN(x);\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/number/issafeinteger.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/number/constants es6/number/isinteger util/polyfill';\n\n$jscomp.polyfill('Number.isSafeInteger', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns whether the given argument is a \"safe\" integer,\n * that is, its magnitude is less than 2^53.\n *\n *
Polyfills the static function Number.isSafeInteger().\n *\n * @param {number} x Any value.\n * @return {boolean} True if x is a safe integer.\n */\n var polyfill = function(x) {\n return Number.isInteger(x) && Math.abs(x) <= Number.MAX_SAFE_INTEGER;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/number.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Brings in all ES6 Number polyfills.\n */\n'require es6/number/constants es6/number/isfinite es6/number/isinteger';\n'require es6/number/isnan es6/number/issafeinteger';\n","js/es6/object/assign.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/owns util/polyfill';\n\n$jscomp.polyfill('Object.assign', function(orig) {\n if (orig) return orig;\n\n /**\n * Polyfill for Object.assign() method:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n *\n * Copies values of all enumerable own properties from one or more\n * sources to the given target object, and returns the target.\n * @param {!Object} target The target object onto which to copy.\n * @param {...?Object} var_args The source objects.\n * @return {!Object} The target object is returned.\n */\n var polyfill = function(target, var_args) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n if (!source) continue;\n for (var key in source) {\n if ($jscomp.owns(source, key)) target[key] = source[key];\n }\n }\n return target;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/object/getownpropertysymbols.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/owns util/polyfill';\n\n$jscomp.polyfill('Object.getOwnPropertySymbols', function(orig) {\n if (orig) return orig;\n\n // Note: this is patched by $jscomp.initSymbol when needed.\n return function() { return []; };\n}, 'es6-impl', 'es5'); // only works correctly with Object.getOwnPropertyNames\n","js/es6/object/is.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('Object.is', function(orig) {\n if (orig) return orig;\n\n /**\n * Polyfill for Object.is() method:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n *\n * Determines whether two values are the same value (that is,\n * functionally equivalent). This is the same as ===-equality,\n * except for two cases: 0 is not the same as -0, and NaN is\n * the same as NaN.\n *\n * @param {*} left\n * @param {*} right\n * @return {boolean}\n */\n var polyfill = function(left, right) {\n if (left === right) {\n // Handle the 0 === -0 exception\n return (left !== 0) || (1 / left === 1 / /** @type {number} */ (right));\n } else {\n // Handle the NaN !== NaN exception\n return (left !== left) && (right !== right);\n }\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/object.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Brings in all ES6 Object polyfills.\n */\n'require es6/object/assign es6/object/getownpropertysymbols es6/object/is';\n","js/es6/set.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/symbol es6/map util/polyfill';\n\n/**\n * Whether to skip the conformance check and simply use the polyfill always.\n * @define {boolean}\n */\n$jscomp.ASSUME_NO_NATIVE_SET = false;\n\n$jscomp.polyfill('Set', function(NativeSet) {\n\n // Perform a conformance check to ensure correct native implementation.\n var isConformant = !$jscomp.ASSUME_NO_NATIVE_SET && (function() {\n if (!NativeSet ||\n !NativeSet.prototype.entries ||\n typeof Object.seal != 'function') {\n return false;\n }\n // Some implementations don't support constructor arguments.\n try {\n NativeSet = /** @type {function(new: Set, !Iterator=)} */ (NativeSet);\n var value = Object.seal({x: 4});\n var set = new NativeSet($jscomp.makeIterator([value]));\n if (!set.has(value) || set.size != 1 || set.add(value) != set ||\n set.size != 1 || set.add({x: 4}) != set || set.size != 2) {\n return false;\n }\n var iter = set.entries();\n var item = iter.next();\n if (item.done || item.value[0] != value || item.value[1] != value) {\n return false;\n }\n item = iter.next();\n if (item.done || item.value[0] == value || item.value[0].x != 4 ||\n item.value[1] != item.value[0]) {\n return false;\n }\n return iter.next().done;\n } catch (err) { // This should hopefully never happen, but let's be safe.\n return false;\n }\n })();\n if (isConformant) return NativeSet;\n\n // We depend on Symbol.iterator, so ensure it's loaded.\n $jscomp.initSymbol();\n $jscomp.initSymbolIterator();\n\n\n\n /**\n * Polyfill for the global Map data type.\n * @constructor\n * @struct\n * @implements {Iterable}\n * @template KEY, VALUE\n * @param {!Iterable|!Array|null=} opt_iterable\n * Optional data to populate the set.\n */\n // TODO(sdh): fix param type if heterogeneous arrays ever supported.\n var PolyfillSet = function(opt_iterable) {\n /** @private @const {!Map} */\n this.map_ = new Map();\n if (opt_iterable) {\n var iter = $jscomp.makeIterator(opt_iterable);\n var entry;\n while (!(entry = iter.next()).done) {\n var item = /** @type {!IIterableResult} */ (entry).value;\n this.add(item);\n }\n }\n // Note: this property should not be changed. If we're willing to give up\n // ES3 support, we could define it as a property directly. It should be\n // marked readonly if such an annotation ever comes into existence.\n this.size = this.map_.size;\n };\n\n\n /**\n * Adds or updates a value in the set.\n * @param {VALUE} value\n */\n PolyfillSet.prototype.add = function(value) {\n this.map_.set(value, value);\n this.size = this.map_.size;\n return this;\n };\n\n\n /**\n * Deletes an element from the set.\n * @param {VALUE} value\n * @return {boolean}\n */\n PolyfillSet.prototype.delete = function(value) {\n var result = this.map_.delete(value);\n this.size = this.map_.size;\n return result;\n };\n\n\n /** Clears the set. */\n PolyfillSet.prototype.clear = function() {\n this.map_.clear();\n this.size = 0;\n };\n\n\n /**\n * Checks whether the given value is in the set.\n * @param {VALUE} value\n * @return {boolean} True if the set contains the given value.\n */\n PolyfillSet.prototype.has = function(value) {\n return this.map_.has(value);\n };\n\n\n /**\n * Returns an iterator of entries.\n * @return {!IteratorIterable>}\n */\n PolyfillSet.prototype.entries = function() {\n return this.map_.entries();\n };\n\n\n /**\n * Returns an iterator of entries.\n * @return {!IteratorIterable}\n */\n PolyfillSet.prototype[Symbol.iterator] = function() {\n return this.map_.values();\n };\n\n\n /**\n * Returns an iterator of values.\n * @return {!IteratorIterable}\n */\n PolyfillSet.prototype.values = function() {\n return this.map_.values();\n };\n\n\n /**\n * Iterates over the set, running the given function on each element.\n * @param {function(this: THIS, VALUE, VALUE, !PolyfillSet)} callback\n * @param {THIS=} opt_thisArg\n * @template THIS\n */\n PolyfillSet.prototype.forEach = function(callback, opt_thisArg) {\n var set = this;\n this.map_.forEach(function(value) {\n return callback.call(/** @type {?} */ (opt_thisArg), value, value, set);\n });\n };\n\n\n return PolyfillSet;\n}, 'es6-impl', 'es3');\n","js/es6/string/codepointat.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/checkstringargs util/polyfill';\n\n$jscomp.polyfill('String.prototype.codePointAt', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns the UTF-16 codepoint at the given index.\n *\n * Polyfills the instance method String.prototype.codePointAt().\n *\n * @this {string}\n * @param {number} position\n * @return {number|undefined} The codepoint.\n */\n var polyfill = function(position) {\n // NOTE: this is taken from v8's harmony-string.js StringCodePointAt\n 'use strict';\n var string = $jscomp.checkStringArgs(this, null, 'codePointAt');\n var size = string.length;\n // Make 'position' a number (non-number coerced to NaN and then or to zero).\n position = Number(position) || 0;\n if (!(position >= 0 && position < size)) {\n return void 0;\n }\n // Truncate 'position' to an integer.\n position = position | 0;\n var first = string.charCodeAt(position);\n if (first < 0xD800 || first > 0xDBFF || position + 1 === size) {\n return first;\n }\n var second = string.charCodeAt(position + 1);\n if (second < 0xDC00 || second > 0xDFFF) {\n return first;\n }\n return (first - 0xD800) * 0x400 + second + 0x2400;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/string/endswith.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/checkstringargs util/polyfill';\n\n$jscomp.polyfill('String.prototype.endsWith', function(orig) {\n if (orig) return orig;\n\n /**\n * Tests whether the string ends with a given substring.\n *\n *
Polyfills the instance method String.prototype.endsWith().\n *\n * @this {string}\n * @param {string} searchString\n * @param {number=} opt_position\n * @return {boolean}\n */\n var polyfill = function(searchString, opt_position) {\n 'use strict';\n var string = $jscomp.checkStringArgs(this, searchString, 'endsWith');\n searchString = searchString + '';\n if (opt_position === void 0) opt_position = string.length;\n var i = Math.max(0, Math.min(opt_position | 0, string.length));\n var j = searchString.length;\n while (j > 0 && i > 0) {\n if (string[--i] != searchString[--j]) return false;\n }\n return j <= 0;\n };\nreturn polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/string/fromcodepoint.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/polyfill';\n\n$jscomp.polyfill('String.fromCodePoint', function(orig) {\n if (orig) return orig;\n\n /**\n * Creates a new string from the given codepoints.\n *\n *
Polyfills the static function String.fromCodePoint().\n *\n * @param {...number} var_args\n * @return {string}\n */\n var polyfill = function(var_args) {\n // Note: this is taken from v8's harmony-string.js StringFromCodePoint.\n var result = '';\n for (var i = 0; i < arguments.length; i++) {\n var code = Number(arguments[i]);\n if (code < 0 || code > 0x10FFFF || code !== Math.floor(code)) {\n throw new RangeError('invalid_code_point ' + code);\n }\n if (code <= 0xFFFF) {\n result += String.fromCharCode(code);\n } else {\n code -= 0x10000;\n result += String.fromCharCode((code >>> 10) & 0x3FF | 0xD800);\n result += String.fromCharCode(code & 0x3FF | 0xDC00);\n }\n }\n return result;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/string/includes.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/checkstringargs util/polyfill';\n\n$jscomp.polyfill('String.prototype.includes', function(orig) {\n if (orig) return orig;\n\n /**\n * Searches for a substring, starting at the given position.\n *\n *
Polyfills the instance method String.prototype.includes().\n *\n * @this {string}\n * @param {string} searchString\n * @param {number=} opt_position\n * @return {boolean}\n */\n var polyfill = function(searchString, opt_position) {\n 'use strict';\n var string = $jscomp.checkStringArgs(this, searchString, 'includes');\n return string.indexOf(searchString, opt_position || 0) !== -1;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/string/repeat.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/checkstringargs util/polyfill';\n\n$jscomp.polyfill('String.prototype.repeat', function(orig) {\n if (orig) return orig;\n\n /**\n * Returns a new string repeated the given number of times.\n *\n *
Polyfills the instance method String.prototype.repeat().\n *\n * @this {string}\n * @param {number} copies\n * @return {string}\n */\n var polyfill = function(copies) {\n 'use strict';\n var string = $jscomp.checkStringArgs(this, null, 'repeat');\n if (copies < 0 || copies > 0x4FFFFFFF) { // impose a 1GB limit\n throw new RangeError('Invalid count value');\n }\n copies = copies | 0; // cast to a signed integer.\n var result = '';\n while (copies) {\n if (copies & 1) result += string;\n if ((copies >>>= 1)) string += string;\n }\n return result;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/string/startswith.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/checkstringargs util/polyfill';\n\n$jscomp.polyfill('String.prototype.startsWith', function(orig) {\n if (orig) return orig;\n\n /**\n * Tests whether the string starts with a given substring.\n *\n *
Polyfills the instance method String.prototype.startsWith().\n *\n * @this {string}\n * @param {string} searchString\n * @param {number=} opt_position\n * @return {boolean}\n */\n var polyfill = function(searchString, opt_position) {\n 'use strict';\n var string = $jscomp.checkStringArgs(this, searchString, 'startsWith');\n searchString = searchString + '';\n var strLen = string.length;\n var searchLen = searchString.length;\n var i = Math.max(\n 0,\n Math.min(/** @type {number} */ (opt_position) | 0, string.length));\n var j = 0;\n while (j < searchLen && i < strLen) {\n if (string[i++] != searchString[j++]) return false;\n }\n return j >= searchLen;\n };\n\n return polyfill;\n}, 'es6-impl', 'es3');\n","js/es6/string.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Brings in all ES6 String polyfills.\n */\n'require es6/string/codepointat es6/string/endswith';\n'require es6/string/fromcodepoint es6/string/includes';\n'require es6/string/repeat es6/string/startswith';\n","js/es6/symbol.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Polyfill for ES6 Symbol.\n */\n'require util/global util/patch';\n\n\n/** @const {string} */\n$jscomp.SYMBOL_PREFIX = 'jscomp_symbol_';\n\n\n/**\n * Initializes the Symbol function.\n * @suppress {reportUnknownTypes}\n */\n$jscomp.initSymbol = function() {\n // Only need to do this once. All future calls are no-ops.\n $jscomp.initSymbol = function() {};\n\n if ($jscomp.global.Symbol) return;\n\n $jscomp.global.Symbol = $jscomp.Symbol;\n\n /**\n * @param {string} name\n * @return {boolean}\n */\n var isSymbol = function(name) {\n if (name.length < $jscomp.SYMBOL_PREFIX.length) return false;\n for (var i = 0; i < $jscomp.SYMBOL_PREFIX.length; i++) {\n if (name[i] != $jscomp.SYMBOL_PREFIX[i]) return false;\n }\n return true;\n };\n\n // Need to monkey-patch Object.getOwnPropertyNames to not return symbols.\n // Note that we use this extra array populated by getOwnPropertyNames\n // because there's no way to access the *unpatched* getOwnPropertyNames\n // from the getOwnPropertySymbols patch.\n /** @type {!Array} */\n var symbols = [];\n var removeSymbolsPatch = function(orig) {\n return function(target) {\n symbols = [];\n var names = orig(target);\n var result = [];\n for (var i = 0, len = names.length; i < len; i++) {\n if (!isSymbol(names[i])) {\n result.push(names[i]);\n } else {\n symbols.push(names[i]);\n }\n }\n return result;\n };\n };\n\n $jscomp.patch('Object.keys', removeSymbolsPatch);\n $jscomp.patch('Object.getOwnPropertyNames', removeSymbolsPatch);\n $jscomp.patch('Object.getOwnPropertySymbols', function(orig) {\n return function(target) {\n // First call the patched getOwnPropertyNames to reset and fill the array.\n // Store the result somewhere to prevent nosideeffect removal.\n removeSymbolsPatch.unused = Object.getOwnPropertyNames(target);\n // In case the original function actually returned something, append that.\n symbols.push.apply(orig(target));\n return symbols;\n };\n });\n // Note: shouldn't need to patch Reflect.ownKeys.\n};\n\n\n/** @private {number} */\n$jscomp.symbolCounter_ = 0;\n\n\n/**\n * Produces \"symbols\" (actually just unique strings).\n * @param {string} description\n * @return {symbol}\n * @suppress {reportUnknownTypes}\n */\n$jscomp.Symbol = function(description) {\n return /** @type {symbol} */ (\n $jscomp.SYMBOL_PREFIX + description + ($jscomp.symbolCounter_++));\n};\n\n\n/**\n * Initializes Symbol.iterator, if it's not already defined.\n * @suppress {reportUnknownTypes}\n */\n$jscomp.initSymbolIterator = function() {\n $jscomp.initSymbol();\n if (!$jscomp.global.Symbol.iterator) {\n $jscomp.global.Symbol.iterator = $jscomp.global.Symbol('iterator');\n }\n\n // Only need to do this once. All future calls are no-ops.\n $jscomp.initSymbolIterator = function() {};\n};\n","js/es6/util/arrayfromiterable.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Polyfill for array destructuring.\n */\n'require es6/util/makeiterator es6/util/arrayfromiterator';\n\n\n/**\n * Copies the values from an Iterable into an Array.\n * @param {string|!Array|!Iterable|!Arguments} iterable\n * @return {!Array}\n * @template T\n */\n$jscomp.arrayFromIterable = function(iterable) {\n if (iterable instanceof Array) {\n return iterable;\n } else {\n return $jscomp.arrayFromIterator($jscomp.makeIterator(iterable));\n }\n};\n","js/es6/util/arrayfromiterator.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Polyfill for array destructuring.\n */\n'require base';\n\n\n/**\n * Copies the values from an Iterator into an Array. The important difference\n * between this and $jscomp.arrayFromIterable is that if the iterator's\n * next() method has already been called one or more times, this method returns\n * only the values that haven't been yielded yet.\n * @param {!Iterator} iterator\n * @return {!Array}\n * @template T\n */\n$jscomp.arrayFromIterator = function(iterator) {\n var i;\n var arr = [];\n while (!(i = iterator.next()).done) {\n arr.push(i.value);\n }\n return arr;\n};\n","js/es6/util/inherits.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Polyfill for ES6 extends keyword.\n */\n'require base';\n\n\n/**\n * Inherit the prototype methods and static methods from one constructor\n * into another.\n *\n * This wires up the prototype chain (like goog.inherits) and copies static\n * properties, for ES6-to-ES{3,5} transpilation.\n *\n * Usage:\n * \n * function ParentClass() {}\n *\n * // Regular method.\n * ParentClass.prototype.foo = function(a) {};\n *\n * // Static method.\n * ParentClass.bar = function() {};\n *\n * function ChildClass() {\n * ParentClass.call(this);\n * }\n * $jscomp.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass();\n * child.foo();\n * ChildClass.bar(); // Static inheritance.\n * \n *\n * @param {!Function} childCtor Child class.\n * @param {!Function} parentCtor Parent class.\n */\n$jscomp.inherits = function(childCtor, parentCtor) {\n /** @constructor */\n function tempCtor() {}\n tempCtor.prototype = parentCtor.prototype;\n childCtor.prototype = new tempCtor();\n /** @override */\n childCtor.prototype.constructor = childCtor;\n\n for (var p in parentCtor) {\n if (Object.defineProperties) {\n var descriptor = Object.getOwnPropertyDescriptor(parentCtor, p);\n if (descriptor) {\n Object.defineProperty(childCtor, p, descriptor);\n }\n } else {\n // Pre-ES5 browser. Just copy with an assignment.\n childCtor[p] = parentCtor[p];\n }\n }\n};\n","js/es6/util/iteratorfromarray.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Utilities for iterator-returning methods.\n */\n'require es6/symbol';\n\n\n$jscomp.array = $jscomp.array || {};\n\n\n/**\n * Creates an iterator from an array-like, with a transformation function.\n * @param {!IArrayLike } array\n * @param {function(number, INPUT): OUTPUT} transform\n * @return {!IteratorIterable}\n * @template INPUT, OUTPUT\n * @suppress {checkTypes}\n */\n$jscomp.iteratorFromArray = function(array, transform) {\n $jscomp.initSymbolIterator();\n // NOTE: IE8 doesn't support indexing from boxed Strings.\n if (array instanceof String) array = array + '';\n var i = 0;\n var iter = {\n next: function() {\n if (i < array.length) {\n var index = i++;\n return {value: transform(index, array[index]), done: false};\n }\n iter.next = function() { return {done: true, value: void 0}; };\n return iter.next();\n }\n };\n iter[Symbol.iterator] = function() { return iter; };\n return iter;\n};\n","js/es6/util/makeiterator.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Polyfill for for-of loops.\n */\n'require es6/symbol';\n\n\n/**\n * Creates an iterator for the given iterable.\n *\n * @param {string|!Array|!Iterable|!Iterator|!Arguments} iterable\n * @return {!Iterator}\n * @template T\n * @suppress {reportUnknownTypes}\n */\n$jscomp.makeIterator = function(iterable) {\n $jscomp.initSymbolIterator();\n\n // NOTE: Disabling typechecking because [] not allowed on @struct.\n var iteratorFunction = /** @type {?} */ (iterable)[Symbol.iterator];\n if (iteratorFunction) {\n return iteratorFunction.call(iterable);\n }\n\n var index = 0;\n var arr = /** @type {!Array} */ (iterable);\n return /** @type {!Iterator} */ ({\n next: function() {\n if (index < arr.length) {\n return {\n done: false,\n value: arr[index++],\n };\n } else {\n return {done: true};\n }\n }\n });\n};\n","js/es6/weakmap.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/symbol es6/util/makeiterator util/defineproperty';\n'require util/owns util/patch util/polyfill';\n\n$jscomp.polyfill('WeakMap', function(NativeWeakMap) {\n /**\n * Checks conformance of the existing WeakMap.\n * @return {boolean} True if the browser's implementation conforms.\n */\n function isConformant() {\n if (!NativeWeakMap || !Object.seal) return false;\n var x = Object.seal({});\n var y = Object.seal({});\n var map = new /** @type {function(new: WeakMap, !Array)} */ (NativeWeakMap)(\n [[x, 2], [y, 3]]);\n if (map.get(x) != 2 || map.get(y) != 3) return false;\n map.delete(x);\n map.set(y, 4);\n return !map.has(x) && map.get(y) == 4;\n }\n if (isConformant()) return NativeWeakMap;\n\n var prop = '$jscomp_hidden_' + Math.random().toString().substring(2);\n var hidden = {}; // tag used to indicate a hidden object.\n\n /**\n * Inserts the hidden property into the target.\n * @param {!Object} target\n */\n function insert(target) {\n if (!$jscomp.owns(target, prop)) {\n var obj = {};\n // TODO(sdh): This property will be enumerated in IE8. If this becomes\n // a problem, we could avoid it by copying an infrequently-used non-enum\n // method (like toLocaleString) onto the object itself and encoding the\n // property on the copy instead. This codepath must be easily removable\n // if IE8 support is not needed.\n obj[prop] = hidden;\n $jscomp.defineProperty(target, prop, {value: obj});\n }\n }\n\n /**\n * Monkey-patches the key-enumeration methods to ensure that the hidden\n * property is not returned.\n * @param {function(!Object): !Array} prev\n * @return {function(!Object): !Array}\n */\n function fixList(prev) {\n return function(target) {\n var result = prev(target);\n if ($jscomp.owns(target, prop) &&\n $jscomp.owns(target[prop], prop) &&\n target[prop][prop] === hidden) {\n for (var i = 0; i < result.length; i++) {\n if (result[i] == prop) {\n result.splice(i, 1);\n break;\n }\n }\n }\n return result;\n };\n }\n $jscomp.patch('Object.getOwnPropertyNames', fixList);\n $jscomp.patch('Object.keys', fixList);\n $jscomp.patch('Reflect.enumerate', fixList);\n $jscomp.patch('Reflect.ownKeys', fixList);\n\n /**\n * Monkey-patches the freezing methods to ensure that the hidden\n * property is added before any freezing happens.\n * @param {function(!Object): !Object} prev\n * @return {function(!Object): !Object}\n */\n function preInsert(prev) {\n return function(target) {\n insert(target);\n return prev(target);\n };\n }\n $jscomp.patch('Object.freeze', preInsert);\n $jscomp.patch('Object.preventExtensions', preInsert);\n $jscomp.patch('Object.seal', preInsert);\n // Note: no need to patch Reflect.preventExtensions since the polyfill\n // just calls Object.preventExtensions anyway (and if it's not polyfilled\n // then neither is WeakMap).\n\n var index = 0;\n\n /**\n * Polyfill for WeakMap:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\n *\n * This implementation is as non-leaky as possible, due to patching\n * the freezing and sealing operations. It does not include any logic\n * to handle cases where a key was somehow made non-extensible without\n * the special hidden property being added. It takes some care to ensure\n * the hidden property is not enumerated over nor discoverable, though\n * it's not completely secure (particularly in IE8).\n *\n * @constructor\n * @template KEY, VALUE\n * @param {!Iterator>|!Array>|null=}\n * opt_iterable Optional initial data.\n */\n var PolyfillWeakMap = function(opt_iterable) {\n /** @private @const {string} */\n this.id_ = (index += (Math.random() + 1)).toString();\n\n if (opt_iterable) {\n $jscomp.initSymbol();\n $jscomp.initSymbolIterator();\n var iter = $jscomp.makeIterator(opt_iterable);\n var entry;\n while (!(entry = iter.next()).done) {\n var item = entry.value;\n this.set(/** @type {KEY} */ (item[0]), /** @type {VALUE} */ (item[1]));\n }\n }\n };\n\n /**\n * @param {KEY} key\n * @param {VALUE} value\n * @return {!PolyfillWeakMap}\n */\n PolyfillWeakMap.prototype.set = function(key, value) {\n insert(key);\n if (!$jscomp.owns(key, prop)) {\n // NOTE: If the insert() call fails on the key, but the property\n // has previously successfully been added higher up the prototype\n // chain, then we'll silently misbehave. Instead, throw immediately\n // before doing something bad. If this becomes a problem (e.g. due\n // to some rogue frozen objects) then we may need to add a slow and\n // leaky fallback array to each WeakMap instance, as well as extra\n // logic in each accessor to use it (*only*) when necessary.\n throw new Error('WeakMap key fail: ' + key);\n }\n key[prop][this.id_] = value;\n return this;\n };\n\n /**\n * @param {KEY} key\n * @return {VALUE}\n */\n PolyfillWeakMap.prototype.get = function(key) {\n return $jscomp.owns(key, prop) ? key[prop][this.id_] : undefined;\n };\n\n /**\n * @param {KEY} key\n * @return {boolean}\n */\n PolyfillWeakMap.prototype.has = function(key) {\n return $jscomp.owns(key, prop) && $jscomp.owns(key[prop], this.id_);\n };\n\n /**\n * @param {KEY} key\n * @return {boolean}\n */\n PolyfillWeakMap.prototype.delete = function(key) {\n if (!$jscomp.owns(key, prop) ||\n !$jscomp.owns(key[prop], this.id_)) {\n return false;\n }\n return delete key[prop][this.id_];\n };\n\n return PolyfillWeakMap;\n}, 'es6-impl', 'es3');\n","js/es6/weakset.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/symbol es6/util/makeiterator util/polyfill es6/weakmap';\n\n$jscomp.polyfill('WeakSet', function(NativeWeakSet) {\n /**\n * Checks conformance of the existing WeakSet.\n * @return {boolean} True if the browser's implementation conforms.\n */\n function isConformant() {\n if (!NativeWeakSet || !Object.seal) return false;\n var x = Object.seal({});\n var y = Object.seal({});\n var set = new /** @type {function(new: WeakSet, !Array)} */ (NativeWeakSet)(\n [x]);\n if (!set.has(x) || set.has(y)) return false;\n set.delete(x);\n set.add(y);\n return !set.has(x) && set.has(y);\n }\n if (isConformant()) return NativeWeakSet;\n\n /**\n * @constructor\n * @template TYPE\n * @param {!Iterator|!Array|null=} opt_iterable\n */\n var PolyfillWeakSet = function(opt_iterable) {\n /** @private @const {!WeakMap} */\n this.map_ = new WeakMap();\n\n if (opt_iterable) {\n $jscomp.initSymbol();\n $jscomp.initSymbolIterator();\n var iter = $jscomp.makeIterator(opt_iterable);\n var entry;\n while (!(entry = iter.next()).done) {\n var item = entry.value;\n this.add(item);\n }\n }\n };\n\n /**\n * @param {TYPE} elem\n * @return {!PolyfillWeakSet}\n */\n PolyfillWeakSet.prototype.add = function(elem) {\n this.map_.set(elem, true);\n return this;\n };\n\n /**\n * @param {TYPE} elem\n * @return {boolean}\n */\n PolyfillWeakSet.prototype.has = function(elem) {\n return this.map_.has(elem);\n };\n\n /**\n * @param {TYPE} elem\n * @return {boolean}\n */\n PolyfillWeakSet.prototype.delete = function(elem) {\n return this.map_.delete(elem);\n };\n\n return PolyfillWeakSet;\n}, 'es6-impl', 'es3');\n","js/es6_dart_runtime.js":"/*\n * Copyright 2014 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Additional runtime functions required for transpilation from\n * ES6 to ES5 of code generated by the Dart Dev Compiler.\n *\n * Note that DDC's output cannot currently be lowered to ES3 (heavy use of\n * getters or setters, including in the runtime), so these helpers make no\n * attempt of fallback behaviour when methods like Object.getPrototypeOf or\n * Object.getOwnPropertyDescriptor are undefined (unlike helpers in es6/*.js).\n *\n * @author [email protected] (Olivier Chafik)\n */\n'require base';\n\n/**\n * Gets a property descriptor for a target instance, skipping its class\n * and walking up the super-classes hierarchy.\n *\n * @private\n * @param {!Object} target\n * @param {!string} name\n * @return {?}\n */\n$jscomp.getSuperPropertyDescriptor_ = function(target, name) {\n var getPrototypeOf = Object.getPrototypeOf;\n var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var cls = getPrototypeOf(target);\n while (cls != null) {\n cls = getPrototypeOf(cls);\n if (cls != null) {\n var desc = getOwnPropertyDescriptor(cls, name);\n if (desc != null) {\n return desc;\n }\n }\n }\n return undefined;\n};\n\n/**\n * Gets a property of a target instance using its super class getter or value,\n * or returns undefined if that property is not defined on any ancestor.\n *\n * @param {!Object} target\n * @param {!string} propertyName\n * @return {*}\n */\n$jscomp.superGet = function(target, propertyName) {\n var desc = $jscomp.getSuperPropertyDescriptor_(target, propertyName);\n return desc && (desc.get ? desc.get.call(target) : desc.value);\n};\n\n/**\n * Sets a property on a target instance using its super setter if is defined\n * on any ancestor, or setting it as a simple property on the target otherwise.\n *\n * @template T\n * @param {!Object} target\n * @param {!string} propertyName\n * @param {T} value\n * @return {T}\n */\n$jscomp.superSet = function(target, propertyName, value) {\n var desc = $jscomp.getSuperPropertyDescriptor_(target, propertyName);\n if (desc) {\n if (!desc.set) {\n throw new TypeError('No setter for super.' + propertyName);\n }\n desc.set.call(target, value);\n } else {\n target[propertyName] = value;\n }\n return value;\n};\n","js/es6_runtime.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require es6/array es6/map es6/math es6/number es6/object';\n'require es6/set es6/string es6/symbol es6/util/arrayfromiterable';\n'require es6/util/arrayfromiterator es6/util/inherits';\n'require es6/util/iteratorfromarray es6/util/makeiterator';\n'require es6/weakmap es6/weakset';\n","js/license.js":"/*\n * Copyright 2015 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n","js/runtime_type_check.js":"/*\n * Copyright 2010 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @fileoverview Provides the boilerplate code for run-time type checking.\n *\n * @author [email protected] (Andrew Moedinger)\n * @author [email protected] (Nada Amin)\n */\n'require base';\n\n/** @const */\n$jscomp.typecheck = {};\n\n/**\n * A state variable to suspend checking, to avoid infinite calls\n * caused by calling checked code from the checking functions.\n *\n * @type {boolean}\n */\n$jscomp.typecheck.suspendChecking = false;\n\n\n/**\n * Log and possibly format the run-time type check warning. This\n * function is customized at compile-time.\n *\n * @param {string} warning the warning to log.\n * @param {*} expr the faulty expression.\n */\n$jscomp.typecheck.log = function(warning, expr) {};\n\n/**\n * Checks that the given expression matches one of the given checkers,\n * logging if not, and returning the expression regardless.\n *\n * @param {*} expr the expression to check.\n * @param {!Array.} checkers the checkers to\n * use in checking, one of these has to match for checking to succeed.\n * @return {*} the given expression back.\n */\n$jscomp.typecheck.checkType = function(expr, checkers) {\n if ($jscomp.typecheck.suspendChecking) {\n return expr;\n }\n $jscomp.typecheck.suspendChecking = true;\n\n for (var i = 0; i < checkers.length; i++) {\n var checker = checkers[i];\n var ok = checker.check(expr);\n if (ok) {\n $jscomp.typecheck.suspendChecking = false;\n return expr;\n }\n }\n\n var warning = $jscomp.typecheck.prettify_(expr) + ' not in ' +\n checkers.join(' ');\n\n $jscomp.typecheck.log(warning, expr);\n\n $jscomp.typecheck.suspendChecking = false;\n return expr;\n};\n\n\n/**\n * Prettify the given expression for printing.\n *\n * @param {*} expr the expression.\n * @return {string} a string representation of the given expression.\n * @private\n */\n$jscomp.typecheck.prettify_ = function(expr) {\n var className = $jscomp.typecheck.getClassName_(expr);\n if (className) {\n return className;\n }\n try {\n return String(expr);\n }\n catch (e) {}\n return '';\n};\n\n/**\n * Gets the class name if the given expression is an object.\n *\n * @param {*} expr the expression.\n * @return {string|undefined} the class name or undefined if the\n * expression is not an object.\n * @private\n */\n$jscomp.typecheck.getClassName_ = function(expr) {\n var className = void 0;\n if (typeof expr == 'object' && expr && expr.constructor) {\n className = expr.constructor.name;\n if (!className) {\n var funNameRe = /function (.{1,})\\(/;\n var m = (funNameRe).exec(expr.constructor.toString());\n className = m && m.length > 1 ? m[1] : void 0;\n }\n }\n return className;\n};\n\n/**\n * Interface for all checkers.\n *\n * @interface\n */\n$jscomp.typecheck.Checker = function() {};\n\n\n/**\n * Checks the given expression.\n *\n * @param {*} expr the expression to check.\n * @return {boolean} whether the given expression matches this checker.\n */\n$jscomp.typecheck.Checker.prototype.check = function(expr) {};\n\n\n\n/**\n * A class for all value checkers, except the null checker.\n *\n * @param {string} type the value type (e.g. 'number') of this checker.\n * @constructor\n * @implements {$jscomp.typecheck.Checker}\n * @private\n */\n$jscomp.typecheck.ValueChecker_ = function(type) {\n /**\n * The value type of this checker.\n * @type {string}\n * @private\n */\n this.type_ = type;\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ValueChecker_.prototype.check = function(expr) {\n return typeof(expr) == this.type_;\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ValueChecker_.prototype.toString = function() {\n return 'value(' + this.type_ + ')';\n};\n\n\n\n/**\n * A checker class for null values.\n *\n * @constructor\n * @implements {$jscomp.typecheck.Checker}\n * @private\n */\n$jscomp.typecheck.NullChecker_ = function() {};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.NullChecker_.prototype.check = function(expr) {\n return expr === null;\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.NullChecker_.prototype.toString = function() {\n return 'value(null)';\n};\n\n\n/**\n * A checker class for a class defined in externs, including built-in\n * JS types.\n *\n * If the class type is undefined, then checking is suspended to\n * avoid spurious warnings. This is necessary because some externs\n * types are not defined in all browsers. For example, Window is not\n * defined Chrome, as window has the type DOMWindow.\n *\n *
Another subtlety is that a built-in type may be referenced in a\n * different frame than the one in which it was created. This causes\n * instanceOf to return false even though the object is of the correct\n * type. We work around this by checking as many windows as possible,\n * redefining open on top and window to keep track of them.\n *\n * @param {string} className the name of the extern class to check.\n * @constructor\n * @implements {$jscomp.typecheck.Checker}\n * @private\n */\n$jscomp.typecheck.ExternClassChecker_ = function(className) {\n /**\n * The name of the extern class to check.\n * @type {string}\n * @private\n */\n this.className_ = className;\n};\n\n\n/**\n * A list of (hopefully all) open windows.\n *\n * @type {!Array.}\n */\n$jscomp.typecheck.ExternClassChecker_.windows = [];\n\n\n/**\n * A list of the original open methods that have been redefined.\n *\n * @type {!Array.}\n */\n$jscomp.typecheck.ExternClassChecker_.oldOpenFuns = [];\n\n\n/**\n * Redefines the open method on the given window, adding tracking.\n *\n * @param {!Window} win the window to track.\n */\n$jscomp.typecheck.ExternClassChecker_.trackOpenOnWindow = function(win) {\n if (win.tracked) {\n return;\n }\n win.tracked = true;\n\n var key = $jscomp.typecheck.ExternClassChecker_.oldOpenFuns.length;\n\n $jscomp.typecheck.ExternClassChecker_.oldOpenFuns.push(win.open);\n $jscomp.typecheck.ExternClassChecker_.windows.push(win);\n\n win.open = function() {\n var w = $jscomp.typecheck.ExternClassChecker_.oldOpenFuns[key].apply(\n this, arguments);\n $jscomp.typecheck.ExternClassChecker_.trackOpenOnWindow(w);\n return w;\n };\n};\n\n\n/**\n * Returns the global 'this' object. This will normally be the same as 'window'\n * but when running in a worker thread, the DOM is not available.\n * @return {!Window}\n * @private\n */\n$jscomp.typecheck.ExternClassChecker_.getGlobalThis_ = function() {\n return (function() { return this; }).call(null);\n};\n\n\n// Install listeners on the global 'this' object.\n(function() {\n var globalThis = $jscomp.typecheck.ExternClassChecker_.getGlobalThis_();\n $jscomp.typecheck.ExternClassChecker_.trackOpenOnWindow(globalThis);\n\n var theTop = globalThis['top'];\n if (theTop) {\n $jscomp.typecheck.ExternClassChecker_.trackOpenOnWindow(theTop);\n }\n})();\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ExternClassChecker_.prototype.check = function(expr) {\n var classTypeDefined = [ false ];\n for (var i = 0; i < $jscomp.typecheck.ExternClassChecker_.windows.length;\n i++) {\n var w = $jscomp.typecheck.ExternClassChecker_.windows[i];\n if (this.checkWindow_(w, expr, classTypeDefined)) {\n return true;\n }\n }\n return !classTypeDefined[0];\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ExternClassChecker_.prototype.toString = function() {\n return 'ext_class(' + this.className_ + ')';\n};\n\n\n/**\n * Checks whether the given expression is an instance of this extern\n * class in this window or any of its frames and subframes.\n *\n * @param {!Window} w the window to start checking from.\n * @param {*} expr the expression to check.\n * @param {!Array.} classTypeDefined a wrapped boolean\n * updated to indicate whether the class type was seen in any frame.\n * @return true if the given expression is an instance of this class.\n * @private\n */\n$jscomp.typecheck.ExternClassChecker_.prototype.checkWindow_ =\n function(w, expr, classTypeDefined) {\n var classType = /** @type {function(new: ?)} */ (w[this.className_]);\n classTypeDefined[0] = classTypeDefined[0] || !!classType;\n if (classType && expr instanceof classType) {\n return true;\n }\n for (var i = 0; i < w.length; i++) {\n if (this.checkWindow_(w.frames[i], expr, classTypeDefined)) {\n return true;\n }\n }\n return false;\n};\n\n\n\n/**\n * A class for all checkers of user-defined classes.\n *\n * @param {string} className name of the class to check.\n * @constructor\n * @implements {$jscomp.typecheck.Checker}\n * @private\n */\n$jscomp.typecheck.ClassChecker_ = function(className) {\n\n /**\n * The name of the class to check.\n * @type {string}\n * @private\n */\n this.className_ = className;\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ClassChecker_.prototype.check = function(expr) {\n return !!(expr && expr['instance_of__' + this.className_]);\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ClassChecker_.prototype.toString = function() {\n return 'class(' + this.className_ + ')';\n};\n\n\n\n/**\n * A class for all checkers of user-defined interfaces.\n *\n * @param {string} interfaceName name of the interface to check.\n * @constructor\n * @implements {$jscomp.typecheck.Checker}\n * @private\n */\n$jscomp.typecheck.InterfaceChecker_ = function(interfaceName) {\n\n /**\n * The name of the interface to check.\n * @type {string}\n * @private\n */\n this.interfaceName_ = interfaceName;\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.InterfaceChecker_.prototype.check = function(expr) {\n return !!(expr && expr['implements__' + this.interfaceName_]);\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.InterfaceChecker_.prototype.toString = function() {\n return 'interface(' + this.interfaceName_ + ')';\n};\n\n\n\n/**\n * A checker for object types (possibly with non-standard prototype: might not\n * inherit from Object).\n *\n * @constructor\n * @implements {$jscomp.typecheck.Checker}\n * @private\n */\n$jscomp.typecheck.ObjectChecker_ = function() {};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ObjectChecker_.prototype.check = function(expr) {\n return typeof(expr) == 'object' && !!expr;\n};\n\n\n/** @inheritDoc */\n$jscomp.typecheck.ObjectChecker_.prototype.toString = function() {\n return 'value(object)';\n};\n\n\n\n/**\n * A checker for null values.\n *\n * @type {!$jscomp.typecheck.Checker} a checker.\n */\n$jscomp.typecheck.nullChecker = new $jscomp.typecheck.NullChecker_();\n\n\n/**\n * Creates a checker for the given value type (excluding the null type).\n *\n * @param {string} type the value type.\n * @return {!$jscomp.typecheck.Checker} a checker.\n */\n$jscomp.typecheck.valueChecker = function(type) {\n return new $jscomp.typecheck.ValueChecker_(type);\n};\n\n\n/**\n * Creates a checker for the given extern class name.\n *\n * @param {string} className the class name.\n * @return {!$jscomp.typecheck.Checker} a checker.\n */\n$jscomp.typecheck.externClassChecker = function(className) {\n return new $jscomp.typecheck.ExternClassChecker_(className);\n};\n\n\n/**\n * Creates a checker for the given user-defined class.\n *\n * @param {string} className the class name.\n * @return {!$jscomp.typecheck.Checker} a checker.\n */\n$jscomp.typecheck.classChecker = function(className) {\n return new $jscomp.typecheck.ClassChecker_(className);\n};\n\n\n/**\n * Creates a checker for the given user-defined interface.\n *\n * @param {string} interfaceName the interface name.\n * @return {!$jscomp.typecheck.Checker} a checker.\n */\n$jscomp.typecheck.interfaceChecker = function(interfaceName) {\n return new $jscomp.typecheck.InterfaceChecker_(interfaceName);\n};\n\n\n/**\n * A checker for objects.\n *\n * @type {!$jscomp.typecheck.Checker} a checker.\n */\n$jscomp.typecheck.objectChecker = new $jscomp.typecheck.ObjectChecker_();\n","js/util/checkstringargs.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require base';\n\n\n/**\n * Throws if the argument is a RegExp, or if thisArg is undefined.\n * @param {?} thisArg The 'this' arg, which must be defined.\n * @param {*} arg The first argument of the function, which mustn't be a RegExp.\n * @param {string} func Name of the function, for reporting.\n * @return {string} The thisArg, coerced to a string.\n */\n$jscomp.checkStringArgs = function(thisArg, arg, func) {\n if (thisArg == null) {\n throw new TypeError(\n \"The 'this' value for String.prototype.\" + func +\n ' must not be null or undefined');\n }\n if (arg instanceof RegExp) {\n throw new TypeError(\n 'First argument to String.prototype.' + func +\n ' must not be a regular expression');\n }\n return thisArg + '';\n};\n","js/util/defineproperty.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Provides methods to polyfill native objects.\n */\n'require base';\n\n\n/**\n * Polyfill for Object.defineProperty() method:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n *\n * Obviously we can't support getters and setters in ES3, so we\n * throw a TypeError in that case. We also refuse to define\n * properties on Array.prototype and Object.prototype, since we\n * can't make them non-enumerable and this messes up peoples' for\n * loops. Beyond this, we simply assign values and not worry\n * about enumerability or writeability.\n * @param {?} target\n * @param {string} property\n * @param {?} descriptor\n */\n$jscomp.defineProperty =\n typeof Object.defineProperties == 'function' ?\n Object.defineProperty :\n function(target, property, descriptor) {\n descriptor = /** @type {!ObjectPropertyDescriptor} */ (descriptor);\n if (descriptor.get || descriptor.set) {\n throw new TypeError('ES3 does not support getters and setters.');\n }\n if (target == Array.prototype || target == Object.prototype) return;\n target[property] = descriptor.value;\n };\n","js/util/findinternal.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Utility for Array methods that find elements.\n */\n'require base';\n\n// TODO(sdh): would be nice to template on the ARRAY type as well,\n// so that the third arg type of callback can be refined to be\n// exactly the same as the array type, but then there's no way to\n// enforce that it must, in fact, be an array.\n/**\n * Internal implementation of find.\n * @param {!IArrayLike} array\n * @param {function(this: THIS, VALUE, number, !IArrayLike): *} callback\n * @param {THIS} thisArg\n * @return {{i: number, v: (VALUE|undefined)}}\n * @template THIS, VALUE\n */\n$jscomp.findInternal = function(array, callback, thisArg) {\n if (array instanceof String) {\n array = /** @type {!IArrayLike} */ (String(array));\n }\n var len = array.length;\n for (var i = 0; i < len; i++) {\n var value = array[i];\n if (callback.call(thisArg, value, i, array)) return {i: i, v: value};\n }\n return {i: -1, v: void 0};\n};\n","js/util/global.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Runtime code to store the global object.\n */\n'require base';\n'declare global window';\n\n\n/**\n * @param {!Object} maybeGlobal\n * @return {!Object} The global object.\n * @suppress {undefinedVars}\n */\n$jscomp.getGlobal = function(maybeGlobal) {\n return (typeof window != 'undefined' && window === maybeGlobal) ?\n maybeGlobal :\n (typeof global != 'undefined') ? global : maybeGlobal;\n};\n\n\n// TODO(sdh): This should be typed as \"the global object\", but there's not\n// currently any way to do this in the existing type system.\n/**\n * The global object. For browsers we could just use `this` but in Node that\n * doesn't work.\n * @const {?}\n */\n$jscomp.global = $jscomp.getGlobal(this);\n","js/util/owns.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require base';\n\n/**\n * Synonym for Object.prototype.hasOwnProperty.call(obj, prop).\n * @param {!Object} obj\n * @param {string} prop\n * @return {boolean}\n */\n$jscomp.owns = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n","js/util/patch.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require util/global util/patches';\n\n/**\n * Utility for monkey-patching built-in functions when needed.\n * The basic approach is to patch any function that currently exists at the\n * given name, but to also save a list of the patches so that they can also\n * be applied to any later polyfills (this is done in polyfill.js). Note\n * that this is orthogonal to polyfills because whether a function is\n * patched is independent of language versions or whether the function is\n * defined natively (or is polyfilled earlier, later, or not at all), but\n * rather whether a different polyfill requires the functionality to be\n * altered. The primary example use cases include Object.keys (from ES5)\n * needing to be patched to be aware of our Symbol polyfill for non-ES6\n * browsers, but left alone for modern browsers, and WeakMap needing to\n * ensure its hidden property is included before keys can be frozen.\n *\n * @param {string} target\n * @param {function(!Function): !Function} patch\n */\n$jscomp.patch = function(target, patch) {\n ($jscomp.patches[target] = $jscomp.patches[target] || []).push(patch);\n var obj = $jscomp.global;\n var split = target.split('.');\n for (var i = 0; i < split.length - 1 && obj; i++) {\n obj = obj[split[i]];\n }\n var property = split[split.length - 1];\n if (obj && obj[property] instanceof Function) {\n obj[property] = patch(obj[property]);\n }\n};\n","js/util/patches.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'require base';\n\n/**\n * @const {!Object>}\n */\n$jscomp.patches = {};\n","js/util/polyfill.js":"/*\n * Copyright 2016 The Closure Compiler Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Provides methods to polyfill native objects.\n */\n'require util/defineproperty util/global util/patches';\n\n\n/**\n * @param {string} target\n * @param {?function(*): *} polyfill\n * @param {string} fromLang\n * @param {string} toLang\n */\n$jscomp.polyfill = function(target, polyfill, fromLang, toLang) {\n if (!polyfill) return;\n var obj = $jscomp.global;\n var split = target.split('.');\n for (var i = 0; i < split.length - 1; i++) {\n var key = split[i];\n if (!(key in obj)) obj[key] = {}; // Might want to be defineProperty.\n obj = obj[key];\n }\n var property = split[split.length - 1];\n var orig = obj[property];\n var impl = polyfill(orig);\n if (impl == orig) return;\n var patches = $jscomp.patches[target] || [];\n for (i = 0; i < patches.length; i++) {\n impl = patches[i](/** @type {!Function} */ (impl));\n }\n $jscomp.defineProperty(\n obj, property, {configurable: true, writable: true, value: impl});\n};\n"}