summaryrefslogtreecommitdiffstats
path: root/js/vendor/es6-shim
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-02-28 13:25:05 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-02-28 13:25:05 +0100
commit7986ea3afcc0c57ecad5a25a92a5bbee8db81d08 (patch)
tree5ee5e3d3c6e2db094961917bbd48c65d80221038 /js/vendor/es6-shim
parentea4ecf501fc83134db2201477b4cdb1806d5312c (diff)
update npm modules and bower modules
Diffstat (limited to 'js/vendor/es6-shim')
-rw-r--r--js/vendor/es6-shim/.bower.json8
-rw-r--r--js/vendor/es6-shim/CHANGELOG.md31
-rw-r--r--js/vendor/es6-shim/LICENSE26
-rw-r--r--js/vendor/es6-shim/README.md69
-rw-r--r--js/vendor/es6-shim/bower.json2
-rw-r--r--js/vendor/es6-shim/component.json2
-rw-r--r--js/vendor/es6-shim/es6-sham.js6
-rw-r--r--js/vendor/es6-shim/es6-sham.min.js6
-rw-r--r--js/vendor/es6-shim/es6-shim.js271
-rw-r--r--js/vendor/es6-shim/es6-shim.map2
-rw-r--r--js/vendor/es6-shim/es6-shim.min.js10
-rw-r--r--js/vendor/es6-shim/package.json29
12 files changed, 386 insertions, 76 deletions
diff --git a/js/vendor/es6-shim/.bower.json b/js/vendor/es6-shim/.bower.json
index de406f10b..55dffff7b 100644
--- a/js/vendor/es6-shim/.bower.json
+++ b/js/vendor/es6-shim/.bower.json
@@ -1,6 +1,6 @@
{
"name": "es6-shim",
- "version": "0.25.0",
+ "version": "0.27.0",
"repo": "paulmillr/es6-shim",
"description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines",
"keywords": [
@@ -28,11 +28,11 @@
"test"
],
"homepage": "https://github.com/paulmillr/es6-shim",
- "_release": "0.25.0",
+ "_release": "0.27.0",
"_resolution": {
"type": "version",
- "tag": "0.25.0",
- "commit": "7781aad3fb2a35048cce9d10bf929dd9fc192ab6"
+ "tag": "0.27.0",
+ "commit": "9109d000e415c32a88c28fb99ed67400ed425626"
},
"_source": "git://github.com/paulmillr/es6-shim.git",
"_target": "~0.*",
diff --git a/js/vendor/es6-shim/CHANGELOG.md b/js/vendor/es6-shim/CHANGELOG.md
index de20f2aff..23f10335f 100644
--- a/js/vendor/es6-shim/CHANGELOG.md
+++ b/js/vendor/es6-shim/CHANGELOG.md
@@ -1,5 +1,36 @@
# es6-shim x.x.x (not yet released)
+# es6-shim 0.27.0 (26 Feb 2015)
+* Overwrite `Array#slice` so that it supports Array subclasses.
+* Improve `Map`/`Set` `TypeError` messages when called as a function. (#321)
+
+# es6-shim 0.26.1 (25 Feb 2015)
+* Ensure `Array`/`Array.prototype` functions have the correct name.
+* Chrome 40 defines the incorrect name for `Array#values`
+* Make sure that `Array.of` works when subclassed.
+
+# es6-shim 0.26.0 (24 Feb 2015)
+* Ensure that remaining Object static methods accept primitives.
+* Update `chai`
+* Document `String.prototype` HTML methods and `Reflect` methods in README
+
+# es6-shim 0.25.3 (22 Feb 2015)
+* Removing nonexistent arguments from some String.prototype HTML methods
+* All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
+* Test on `iojs-v1.3`
+* Update `chai`
+* Add a LICENSE file
+
+# es6-shim 0.25.2 (18 Feb 2015)
+* If someone (looking at you, chalk) has previously modified String.prototype with a non-function “bold”, don‘t break. (#315)
+
+# es6-shim 0.25.1 (18 Feb 2015)
+* Add Annex B String.prototype HTML methods.
+* Overwriting Annex B String.prototype HTML methods in IE 9, which both uppercases the tag names, and fails to escape double quotes.
+* Overwriting Annex B String.prototype HTML methods in Safari 4-5, which fails to escape double quotes.
+* Ensuring that Date#toString returns “Invalid Date” when the date‘s value is NaN.
+* Test on `iojs-v1.2`
+
# es6-shim 0.25.0 (16 Feb 2015)
* Ensure Object.getOwnPropertyNames accepts primitives.
* Make sure the replaced `Object.keys` is non-enumerable.
diff --git a/js/vendor/es6-shim/LICENSE b/js/vendor/es6-shim/LICENSE
new file mode 100644
index 000000000..822c479d1
--- /dev/null
+++ b/js/vendor/es6-shim/LICENSE
@@ -0,0 +1,26 @@
+The project was initially based on [es6-shim by Axel Rauschmayer](https://github.com/rauschma/es6-shim).
+
+Current maintainers are: [Paul Miller](http://paulmillr.com), [Jordan Harband](https://github.com/ljharb), and [C. Scott Ananian](http://cscott.net).
+
+The MIT License (MIT)
+
+Copyright (c) 2013-2015 Paul Miller (http://paulmillr.com) and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/js/vendor/es6-shim/README.md b/js/vendor/es6-shim/README.md
index f11b72d17..bbfc37545 100644
--- a/js/vendor/es6-shim/README.md
+++ b/js/vendor/es6-shim/README.md
@@ -86,7 +86,39 @@ details.
* `imul()`
* `fround()`
-Math functions accuracy is 1e-11.
+Math functions’ accuracy is 1e-11.
+
+* `Reflect`
+ * `apply()`
+ * `construct()`
+ * `defineProperty()`
+ * `deleteProperty()`
+ * `enumerate()`
+ * `get()`
+ * `getOwnPropertyDescriptor()`
+ * `getPrototypeOf()`
+ * `has()`
+ * `isExtensible()`
+ * `ownKeys()`
+ * `preventExtensions()`
+ * `set()`
+ * `setPrototypeOf()`
+
+* `String.prototype` Annex B HTML methods
+These methods are part of "Annex B", which means that although they are a defacto standard, you shouldn't use them. None the less, the `es6-shim` provides them:
+ * `anchor()`
+ * `big()`
+ * `blink()`
+ * `bold()`
+ * `fixed()`
+ * `fontcolor()`
+ * `fontsize()`
+ * `italics()`
+ * `link()`
+ * `small()`
+ * `strike()`
+ * `sub()`
+ * `sup()`
## Subclassing
The `Map`, `Set`, and `Promise` implementations are subclassable.
@@ -178,35 +210,10 @@ Promise.resolve(5).then(function (value) {
Other stuff:
-* [ECMAScript 6 drafts](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts)
-* [Harmony proposals](http://wiki.ecmascript.org/doku.php?id=harmony:harmony)
+* [HTML version of the latest ECMAScript 6 spec draft][spec-html-url]
+* [PDFs of ECMAScript 6 spec drafts][spec-drafts-url]
-## License
-The project was initially based on [es6-shim by Axel Rauschmayer](https://github.com/rauschma/es6-shim).
-
-Current maintainers are: [Paul Miller](http://paulmillr.com), [Jordan Harband](https://github.com/ljharb), and [C. Scott Ananian](http://cscott.net).
-
-The MIT License (MIT)
-
-Copyright (c) 2013-2014 Paul Miller (http://paulmillr.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+## [License][license-url]
[1]: https://travis-ci.org/paulmillr/es6-shim.svg
[2]: https://travis-ci.org/paulmillr/es6-shim
@@ -214,4 +221,6 @@ SOFTWARE.
[4]: https://david-dm.org/paulmillr/es6-shim
[5]: https://david-dm.org/paulmillr/es6-shim/dev-status.svg
[6]: https://david-dm.org/paulmillr/es6-shim#info=devDependencies
-
+[license-url]: https://github.com/paulmillr/es6-shim/blob/master/LICENSE
+[spec-html-url]: https://people.mozilla.org/~jorendorff/es6-draft.html
+[spec-drafts-url]: http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts
diff --git a/js/vendor/es6-shim/bower.json b/js/vendor/es6-shim/bower.json
index 767c6292f..8375cfdd6 100644
--- a/js/vendor/es6-shim/bower.json
+++ b/js/vendor/es6-shim/bower.json
@@ -1,6 +1,6 @@
{
"name": "es6-shim",
- "version": "0.25.0",
+ "version": "0.27.0",
"repo": "paulmillr/es6-shim",
"description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines",
"keywords": [
diff --git a/js/vendor/es6-shim/component.json b/js/vendor/es6-shim/component.json
index c80e27993..b4529dca8 100644
--- a/js/vendor/es6-shim/component.json
+++ b/js/vendor/es6-shim/component.json
@@ -1,6 +1,6 @@
{
"name": "es6-shim",
- "version": "0.25.0",
+ "version": "0.27.0",
"repo": "paulmillr/es6-shim",
"description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines",
"keywords": [
diff --git a/js/vendor/es6-shim/es6-sham.js b/js/vendor/es6-shim/es6-sham.js
index 6d974975b..9ba963674 100644
--- a/js/vendor/es6-shim/es6-sham.js
+++ b/js/vendor/es6-shim/es6-sham.js
@@ -1,9 +1,9 @@
/*!
* https://github.com/paulmillr/es6-shim
- * @license es6-shim Copyright 2013-2014 by Paul Miller (http://paulmillr.com)
+ * @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
- * es6-sham: v0.25.0
- * see https://github.com/paulmillr/es6-shim/blob/0.25.0/LICENSE
+ * es6-sham: v0.27.0
+ * see https://github.com/paulmillr/es6-shim/blob/0.27.0/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
diff --git a/js/vendor/es6-shim/es6-sham.min.js b/js/vendor/es6-shim/es6-sham.min.js
index d7cc819de..a08896693 100644
--- a/js/vendor/es6-shim/es6-sham.min.js
+++ b/js/vendor/es6-shim/es6-sham.min.js
@@ -1,9 +1,9 @@
/*!
* https://github.com/paulmillr/es6-shim
- * @license es6-shim Copyright 2013-2014 by Paul Miller (http://paulmillr.com)
+ * @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
- * es6-sham: v0.25.0
- * see https://github.com/paulmillr/es6-shim/blob/0.25.0/LICENSE
+ * es6-sham: v0.27.0
+ * see https://github.com/paulmillr/es6-shim/blob/0.27.0/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
diff --git a/js/vendor/es6-shim/es6-shim.js b/js/vendor/es6-shim/es6-shim.js
index 231f768ff..4dc0a61bc 100644
--- a/js/vendor/es6-shim/es6-shim.js
+++ b/js/vendor/es6-shim/es6-shim.js
@@ -1,9 +1,9 @@
/*!
* https://github.com/paulmillr/es6-shim
- * @license es6-shim Copyright 2013-2014 by Paul Miller (http://paulmillr.com)
+ * @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
- * es6-shim: v0.25.0
- * see https://github.com/paulmillr/es6-shim/blob/0.25.0/LICENSE
+ * es6-shim: v0.27.0
+ * see https://github.com/paulmillr/es6-shim/blob/0.27.0/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
@@ -85,10 +85,12 @@
var _hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
var ArrayIterator; // make our implementation private
var noop = function () {};
+ var arraySlice = Array.prototype.slice;
var Symbol = globals.Symbol || {};
var symbolSpecies = Symbol.species || '@@species';
var Type = {
+ object: function (x) { return x !== null && typeof x === 'object'; },
string: function (x) { return _toString(x) === '[object String]'; },
regex: function (x) { return _toString(x) === '[object RegExp]'; },
symbol: function (x) {
@@ -143,6 +145,9 @@
} else {
object[property] = newValue;
}
+ },
+ preserveToString: function (target, source) {
+ defineProperty(target, 'toString', source.toString.bind(source), true);
}
};
@@ -328,6 +333,19 @@
// Call the constructor.
var result = ES.Call(C, obj, args);
return ES.TypeIsObject(result) ? result : obj;
+ },
+
+ CreateHTML: function (string, tag, attribute, value) {
+ var S = String(string);
+ var p1 = '<' + tag;
+ if (attribute !== '') {
+ var V = String(value);
+ var escapedV = V.replace(/"/g, '&quot;');
+ p1 += ' ' + attribute + '="' + escapedV + '"';
+ }
+ var p2 = p1 + '>';
+ var p3 = p2 + S;
+ return p3 + '</' + tag + '>';
}
};
@@ -668,7 +686,7 @@
}
var ArrayShims = {
- from: function (iterable) {
+ from: function from(iterable) {
var mapFn = arguments.length > 1 ? arguments[1] : void 0;
var list = ES.ToObject(iterable, 'bad iterable');
@@ -722,8 +740,8 @@
return result;
},
- of: function () {
- return Array.from(arguments);
+ of: function of() {
+ return Array.from.call(this, arguments);
}
};
defineProperties(Array, ArrayShims);
@@ -840,7 +858,7 @@
addIterator(ObjectIterator.prototype);
var ArrayPrototypeShims = {
- copyWithin: function (target, start) {
+ copyWithin: function copyWithin(target, start) {
var end = arguments[2]; // copyWithin.length must be 2
var o = ES.ToObject(this);
var len = ES.ToLength(o.length);
@@ -870,7 +888,7 @@
return o;
},
- fill: function (value) {
+ fill: function fill(value) {
var start = arguments.length > 1 ? arguments[1] : void 0;
var end = arguments.length > 2 ? arguments[2] : void 0;
var O = ES.ToObject(this);
@@ -921,15 +939,15 @@
return -1;
},
- keys: function () {
+ keys: function keys() {
return new ArrayIterator(this, 'key');
},
- values: function () {
+ values: function values() {
return new ArrayIterator(this, 'value');
},
- entries: function () {
+ entries: function entries() {
return new ArrayIterator(this, 'entry');
}
};
@@ -951,8 +969,43 @@
Array.prototype[Symbol.unscopables].values = true;
}
}
+ // Chrome 40 defines Array#values with the incorrect name, although Array#{keys,entries} have the correct name
+ if (Array.prototype.values && Array.prototype.values.name !== 'values') {
+ var originalArrayPrototypeValues = Array.prototype.values;
+ defineProperty(Array.prototype, 'values', function values() { return originalArrayPrototypeValues.call(this); }, true);
+ defineProperty(Array.prototype, $iterator$, Array.prototype.values, true);
+ Value.preserveToString(Array.prototype.values, originalArrayPrototypeValues);
+ }
defineProperties(Array.prototype, ArrayPrototypeShims);
+ var Empty = function Empty() {};
+ if (!(Array.prototype.slice.call(new Empty()) instanceof Empty)) {
+ defineProperty(Array.prototype, 'slice', function slice(start, end) {
+ if (this instanceof Array || isArguments(this)) {
+ return arraySlice.apply(this, arguments);
+ }
+ var O = ES.ToObject(this);
+ var len = ES.ToLength(this.length);
+ var relativeStart = ES.ToInteger(start);
+ var k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);
+ var relativeEnd = typeof end === 'undefined' ? len : ES.ToInteger(end);
+ var finalEnd = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);
+ var count = Math.max(finalEnd - k, 0);
+ var A = ES.Construct(O.constructor, [count]);
+ var n = 0;
+ while (k < finalEnd) {
+ if (_hasOwnProperty(O, k)) {
+ A[n] = O[k];
+ }
+ k += 1;
+ n += 1;
+ }
+ A.length = n;
+ return A;
+ }, true);
+ Value.preserveToString(Array.prototype.slice, arraySlice);
+ }
+
addIterator(Array.prototype, function () { return this.values(); });
// Chrome defines keys/values/entries on Array, but doesn't give us
// any way to identify its iterator. So add our own shimmed field.
@@ -1111,6 +1164,7 @@
defineProperty(Object, 'keys', function keys(value) {
return originalObjectKeys(ES.ToObject(value));
}, true);
+ Value.preserveToString(Object.keys, originalObjectKeys);
}
if (Object.getOwnPropertyNames) {
@@ -1127,6 +1181,149 @@
defineProperty(Object, 'getOwnPropertyNames', function getOwnPropertyNames(value) {
return originalObjectGetOwnPropertyNames(ES.ToObject(value));
}, true);
+ Value.preserveToString(Object.getOwnPropertyNames, originalObjectGetOwnPropertyNames);
+ }
+ }
+ if (Object.getOwnPropertyDescriptor) {
+ var objectGOPDAcceptsPrimitives = (function () {
+ try {
+ Object.getOwnPropertyDescriptor('foo', 'bar');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectGOPDAcceptsPrimitives) {
+ var originalObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+ defineProperty(Object, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(value, property) {
+ return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value), property);
+ }, true);
+ Value.preserveToString(Object.getOwnPropertyDescriptor, originalObjectGetOwnPropertyDescriptor);
+ }
+ }
+ if (Object.seal) {
+ var objectSealAcceptsPrimitives = (function () {
+ try {
+ Object.seal('foo');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectSealAcceptsPrimitives) {
+ var originalObjectSeal = Object.seal;
+ defineProperty(Object, 'seal', function seal(value) {
+ if (!Type.object(value)) { return value; }
+ return originalObjectSeal(value);
+ }, true);
+ Value.preserveToString(Object.seal, originalObjectSeal);
+ }
+ }
+ if (Object.isSealed) {
+ var objectIsSealedAcceptsPrimitives = (function () {
+ try {
+ Object.isSealed('foo');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectIsSealedAcceptsPrimitives) {
+ var originalObjectIsSealed = Object.isSealed;
+ defineProperty(Object, 'isSealed', function isSealed(value) {
+ if (!Type.object(value)) { return true; }
+ return originalObjectIsSealed(value);
+ }, true);
+ Value.preserveToString(Object.isSealed, originalObjectIsSealed);
+ }
+ }
+ if (Object.freeze) {
+ var objectFreezeAcceptsPrimitives = (function () {
+ try {
+ Object.freeze('foo');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectFreezeAcceptsPrimitives) {
+ var originalObjectFreeze = Object.freeze;
+ defineProperty(Object, 'freeze', function freeze(value) {
+ if (!Type.object(value)) { return value; }
+ return originalObjectFreeze(value);
+ }, true);
+ Value.preserveToString(Object.freeze, originalObjectFreeze);
+ }
+ }
+ if (Object.isFrozen) {
+ var objectIsFrozenAcceptsPrimitives = (function () {
+ try {
+ Object.isFrozen('foo');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectIsFrozenAcceptsPrimitives) {
+ var originalObjectIsFrozen = Object.isFrozen;
+ defineProperty(Object, 'isFrozen', function isFrozen(value) {
+ if (!Type.object(value)) { return true; }
+ return originalObjectIsFrozen(value);
+ }, true);
+ Value.preserveToString(Object.isFrozen, originalObjectIsFrozen);
+ }
+ }
+ if (Object.preventExtensions) {
+ var objectPreventExtensionsAcceptsPrimitives = (function () {
+ try {
+ Object.preventExtensions('foo');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectPreventExtensionsAcceptsPrimitives) {
+ var originalObjectPreventExtensions = Object.preventExtensions;
+ defineProperty(Object, 'preventExtensions', function preventExtensions(value) {
+ if (!Type.object(value)) { return value; }
+ return originalObjectPreventExtensions(value);
+ }, true);
+ Value.preserveToString(Object.preventExtensions, originalObjectPreventExtensions);
+ }
+ }
+ if (Object.isExtensible) {
+ var objectIsExtensibleAcceptsPrimitives = (function () {
+ try {
+ Object.isExtensible('foo');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectIsExtensibleAcceptsPrimitives) {
+ var originalObjectIsExtensible = Object.isExtensible;
+ defineProperty(Object, 'isExtensible', function isExtensible(value) {
+ if (!Type.object(value)) { return false; }
+ return originalObjectIsExtensible(value);
+ }, true);
+ Value.preserveToString(Object.isExtensible, originalObjectIsExtensible);
+ }
+ }
+ if (Object.getPrototypeOf) {
+ var objectGetProtoAcceptsPrimitives = (function () {
+ try {
+ Object.getPrototypeOf('foo');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }());
+ if (!objectGetProtoAcceptsPrimitives) {
+ var originalGetProto = Object.getPrototypeOf;
+ defineProperty(Object, 'getPrototypeOf', function getPrototypeOf(value) {
+ return originalGetProto(ES.ToObject(value));
+ }, true);
+ Value.preserveToString(Object.getPrototypeOf, originalGetProto);
}
}
@@ -1173,7 +1370,7 @@
}
return new OrigRegExp(pattern, flags);
};
- defineProperty(RegExpShim, 'toString', OrigRegExp.toString.bind(OrigRegExp), true);
+ Value.preserveToString(RegExpShim, OrigRegExp);
if (Object.setPrototypeOf) {
// sets up proper prototype chain where possible
Object.setPrototypeOf(OrigRegExp, RegExpShim);
@@ -1869,7 +2066,7 @@
function Map(iterable) {
var map = this;
if (!ES.TypeIsObject(map)) {
- throw new TypeError('Map does not accept arguments when called as a function');
+ throw new TypeError("Constructor Map requires 'new'");
}
map = emulateES6construct(map);
if (!map._es6map) {
@@ -2059,7 +2256,7 @@
var SetShim = function Set(iterable) {
var set = this;
if (!ES.TypeIsObject(set)) {
- throw new TypeError('Set does not accept arguments when called as a function');
+ throw new TypeError("Constructor Set requires 'new'");
}
set = emulateES6construct(set);
if (!set._es6set) {
@@ -2488,5 +2685,51 @@
});
}
+ if (String(new Date(NaN)) !== 'Invalid Date') {
+ var dateToString = Date.prototype.toString;
+ var shimmedDateToString = function toString() {
+ var valueOf = +this;
+ if (valueOf !== valueOf) {
+ return 'Invalid Date';
+ }
+ return dateToString.call(this);
+ };
+ defineProperty(shimmedDateToString, 'toString', dateToString.toString, true);
+ defineProperty(Date.prototype, 'toString', shimmedDateToString, true);
+ }
+
+ // Annex B HTML methods
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-additional-properties-of-the-string.prototype-object
+ var stringHTMLshims = {
+ anchor: function anchor(name) { return ES.CreateHTML(this, 'a', 'name', name); },
+ big: function big() { return ES.CreateHTML(this, 'big', '', ''); },
+ blink: function blink() { return ES.CreateHTML(this, 'blink', '', ''); },
+ bold: function bold() { return ES.CreateHTML(this, 'b', '', ''); },
+ fixed: function fixed() { return ES.CreateHTML(this, 'tt', '', ''); },
+ fontcolor: function fontcolor(color) { return ES.CreateHTML(this, 'font', 'color', color); },
+ fontsize: function fontsize(size) { return ES.CreateHTML(this, 'font', 'size', size); },
+ italics: function italics() { return ES.CreateHTML(this, 'i', '', ''); },
+ link: function link(url) { return ES.CreateHTML(this, 'a', 'href', url); },
+ small: function small() { return ES.CreateHTML(this, 'small', '', ''); },
+ strike: function strike() { return ES.CreateHTML(this, 'strike', '', ''); },
+ sub: function sub() { return ES.CreateHTML(this, 'sub', '', ''); },
+ sup: function sub() { return ES.CreateHTML(this, 'sup', '', ''); }
+ };
+ defineProperties(String.prototype, stringHTMLshims);
+ Object.keys(stringHTMLshims).forEach(function (key) {
+ var method = String.prototype[key];
+ var shouldOverwrite = false;
+ if (ES.IsCallable(method)) {
+ var output = method.call('', ' " ');
+ var quotesCount = [].concat(output.match(/"/g)).length;
+ shouldOverwrite = output !== output.toLowerCase() || quotesCount > 2;
+ } else {
+ shouldOverwrite = true;
+ }
+ if (shouldOverwrite) {
+ defineProperty(String.prototype, key, stringHTMLshims[key], true);
+ }
+ });
+
return globals;
}));
diff --git a/js/vendor/es6-shim/es6-shim.map b/js/vendor/es6-shim/es6-shim.map
index 76b8c1bc1..0fc4156b5 100644
--- a/js/vendor/es6-shim/es6-shim.map
+++ b/js/vendor/es6-shim/es6-shim.map
@@ -1 +1 @@
-{"version":3,"sources":["es6-shim.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","isCallableWithoutNew","func","e","supportsSubclassing","C","f","Sub","apply","arguments","__proto__","Object","setPrototypeOf","prototype","create","constructor","value","arePropertyDescriptorsSupported","defineProperty","startsWithRejectsRegex","rejectsRegex","String","startsWith","getGlobal","Function","globals","global_isFinite","isFinite","supportsDescriptors","startsWithIsCompliant","_indexOf","call","bind","indexOf","_toString","toString","_hasOwnProperty","hasOwnProperty","ArrayIterator","noop","Symbol","symbolSpecies","species","Type","string","x","regex","symbol","object","name","force","configurable","enumerable","writable","Value","getter","TypeError","get","proxy","originalObject","key","targetObject","originalDescriptor","getOwnPropertyDescriptor","getKey","set","setKey","redefine","property","newValue","descriptor","defineProperties","map","keys","forEach","method","properties","Prototype","$iterator$","iterator","Set","addIterator","impl","o","isArguments","str","result","length","callee","safeApply","ES","Call","F","V","args","IsCallable","RequireObjectCoercible","optMessage","TypeIsObject","ToObject","ToInt32","ToNumber","ToUint32","ToInteger","number","Number","isNaN","Math","floor","abs","ToLength","len","MAX_SAFE_INTEGER","SameValue","a","b","SameValueZero","IsIterable","GetIterator","itFn","it","IteratorNext","next","Construct","obj","_es6construct","emulateES6construct","numberConversion","roundToEven","n","w","packIEEE754","v","ebits","fbits","bias","s","i","bits","bytes","pow","Infinity","min","log","LN2","push","reverse","join","parseInt","slice","unpackIEEE754","j","NaN","unpackFloat64","packFloat64","unpackFloat32","packFloat32","conversions","toFloat32","num","Float32Array","float32array","fromCodePoint","codePoints","RangeError","fromCharCode","raw","callSite","cooked","rawValue","rawString","literalsegments","stringElements","nextIndex","nextKey","nextSeg","nextSub","originalFromCodePoint","stringRepeat","repeat","times","half","stringMaxLength","StringShims","thisStr","searchStr","startArg","start","max","endsWith","thisLen","posArg","pos","end","includes","searchString","position","codePointAt","first","charCodeAt","isEnd","second","hasStringTrimBug","trim","ws","trimRegexp","RegExp","replace","StringIterator","_s","_i","done","substr","ArrayShims","from","iterable","mapFn","list","hasThisArg","thisArg","usingIterator","iterationValue","Array","of","arrayFromSwallowsNegativeLengths","iterator_result","array","kind","retval","ObjectIterator","getAllKeys","shift","ArrayPrototypeShims","copyWithin","target","to","fin","count","direction","fill","O","relativeStart","relativeEnd","find","predicate","findIndex","values","entries","unscopables","getPrototypeOf","maxSafeInteger","MIN_SAFE_INTEGER","EPSILON","parseFloat","isInteger","isSafeInteger","item","idx","assign","source","reduce","is","magic","checkArgs","proto","polyfill","FAKENULL","gpo","spo","p","objectKeysAcceptsPrimitives","originalObjectKeys","getOwnPropertyNames","objectGOPNAcceptsPrimitives","originalObjectGetOwnPropertyNames","flags","regExpFlagsGetter","global","ignoreCase","multiline","unicode","sticky","regExpSupportsFlagsWithRegex","OrigRegExp","RegExpShim","pattern","MathShims","acosh","E","sqrt","asinh","atanh","cbrt","negate","clz32","cosh","exp","expm1","t","sum","hypot","y","anyNaN","allZero","anyInfinity","numbers","every","arg","sort","largest","divided","log2","LOG2E","log10","LOG10E","log1p","sign","sinh","tanh","trunc","imul","ah","al","bh","bl","fround","MAX_VALUE","expm1OfTen","roundHandlesBoundaryConditions","round","origMathRound","PromiseShim","Promise","Promise$prototype","IsPromise","promise","_promiseConstructor","_status","PromiseCapability","capability","resolver","resolve","reject","setTimeout","makeZeroTimeout","window","postMessage","timeouts","messageName","setZeroTimeout","fn","handleMessage","event","data","stopPropagation","addEventListener","makePromiseAsap","P","task","then","enqueue","setImmediate","process","nextTick","updatePromiseFromPotentialThenable","triggerPromiseReactions","reactions","reaction","handler","updateResult","promiseResolutionHandler","onFulfilled","onRejected","_resolveReactions","_rejectReactions","resolution","_result","reason","_promiseAllResolver","index","remaining","all","nextPromise","resolveElement","race","rejectPromise","resolvePromise","catch","resolutionHandler","resolveReaction","rejectReaction","accept","defer","chain","promiseSupportsSubclassing","S","promiseIgnoresNonFunctionThenCallbacks","ex","promiseRequiresObjectContext","testOrder","k","preservesInsertionOrder","preservesNumericInsertionOrder","fastkey","type","emptyObject","collectionShims","Map","empty","MapEntry","prev","isRemoved","MapIterator","head","_head","_es6map","_storage","_size","adder","nextItem","Map$prototype","fkey","entry","has","delete","clear","callback","context","SetShim","_es6set","[[SetData]]","add","Set$prototype","ensureMap","m","charAt","size","hasFKey","entireSet","M","Reflect","throwUnlessTargetIsObject","construct","deleteProperty","desc","enumerate","ownKeys","getOwnPropertySymbols","preventExtensions","isExtensible","callAndCatchException","internal_get","receiver","parent","undefined","internal_set","existingDesc","ConvertExceptionToBoolean","_","propertyKey","attributes","objectDotGetPrototypeOf","willCreateCircularPrototype"],"mappings":";;;;;;;;;CAYC,SAAUA,EAAMC,GAEf,SAAWC,UAAW,YAAcA,OAAOC,IAAK,CAE9CD,OAAOD,OACF,UAAWG,WAAY,SAAU,CAItCC,OAAOD,QAAUH,QACZ,CAELD,EAAKM,cAAgBL,OAEvBM,KAAM,WACN,YAEA,IAAIC,GAAuB,SAAUC,GACnC,IACEA,IACA,MAAOC,GACP,MAAO,OAET,MAAO,MAGT,IAAIC,GAAsB,SAAUC,EAAGC,GAErC,IACE,GAAIC,GAAM,WAAcF,EAAEG,MAAMR,KAAMS,WACtC,KAAKF,EAAIG,UAAW,CAAE,MAAO,OAC7BC,OAAOC,eAAeL,EAAKF,EAC3BE