diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-10-25 13:34:15 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-10-25 13:34:15 +0100 |
commit | bf7ff10a5114c0517cd7082ee95ccecb0c7f807d (patch) | |
tree | 1f9487f4a90a3d095791e36a9a83b661b7534655 /js/vendor/es6-shim | |
parent | 66092f836580bc4a6e0bb203015d9772560c1cb0 (diff) |
update bower deps
Diffstat (limited to 'js/vendor/es6-shim')
-rw-r--r-- | js/vendor/es6-shim/.bower.json | 8 | ||||
-rw-r--r-- | js/vendor/es6-shim/CHANGELOG.md | 35 | ||||
-rw-r--r-- | js/vendor/es6-shim/README.md | 9 | ||||
-rw-r--r-- | js/vendor/es6-shim/component.json | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-sham.js | 13 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-sham.map | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-sham.min.js | 6 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-shim.js | 271 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-shim.map | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-shim.min.js | 8 | ||||
-rw-r--r-- | js/vendor/es6-shim/package.json | 15 |
11 files changed, 245 insertions, 126 deletions
diff --git a/js/vendor/es6-shim/.bower.json b/js/vendor/es6-shim/.bower.json index cca9aaecd..a0e5ad62d 100644 --- a/js/vendor/es6-shim/.bower.json +++ b/js/vendor/es6-shim/.bower.json @@ -27,12 +27,12 @@ "test" ], "homepage": "https://github.com/paulmillr/es6-shim", - "version": "0.33.3", - "_release": "0.33.3", + "version": "0.33.8", + "_release": "0.33.8", "_resolution": { "type": "version", - "tag": "0.33.3", - "commit": "616eee62ceed6f1e988abab4e49d6d682702be1b" + "tag": "0.33.8", + "commit": "bdc0510b2db1366713f084c1d2d2fde4b1500f0e" }, "_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 b18eddc42..3bd76e678 100644 --- a/js/vendor/es6-shim/CHANGELOG.md +++ b/js/vendor/es6-shim/CHANGELOG.md @@ -1,5 +1,40 @@ # es6-shim x.x.x (not yet released) +# es6-shim 0.33.8 (23 Oct 2015) +* [Fix] IE 8: `Promise.resolve(2)` was throwing. More named function expression madness. +* [Tests] Reflect: Don't attempt to define properties on this test object unless we're in true ES5. + +# es6-shim 0.33.7 (23 Oct 2015) +* [Fix] Ensure `preserveToString` does not throw when the original does not exist (#359) +* [Fix] `Promise`: properly handle named function expressions in IE 8. +* [Fix] `Number`: `wrapConstructor` now works in ES3 (#365) +* [Docs] Document `Number` supporting string binary and octal literals. +* [Tests] add commented-out test for `typeof Number.call(Object(3), 3) === 'number'`, which fails atm. +* [Tests] Fix browser tests sans-`npm install` +* [Dev Deps] update `es5-shim`, `jscs`, `uglify-js`, `chai` + +# es6-shim 0.33.6 (29 Sep 2015) +* [Fix] In IE 6-8, of course, `typeof setTimeout` is "object" +* [Tests] Upgrade jQuery on the test HTML pages + +# es6-shim 0.33.5 (28 Sep 2015) +* [Fix] IE 6-8 have wacky scoping issues with named function expressions. +* [Fix] Apparently in IE 8, RegExp#test is an own property of regexes, not a prototype method +* [Fix] Make sure to treat `es5-sham`'s `Object.defineProperty` as unsupported, in IE 8 + +# es6-shim 0.33.4 (27 Sep 2015) +* [Fix] Add test, and fix, for `JSON.stringify(Object(Symbol()))` throwing on Chrome 45 +* [Fix] Wrap `JSON.stringify` when `Symbol` exists and it fails to serialize them correctly +* [Fix] fix `Reflect.defineProperty` on edge v0.12 +* [Robustness] Cache `Array.isArray` internally +* [Refactor] Use internal `overrideNative` helper for String.prototype HTML methods +* [Refactor] Update `is-arguments` implementation; don't call down legacy code path in modern engines +* [Tests] Add `evalmd` to verify that example code blocks are valid +* [Tests] Adding a test for Safari 7.1 and later (runtime check added in 8a8ddd36186cdc1fcb3fcc259ec9ecef1e141901) +* [Tests] Add additional `JSON.stringify` test for `Symbol` and object `Symbol` values +* [Tests] up to `io.js` `v3.3`, `node` `v4.1` +* [Dev Deps] update `es5-shim`, `mocha`, `chai` + # es6-shim 0.33.3 (31 Aug 2015) * [Fix] Handle Firefox Nightly's broken `construct` method * [Tests] Add `JSON.stringify` tests for handling `Symbol`s diff --git a/js/vendor/es6-shim/README.md b/js/vendor/es6-shim/README.md index 074dd5af2..9e1b54169 100644 --- a/js/vendor/es6-shim/README.md +++ b/js/vendor/es6-shim/README.md @@ -44,6 +44,7 @@ In both browser and node you may also want to include `unorm`; see the [`String. * `RegExp.prototype`: * `flags` (requires ES5) ([a standalone shim is also available](https://github.com/es-shims/RegExp.prototype.flags)) * `Number`: + * binary and octal literals: `Number('0b1')` and `Number('0o7')` * `EPSILON` * `MAX_SAFE_INTEGER` * `MIN_SAFE_INTEGER` @@ -213,8 +214,14 @@ Promise.resolve(5).then(function (value) { ## Caveats -- `Object.setPrototypeOf` / `Reflect.setPrototypeOf` + - `Object.setPrototypeOf` / `Reflect.setPrototypeOf` - Note that null objects (`Object.create(null)`, eg, an object with `null` as its `[[Prototype]]`) can not have their `[[Prototype]]` changed except via a native `Object.setPrototypeOf`. + - `Number`: + - In order to support binary literals (`Number('0b1')`) and octal literals (`Number('0o7')`), the global `Number` constructor is wrapped in a shim. However, this can cause issues in the exceedingly unlikely event that you ever call `Number` as a function with a receiver (a “this” value) that is itself a number. Some problematic examples: +```js + assert(typeof Number.call(2, 3) === 'number'); // will fail when `Number` is wrapped, is "object" + assert(typeof (1).constructor(2) === 'number'); // will fail when `Number` is wrapped, is "object" +``` ## [License][license-url] diff --git a/js/vendor/es6-shim/component.json b/js/vendor/es6-shim/component.json index f2cf9dc15..fd52e0b97 100644 --- a/js/vendor/es6-shim/component.json +++ b/js/vendor/es6-shim/component.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.33.3", + "version": "0.33.8", "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 09d6218cb..851b83046 100644 --- a/js/vendor/es6-shim/es6-sham.js +++ b/js/vendor/es6-shim/es6-sham.js @@ -2,8 +2,8 @@ * https://github.com/paulmillr/es6-shim * @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com) * and contributors, MIT License - * es6-sham: v0.33.3 - * see https://github.com/paulmillr/es6-shim/blob/0.33.3/LICENSE + * es6-sham: v0.33.8 + * see https://github.com/paulmillr/es6-shim/blob/0.33.8/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ @@ -106,11 +106,14 @@ // Safari, old Firefox, many others setPrototypeOf = function (origin, proto) { // if proto is not null - return getPrototypeOf(origin) ? + if (getPrototypeOf(origin)) { // use __proto__ to promote - ((origin.__proto__ = proto), origin) : + origin.__proto__ = proto; + return origin; + } else { // otherwise unable to promote: fallback - createAndCopy(origin, proto); + return createAndCopy(origin, proto); + } }; } } diff --git a/js/vendor/es6-shim/es6-sham.map b/js/vendor/es6-shim/es6-sham.map index 1e11c311a..aed17fdff 100644 --- a/js/vendor/es6-shim/es6-sham.map +++ b/js/vendor/es6-shim/es6-sham.map @@ -1 +1 @@ -{"version":3,"sources":["es6-sham.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","getGlobal","Function","globals","Object","setPrototypeOf","getOwnPropertyNames","getOwnPropertyDescriptor","create","defineProperty","getPrototypeOf","objProto","prototype","copyDescriptors","target","source","forEach","key","createAndCopy","origin","proto","set","call","e","__proto__"],"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,YAGA,IAAIC,GAAY,GAAIC,UAAS,eAG7B,IAAIC,GAAUF,GACd,IAAIG,GAASD,EAAQC,QAWpB,WACC,GAAIA,EAAOC,eAAgB,CAAE,OAK7B,GAAIC,GAAsBF,EAAOE,mBACjC,IAAIC,GAA2BH,EAAOG,wBACtC,IAAIC,GAASJ,EAAOI,MACpB,IAAIC,GAAiBL,EAAOK,cAC5B,IAAIC,GAAiBN,EAAOM,cAC5B,IAAIC,GAAWP,EAAOQ,SAEtB,IAAIC,GAAkB,SAAUC,EAAQC,GAEtCT,EAAoBS,GAAQC,QAAQ,SAAUC,GAC5CR,EACEK,EACAG,EACAV,EAAyBQ,EAAQE,KAGrC,OAAOH,GAGT,IAAII,GAAgB,SAAUC,EAAQC,GACpC,MAAOP,GAAgBL,EAAOY,GAAQD,GAExC,IAAIE,GAAKhB,CACT,KAGEgB,EAAMd,EAAyBI,EAAU,aAAaU,GACtDA,GAAIC,QAAS,KAGbjB,GAAiB,SAAUc,EAAQC,GACjCC,EAAIC,KAAKH,EAAQC,EACjB,OAAOD,IAET,MAAOI,GAEPF,GAAOG,UAAW,KAGlB,IAAIH,YAAejB,GAAQ,CACzBC,EAAiBa,MACZ,CAELG,EAAIG,UAAYb,CAGhB,IAAIU,YAAejB,GAAQ,CACzBC,EAAiB,SAAUc,EAAQC,GAEjCD,EAAOK,UAAYJ,CACnB,OAAOD,QAEJ,CAGLd,EAAiB,SAAUc,EAAQC,GAEjC,MAAOV,GAAeS,IAElBA,EAAOK,UAAYJ,EAAQD,GAE7BD,EAAcC,EAAQC,MAKhChB,EAAOC,eAAiBA"}
\ No newline at end of file +{"version":3,"sources":["es6-sham.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","getGlobal","Function","globals","Object","setPrototypeOf","getOwnPropertyNames","getOwnPropertyDescriptor","create","defineProperty","getPrototypeOf","objProto","prototype","copyDescriptors","target","source","forEach","key","createAndCopy","origin","proto","set","call","e","__proto__"],"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,YAGA,IAAIC,GAAY,GAAIC,UAAS,eAG7B,IAAIC,GAAUF,GACd,IAAIG,GAASD,EAAQC,QAWpB,WACC,GAAIA,EAAOC,eAAgB,CAAE,OAK7B,GAAIC,GAAsBF,EAAOE,mBACjC,IAAIC,GAA2BH,EAAOG,wBACtC,IAAIC,GAASJ,EAAOI,MACpB,IAAIC,GAAiBL,EAAOK,cAC5B,IAAIC,GAAiBN,EAAOM,cAC5B,IAAIC,GAAWP,EAAOQ,SAEtB,IAAIC,GAAkB,SAAUC,EAAQC,GAEtCT,EAAoBS,GAAQC,QAAQ,SAAUC,GAC5CR,EACEK,EACAG,EACAV,EAAyBQ,EAAQE,KAGrC,OAAOH,GAGT,IAAII,GAAgB,SAAUC,EAAQC,GACpC,MAAOP,GAAgBL,EAAOY,GAAQD,GAExC,IAAIE,GAAKhB,CACT,KAGEgB,EAAMd,EAAyBI,EAAU,aAAaU,GACtDA,GAAIC,QAAS,KAGbjB,GAAiB,SAAUc,EAAQC,GACjCC,EAAIC,KAAKH,EAAQC,EACjB,OAAOD,IAET,MAAOI,GAEPF,GAAOG,UAAW,KAGlB,IAAIH,YAAejB,GAAQ,CACzBC,EAAiBa,MACZ,CAELG,EAAIG,UAAYb,CAGhB,IAAIU,YAAejB,GAAQ,CACzBC,EAAiB,SAAUc,EAAQC,GAEjCD,EAAOK,UAAYJ,CACnB,OAAOD,QAEJ,CAGLd,EAAiB,SAAUc,EAAQC,GAEjC,GAAIV,EAAeS,GAAS,CAE1BA,EAAOK,UAAYJ,CACnB,OAAOD,OACF,CAEL,MAAOD,GAAcC,EAAQC,OAMvChB,EAAOC,eAAiBA"}
\ No newline at end of file diff --git a/js/vendor/es6-shim/es6-sham.min.js b/js/vendor/es6-shim/es6-sham.min.js index b75ca177b..f8372331f 100644 --- a/js/vendor/es6-shim/es6-sham.min.js +++ b/js/vendor/es6-shim/es6-sham.min.js @@ -2,10 +2,10 @@ * https://github.com/paulmillr/es6-shim * @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com) * and contributors, MIT License - * es6-sham: v0.33.3 - * see https://github.com/paulmillr/es6-shim/blob/0.33.3/LICENSE + * es6-sham: v0.33.8 + * see https://github.com/paulmillr/es6-shim/blob/0.33.8/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ -(function(t,e){if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){"use strict";var t=new Function("return this;");var e=t();var r=e.Object;(function(){if(r.setPrototypeOf){return}var t=r.getOwnPropertyNames;var e=r.getOwnPropertyDescriptor;var n=r.create;var o=r.defineProperty;var f=r.getPrototypeOf;var i=r.prototype;var c=function(r,n){t(n).forEach(function(t){o(r,t,e(n,t))});return r};var u=function(t,e){return c(n(e),t)};var a,_;try{a=e(i,"__proto__").set;a.call({},null);_=function(t,e){a.call(t,e);return t}}catch(p){a={__proto__:null};if(a instanceof r){_=u}else{a.__proto__=i;if(a instanceof r){_=function(t,e){t.__proto__=e;return t}}else{_=function(t,e){return f(t)?(t.__proto__=e,t):u(t,e)}}}}r.setPrototypeOf=_})()}); +(function(t,e){if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){"use strict";var t=new Function("return this;");var e=t();var r=e.Object;(function(){if(r.setPrototypeOf){return}var t=r.getOwnPropertyNames;var e=r.getOwnPropertyDescriptor;var n=r.create;var o=r.defineProperty;var f=r.getPrototypeOf;var i=r.prototype;var u=function(r,n){t(n).forEach(function(t){o(r,t,e(n,t))});return r};var c=function(t,e){return u(n(e),t)};var a,_;try{a=e(i,"__proto__").set;a.call({},null);_=function(t,e){a.call(t,e);return t}}catch(p){a={__proto__:null};if(a instanceof r){_=c}else{a.__proto__=i;if(a instanceof r){_=function(t,e){t.__proto__=e;return t}}else{_=function(t,e){if(f(t)){t.__proto__=e;return t}else{return c(t,e)}}}}}r.setPrototypeOf=_})()}); //# sourceMappingURL=es6-sham.map diff --git a/js/vendor/es6-shim/es6-shim.js b/js/vendor/es6-shim/es6-shim.js index f16d48573..feb438909 100644 --- a/js/vendor/es6-shim/es6-shim.js +++ b/js/vendor/es6-shim/es6-shim.js @@ -2,8 +2,8 @@ * https://github.com/paulmillr/es6-shim * @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com) * and contributors, MIT License - * es6-shim: v0.33.3 - * see https://github.com/paulmillr/es6-shim/blob/0.33.3/LICENSE + * es6-shim: v0.33.8 + * see https://github.com/paulmillr/es6-shim/blob/0.33.8/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ @@ -29,6 +29,7 @@ var _apply = Function.call.bind(Function.apply); var _call = Function.call.bind(Function.call); + var isArray = Array.isArray; var not = function notThunker(func) { return function notThunk() { return !_apply(func, this, arguments); }; @@ -52,7 +53,7 @@ var isCallableWithoutNew = not(throwsError); var arePropertyDescriptorsSupported = function () { // if Object.defineProperty exists but throws, it's IE 8 - return !throwsError(function () { Object.defineProperty({}, 'x', {}); }); + return !throwsError(function () { Object.defineProperty({}, 'x', { get: function () {} }); }); }; var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported(); var functionsHaveNames = (function foo() {}).name === 'foo'; @@ -133,30 +134,19 @@ }); }; - var startsWithRejectsRegex = function () { - return String.prototype.startsWith && throwsError(function () { - /* throws if spec-compliant */ - '/a/'.startsWith(/a/); - }); - }; - var startsWithHandlesInfinity = (function () { - return String.prototype.startsWith && 'abc'.startsWith('a', Infinity) === false; - }()); - var getGlobal = function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } - throw new Error('unable to locate global object'); + throw new Error('unable to locate global object'); }; var globals = getGlobal(); var globalIsFinite = globals.isFinite; var hasStrictMode = (function () { return this === null; }.call(null)); - var startsWithIsCompliant = startsWithRejectsRegex() && startsWithHandlesInfinity; var _indexOf = Function.call.bind(String.prototype.indexOf); var _toString = Function.call.bind(Object.prototype.toString); var _concat = Function.call.bind(Array.prototype.concat); @@ -217,7 +207,9 @@ } }, preserveToString: function (target, source) { - defineProperty(target, 'toString', source.toString.bind(source), true); + if (source && ES.IsCallable(source.toString)) { + defineProperty(target, 'toString', source.toString.bind(source), true); + } } }; @@ -227,10 +219,17 @@ // sets up proper prototype chain where possible Object.setPrototypeOf(original, replacement); } - _forEach(Object.getOwnPropertyNames(original), function (key) { - if (key in noop || keysToSkip[key]) { return; } - Value.proxy(original, key, replacement); - }); + if (supportsDescriptors) { + _forEach(Object.getOwnPropertyNames(original), function (key) { + if (key in noop || keysToSkip[key]) { return; } + Value.proxy(original, key, replacement); + }); + } else { + _forEach(Object.keys(original), function (key) { + if (key in noop || keysToSkip[key]) { return; } + replacement[key] = original[key]; + }); + } replacement.prototype = original.prototype; Value.redefine(original.prototype, 'constructor', replacement); }; @@ -292,19 +291,18 @@ // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js // can be replaced with require('is-arguments') if we ever use a build process instead - var isArguments = function isArguments(value) { - var str = _toString(value); - var result = str === '[object Arguments]'; - if (!result) { - result = str !== '[object Array]' && - value !== null && - typeof value === 'object' && - typeof value.length === 'number' && - value.length >= 0 && - _toString(value.callee) === '[object Function]'; - } - return result; + var isStandardArguments = function isArguments(value) { + return _toString(value) === '[object Arguments]'; + }; + var isLegacyArguments = function isArguments(value) { + return value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + _toString(value) !== '[object Array]' && + _toString(value.callee) === '[object Function]'; }; + var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; var ES = { // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args @@ -598,11 +596,11 @@ return stringElements.join(''); } }; - defineProperties(String, StringShims); - if (String.raw({ raw: { 0: 'x', 1: 'y', length: 2 } }) !== 'xy') { + if (String.raw && String.raw({ raw: { 0: 'x', 1: 'y', length: 2 } }) !== 'xy') { // IE 11 TP has a broken String.raw implementation overrideNative(String, 'raw', StringShims.raw); } + defineProperties(String, StringShims); // Fast repeat, uses the `Exponentiation by squaring` algorithm. // Perf: http://jsperf.com/string-repeat2/2 @@ -678,12 +676,25 @@ } } }; - defineProperties(String.prototype, StringPrototypeShims); - - if ('a'.includes('a', Infinity) !== false) { + if (String.prototype.includes && 'a'.includes('a', Infinity) !== false) { overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); } + if (String.prototype.startsWith && String.prototype.endsWith) { + var startsWithRejectsRegex = throwsError(function () { + /* throws if spec-compliant */ + '/a/'.startsWith(/a/); + }); + var startsWithHandlesInfinity = 'abc'.startsWith('a', Infinity) === false; + if (!startsWithRejectsRegex || !startsWithHandlesInfinity) { + // Firefox (< 37?) and IE 11 TP have a noncompliant startsWith implementation + overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); + overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); + } + } + + defineProperties(String.prototype, StringPrototypeShims); + var hasStringTrimBug = '\u0085'.trim().length !== 1; if (hasStringTrimBug) { delete String.prototype.trim; @@ -732,12 +743,6 @@ return new StringIterator(this); }); - if (!startsWithIsCompliant) { - // Firefox (< 37?) and IE 11 TP have a noncompliant startsWith implementation - overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); - overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); - } - var ArrayShims = { from: function from(items) { var C = this; @@ -803,7 +808,7 @@ of: function of() { var len = arguments.length; var C = this; - var A = Array.isArray(C) || !ES.IsCallable(C) ? new Array(len) : ES.Construct(C, [len]); + var A = isArray(C) || !ES.IsCallable(C) ? new Array(len) : ES.Construct(C, [len]); for (var k = 0; k < len; ++k) { createDataPropertyOrThrow(A, k, arguments[k]); } @@ -1057,7 +1062,7 @@ var arrayFromHandlesIterables = (function () { // Detects a bug in Webkit nightly r181886 var arr = Array.from([0].entries()); - return arr.length === 1 && Array.isArray(arr[0]) && arr[0][0] === 0 && arr[0][1] === 0; + return arr.length === 1 && isArray(arr[0]) && arr[0][0] === 0 && arr[0][1] === 0; }()); if (!arrayFromSwallowsNegativeLengths || !arrayFromHandlesIterables) { overrideNative(Array, 'from', ArrayShims.from); @@ -1134,8 +1139,11 @@ if (Number('0o10') !== 8 || Number('0b10') !== 2) { var OrigNumber = Number; - var isBinary = Function.bind.call(Function.call, RegExp.prototype.test, /^0b/i); - var isOctal = Function.bind.call(Function.call, RegExp.prototype.test, /^0o/i); + var binaryRegex = /^0b/i; + var octalRegex = /^0o/i; + // Note that in IE 8, RegExp.prototype.test doesn't seem to exist: ie, "test" is an own property of regexes. wtf. + var isBinary = binaryRegex.test.bind(binaryRegex); + var isOctal = octalRegex.test.bind(octalRegex); var toPrimitive = function (O) { // need to replace this with `es-to-primitive/es6` var result; if (typeof O.valueOf === 'function') { @@ -1152,22 +1160,30 @@ } throw new TypeError('No default value'); }; - var NumberShim = function Number(value) { - var primValue = Type.primitive(value) ? value : toPrimitive(value, 'number'); - if (typeof primValue === 'string') { - if (isBinary(primValue)) { - primValue = parseInt(_strSlice(primValue, 2), 2); - } else if (isOctal(primValue)) { - primValue = parseInt(_strSlice(primValue, 2), 8); + var NumberShim = (function () { + // this is wrapped in an IIFE because of IE 6-8's wacky scoping issues with named function expressions. + return function Number(value) { + var primValue = Type.primitive(value) ? value : toPrimitive(value, 'number'); + if (typeof primValue === 'string') { + if (isBinary(primValue)) { + primValue = parseInt(_strSlice(primValue, 2), 2); + } else if (isOctal(primValue)) { + primValue = parseInt(_strSlice(primValue, 2), 8); + } } - } - if (this instanceof Number) { - return new OrigNumber(primValue); - } - /* jshint newcap: false */ - return OrigNumber(primValue); - /* jshint newcap: true */ - }; + var receiver = this; + var valueOfSucceeds = valueOrFalseIfThrows(function () { + Number.prototype.valueOf.call(receiver); + return true; + }); + if (receiver instanceof Number && !valueOfSucceeds) { + return new OrigNumber(primValue); + } + /* jshint newcap: false */ + return OrigNumber(primValue); + /* jshint newcap: true */ + }; + }()); wrapConstructor(OrigNumber, NumberShim, {}); /*globals Number: true */ Number = NumberShim; @@ -1772,7 +1788,7 @@ var PromiseShim = (function () { var setTimeout = globals.setTimeout; // some environments don't have setTimeout - no way to shim here. - if (typeof setTimeout !== 'function') { return; } + if (typeof setTimeout !== 'function' && typeof setTimeout !== 'object') { return; } ES.IsPromise = function (promise) { if (!ES.TypeIsObject(promise)) { @@ -1839,12 +1855,14 @@ }; }; /*global process */ + /* jscs:disable disallowMultiLineTernary */ var enqueue = ES.IsCallable(globals.setImmediate) ? globals.setImmediate.bind(globals) : typeof process === 'object' && process.nextTick ? process.nextTick : makePromiseAsap() || (ES.IsCallable(makeZeroTimeout) ? makeZeroTimeout() : function (task) { setTimeout(task, 0); }); // fallback + /* jscs:enable disallowMultiLineTernary */ // Constants for Promise implementation var PROMISE_IDENTITY = 1; @@ -1957,34 +1975,37 @@ return C; }; - var Promise = function Promise(resolver) { - if (!(this instanceof Promise)) { - throw new TypeError('Constructor Promise requires "new"'); - } - if (this && this._promise) { - throw new TypeError('Bad construction'); - } - // see https://bugs.ecmascript.org/show_bug.cgi?id=2482 - if (!ES.IsCallable(resolver)) { - throw new TypeError('not a valid resolver'); - } - var promise = emulateES6construct(this, Promise, Promise$prototype, { - _promise: { - result: void 0, - state: PROMISE_PENDING, - fulfillReactions: [], - rejectReactions: [] + var Promise = (function () { + var PromiseShim = function Promise(resolver) { + if (!(this instanceof PromiseShim)) { + throw new TypeError('Constructor Promise requires "new"'); } - }); - var resolvingFunctions = createResolvingFunctions(promise); - var reject = resolvingFunctions.reject; - try { - resolver(resolvingFunctions.resolve, reject); - } catch (e) { - reject(e); - } - return promise; - }; + if (this && this._promise) { + throw new TypeError('Bad construction'); + } + // see https://bugs.ecmascript.org/show_bug.cgi?id=2482 + if (!ES.IsCallable(resolver)) { + throw new TypeError('not a valid resolver'); + } + var promise = emulateES6construct(this, PromiseShim, Promise$prototype, { + _promise: { + result: void 0, + state: PROMISE_PENDING, + fulfillReactions: [], + rejectReactions: [] + } + }); + var resolvingFunctions = createResolvingFunctions(promise); + var reject = resolvingFunctions.reject; + try { + resolver(resolvingFunctions.resolve, reject); + } catch (e) { + reject(e); + } + return promise; + }; + return PromiseShim; + }()); var Promise$prototype = Promise.prototype; var _promiseAllResolver = function (index, values, capability, remaining) { @@ -2248,7 +2269,7 @@ }; var addIterableToMap = function addIterableToMap(MapConstructor, map, iterable) { - if (Array.isArray(iterable) || Type.string(iterable)) { + if (isArray(iterable) || Type.string(iterable)) { _forEach(iterable, function (entry) { map.set(entry[0], entry[1]); }); @@ -2282,7 +2303,7 @@ } }; var addIterableToSet = function addIterableToSet(SetConstructor, set, iterable) { - if (Array.isArray(iterable) || Type.string(iterable)) { + if (isArray(iterable) || Type.string(iterable)) { _forEach(iterable, function (value) { set.add(value); }); @@ -3184,9 +3205,11 @@ } } if (globals.Reflect.defineProperty) { - if (valueOrFalseIfThrows(function () { - globals.Reflect.defineProperty(1, 'test', { value: 1 }); - return true; + if (!valueOrFalseIfThrows(function () { + var basic = !globals.Reflect.defineProperty(1, 'test', { value: 1 }); + // "extensible" fails on Edge 0.12 + var extensible = typeof Object.preventExtensions !== 'function' || !globals.Reflect.defineProperty(Object.preventExtensions({}), 'test', {}); + return basic && extensible; })) { overrideNative(globals.Reflect, 'defineProperty', ReflectShims.defineProperty); } @@ -3240,9 +3263,59 @@ shouldOverwrite = true; } if (shouldOverwrite) { - defineProperty(String.prototype, key, stringHTMLshims[key], true); + overrideNative(String.prototype, key, stringHTMLshims[key]); } }); + var JSONstringifiesSymbols = (function () { + // Microsoft Edge v0.12 stringifies Symbols incorrectly + if (!Type.symbol(Symbol.iterator)) { return false; } // Symbols are not supported + var stringify = typeof JSON === 'object' && typeof JSON.stringify === 'function' ? JSON.stringify : null; + if (!stringify) { return false; } // JSON.stringify is not supported + if (typeof stringify(Symbol()) !== 'undefined') { return true; } // Symbols should become `undefined` + if (stringify([Symbol()]) !== '[null]') { return true; } // Symbols in arrays should become `null` + var obj = { a: Symbol() }; + obj[Symbol()] = true; + if (stringify(obj) !== '{}') { return true; } // Symbol-valued keys *and* Symbol-valued properties should be omitted + return false; + }()); + var JSONstringifyAcceptsObjectSymbol = valueOrFalseIfThrows(function () { + // Chrome 45 throws on stringifying object symbols + if (!Type.symbol(Symbol.iterator)) { return true; } // Symbols are not supported + return JSON.stringify(Object(Symbol())) === '{}' && JSON.stringify([Object(Symbol())]) === '[{}]'; + }); + if (JSONstringifiesSymbols || !JSONstringifyAcceptsObjectSymbol) { + var origStringify = JSON.stringify; + overrideNative(JSON, 'stringify', function stringify(value) { + if (typeof value === 'symbol') { return; } + var replacer; + if (arguments.length > 1) { + replacer = arguments[1]; + } + var args = [value]; + if (!isArray(replacer)) { + var replaceFn = ES.IsCallable(replacer) ? replacer : null; + var wrappedReplacer = function (key, val) { + var parsedValue = replacer ? _call(replacer, this, key, val) : val; + if (typeof parsedValue !== 'symbol') { + if (Type.symbol(parsedValue)) { + return assignTo({})(parsedValue); + } else { + return parsedValue; + } + } + }; + args.push(wrappedReplacer); + } else { + // create wrapped replacer that handles an array replacer? + args.push(replacer); + } + if (arguments.length > 2) { + args.push(arguments[2]); + } + return origStringify.apply(this, args); + }); + } + return globals; })); diff --git a/js/vendor/es6-shim/es6-shim.map b/js/vendor/es6-shim/es6-shim.map index a7b8317e9..180c582c5 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","_apply","Function","call","bind","apply","_call","not","notThunker","func","notThunk","arguments","throwsError","e","valueOrFalseIfThrows","isCallableWithoutNew","arePropertyDescriptorsSupported","Object","defineProperty","supportsDescriptors","functionsHaveNames","foo","name","_forEach","Array","prototype","forEach","_reduce","reduce","_filter","filter","_every","every","createDataProperty","object","value","configurable","enumerable","writable","createDataPropertyOrThrow","ES","SameValue","TypeError","force","defineProperties","map","keys","method","create","properties","Prototype","key","Value","defineByDescriptor","supportsSubclassing","C","f","setPrototypeOf","Sub","Subclass","arg","o","constructor","startsWithRejectsRegex","String","startsWith","startsWithHandlesInfinity","Infinity","getGlobal","self","window","global","Error","globals","globalIsFinite","isFinite","hasStrictMode","startsWithIsCompliant","_indexOf","indexOf","_toString","toString","_concat","concat","_strSlice","slice","_push","push","_pushApply","_shift","shift","_max","Math","max","_min","min","_floor","floor","_abs","abs","_log","log","_sqrt","sqrt","_hasOwnProperty","hasOwnProperty","ArrayIterator","noop","Symbol","symbolSpecies","species","getter","get","proxy","originalObject","targetObject","originalDescriptor","getOwnPropertyDescriptor","getKey","set","setKey","redefine","property","newValue","descriptor","preserveToString","target","source","wrapConstructor","original","replacement","keysToSkip","getOwnPropertyNames","defaultSpeciesGetter","addDefaultSpecies","Type","primitive","x","string","regex","symbol","numberIsNaN","Number","isNaN","numberIsFinite","overrideNative","$iterator$","iterator","Set", |