diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-12 17:21:08 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-12 17:21:08 +0100 |
commit | 104cf2afe06c7a51dee47b412a508bc9b0d83a69 (patch) | |
tree | 0221feb96a09546a3a66c23b24469ef3f91d17c2 /js/vendor/es6-shim | |
parent | ec700890c0484250edb4796b197d490df99daa42 (diff) |
update es6 shim
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 | 30 | ||||
-rw-r--r-- | js/vendor/es6-shim/Gruntfile.js | 74 | ||||
-rw-r--r-- | js/vendor/es6-shim/README.md | 67 | ||||
-rw-r--r-- | js/vendor/es6-shim/component.json | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-sham.js | 14 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-sham.map | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-sham.min.js | 4 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-shim.js | 465 | ||||
-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 | 20 | ||||
-rw-r--r-- | js/vendor/es6-shim/test-sham/set-prototype-of.js | 3 |
13 files changed, 396 insertions, 303 deletions
diff --git a/js/vendor/es6-shim/.bower.json b/js/vendor/es6-shim/.bower.json index a0e5ad62d..00499dbf6 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.8", - "_release": "0.33.8", + "version": "0.33.12", + "_release": "0.33.12", "_resolution": { "type": "version", - "tag": "0.33.8", - "commit": "bdc0510b2db1366713f084c1d2d2fde4b1500f0e" + "tag": "0.33.12", + "commit": "2fc76e7c759cbc1643722bc21132e246f935d4e1" }, "_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 3bd76e678..244cd55d0 100644 --- a/js/vendor/es6-shim/CHANGELOG.md +++ b/js/vendor/es6-shim/CHANGELOG.md @@ -1,5 +1,35 @@ # es6-shim x.x.x (not yet released) +# es6-shim 0.33.12 (11 Nov 2015) +* [Fix] IE 8: more NFE madness. +* [Dev Deps] update `es5-shim` +* [Docs] removing now-fixed `Number` caveat +* [Docs] use assertions so `evalmd` will test the readme better. +* [Docs] fix incorrect isFinite note (#373) + +# es6-shim 0.33.11 (9 Nov 2015) +* [Fix] handle future change of RegExp.prototype not being a regex (#370, #371) +* [Fix] disallow invalid hex strings in `Number` (#369) +* [Tests] Tweak "polluted prototype" approach +* [Dev Deps] update `chai`, `es5-shim`, `eslint`, `@ljharb/eslint-config`, `jscs` + +# es6-shim 0.33.10 (2 Nov 2015) +* [Fix] the `Number` constructor properly trims (or not) whitespace characters (#368) +* [Fix] `Number('0b12')` and `Number('0o18')` should both be `NaN` (#366) +* [Tests] Fix npm upgrades in older nodes +* [Tests] add `npm run tests-only` +* [Tests] on `node` `v5.0` +* [Tests] ensure `JSON.stringify` has the right name +* [Tests] add `npm run eslint` +* [Dev Deps] update `es5-shim`, `jscs` +* [Cleanup] Rearrange things so that they’re defined before they’re used +* [Cleanup] Don't reassign to function or catch parameters +* [Cleanup] Remove unused variables +* [Refactor] String#trim shim should use `defineProperty`, and check more non-whitespace chars + +# es6-shim 0.33.9 (29 Oct 2015) +* [Fix] IE 8: `Number(new Number(1))` was throwing. More NFE madness. (#365) + # 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. diff --git a/js/vendor/es6-shim/Gruntfile.js b/js/vendor/es6-shim/Gruntfile.js index 370443762..230934d6b 100644 --- a/js/vendor/es6-shim/Gruntfile.js +++ b/js/vendor/es6-shim/Gruntfile.js @@ -1,14 +1,16 @@ +'use strict'; + module.exports = function (grunt) { var browsers = [ - { browserName: "firefox", version: "19", platform: "XP" }, - { browserName: "firefox", platform: "linux" }, - { browserName: "firefox", platform: "OS X 10.10" }, - { browserName: "chrome", platform: "linux" }, - { browserName: "chrome", platform: "OS X 10.9" }, - { browserName: "chrome", platform: "XP" }, - { browserName: "internet explorer", platform: "Windows 8.1", version: "11" }, - { browserName: "internet explorer", platform: "WIN8", version: "10" }, - { browserName: "internet explorer", platform: "VISTA", version: "9" }, + { browserName: 'firefox', version: '19', platform: 'XP' }, + { browserName: 'firefox', platform: 'linux' }, + { browserName: 'firefox', platform: 'OS X 10.10' }, + { browserName: 'chrome', platform: 'linux' }, + { browserName: 'chrome', platform: 'OS X 10.9' }, + { browserName: 'chrome', platform: 'XP' }, + { browserName: 'internet explorer', platform: 'Windows 8.1', version: '11' }, + { browserName: 'internet explorer', platform: 'WIN8', version: '10' }, + { browserName: 'internet explorer', platform: 'VISTA', version: '9' }, { browserName: 'safari', platform: 'OS X 10.6' }, { browserName: 'safari', platform: 'OS X 10.8' }, { browserName: 'safari', platform: 'OS X 10.9' }, @@ -17,16 +19,16 @@ module.exports = function (grunt) { { browserName: 'android', platform: 'Linux', version: '4.4' }, ]; var extraBrowsers = [ - { browserName: "firefox", platform: "linux", version: "30" }, - { browserName: "firefox", platform: "linux", version: "25" }, + { browserName: 'firefox', platform: 'linux', version: '30' }, + { browserName: 'firefox', platform: 'linux', version: '25' }, { browserName: 'iphone', platform: 'OS X 10.8', version: '6.1' }, { browserName: 'iphone', platform: 'OS X 10.8', version: '5.1' }, { browserName: 'android', platform: 'Linux', version: '4.2' }, // XXX haven't investigated these: - //{ browserName: "opera", platform: "Windows 7", version: "12" }, - //{ browserName: "opera", platform: "Windows 2008", version: "12" } - //{ browserName: 'iphone', platform: 'OS X 10.6', version: '4.3' }, - //{ browserName: 'android', platform: 'Linux', version: '4.0' }, + // { browserName: 'opera', platform: 'Windows 7', version: '12' }, + // { browserName: 'opera', platform: 'Windows 2008', version: '12' } + // { browserName: 'iphone', platform: 'OS X 10.6', version: '4.3' }, + // { browserName: 'android', platform: 'Linux', version: '4.0' }, ]; if (grunt.option('extra')) { browsers = browsers.concat(extraBrowsers); @@ -35,7 +37,7 @@ module.exports = function (grunt) { connect: { server: { options: { - base: "", + base: '', port: 9999, useAvailablePort: true } @@ -45,56 +47,52 @@ module.exports = function (grunt) { all: { options: { urls: (function () { - var urls = ["http://localhost:9999/test/"]; + var urls = ['http://localhost:9999/test/']; if (grunt.option('extra')) { - urls.push("http://localhost:9999/test-sham/"); + urls.push('http://localhost:9999/test-sham/'); } return urls; }()), - //tunnelTimeout: 5, + // tunnelTimeout: 5, build: process.env.TRAVIS_BUILD_NUMBER, tunneled: !process.env.SAUCE_HAS_TUNNEL, identifier: process.env.TRAVIS_JOB_NUMBER, sauceConfig: { 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER }, - //concurrency: 3, + // concurrency: 3, browsers: browsers, testname: (function () { - var testname = "mocha"; - if (process.env.TRAVIS_PULL_REQUEST && - process.env.TRAVIS_PULL_REQUEST !== 'false') { - testname += ' (PR '+process.env.TRAVIS_PULL_REQUEST+')'; + var testname = 'mocha'; + if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') { + testname += ' (PR ' + process.env.TRAVIS_PULL_REQUEST + ')'; } - if (process.env.TRAVIS_BRANCH && - process.env.TRAVIS_BRANCH !== 'false') { - testname += ' (branch '+process.env.TRAVIS_BRANCH+')'; + if (process.env.TRAVIS_BRANCH && process.env.TRAVIS_BRANCH !== 'false') { + testname += ' (branch ' + process.env.TRAVIS_BRANCH + ')'; } return testname; - })(), + }()), tags: (function () { var tags = []; - if (process.env.TRAVIS_PULL_REQUEST && - process.env.TRAVIS_PULL_REQUEST !== 'false') { - tags.push('PR-'+process.env.TRAVIS_PULL_REQUEST); + if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') { + tags.push('PR-' + process.env.TRAVIS_PULL_REQUEST); } - if (process.env.TRAVIS_BRANCH && - process.env.TRAVIS_BRANCH !== 'false') { + if (process.env.TRAVIS_BRANCH && process.env.TRAVIS_BRANCH !== 'false') { tags.push(process.env.TRAVIS_BRANCH); } return tags; - })() + }()) } } }, watch: {} }); // Loading dependencies - for (var key in grunt.file.readJSON("package.json").devDependencies) { - if (key !== "grunt" && key.indexOf("grunt") === 0) { + for (var key in grunt.file.readJSON('package.json').devDependencies) { + if (key !== 'grunt' && key.indexOf('grunt') === 0) { grunt.loadNpmTasks(key); } } - grunt.registerTask("dev", ["connect", "watch"]); - grunt.registerTask("sauce", ["connect", "saucelabs-mocha"]); + grunt.registerTask('dev', ['connect', 'watch']); + grunt.registerTask('sauce', ['connect', 'saucelabs-mocha']); }; diff --git a/js/vendor/es6-shim/README.md b/js/vendor/es6-shim/README.md index 9e1b54169..5a0955674 100644 --- a/js/vendor/es6-shim/README.md +++ b/js/vendor/es6-shim/README.md @@ -156,27 +156,43 @@ The [es6-collections](https://github.com/WebReflection/es6-collections) implemen ## Getting started ```javascript -var assert = require('assert'); require('es6-shim'); +var assert = require('assert'); + +assert.equal(true, 'abc'.startsWith('a')); +assert.equal(false, 'abc'.endsWith('a')); +assert.equal(true, 'john alice'.includes('john')); +assert.equal('123'.repeat(2), '123123'); + +assert.equal(false, NaN === NaN); +assert.equal(true, Object.is(NaN, NaN)); +assert.equal(true, -0 === 0); +assert.equal(false, Object.is(-0, 0)); -'abc'.startsWith('a'); // true -'abc'.endsWith('a'); // false -'john alice'.includes('john'); // true -'123'.repeat(2); // '123123' +var result = Object.assign({ a: 1 }, { b: 2 }); +assert.deepEqual(result, { a: 1, b: 2 }); -Object.is(NaN, NaN); // Fixes ===. 0 isnt -0, NaN is NaN -Object.assign({a: 1}, {b: 2}); // {a: 1, b: 2} +assert.equal(true, isNaN('a')); +assert.equal(false, Number.isNaN('a')); +assert.equal(true, Number.isNaN(NaN)); + +assert.equal(true, isFinite('123')); +assert.equal(false, Number.isFinite('123')); +assert.equal(false, Number.isFinite(Infinity)); -Number.isNaN('123'); // false. Global isNaN('123') will give true. -Number.isFinite('asd'); // false. Global isFinite() will give true. // Tests if value is a number, finite, // >= -9007199254740992 && <= 9007199254740992 and floor(value) === value -Number.isInteger(2.4); // false. +assert.equal(false, Number.isInteger(2.4)); + +assert.equal(1, Math.sign(400)); +assert.equal(0, Math.sign(0)); +assert.equal(-1, Math.sign(-400)); -Math.sign(400); // 1, 0 or -1 depending on sign. In this case 1. +var found = [5, 10, 15, 10].find(function (item) { return item / 2 === 5; }); +assert.equal(10, found); -[5, 10, 15, 10].find(function (item) { return item / 2 === 5; }); // 10 -[5, 10, 15, 10].findIndex(function (item) { return item / 2 === 5; }); // 1 +var foundIndex = [5, 10, 15, 10].findIndex(function (item) { return item / 2 === 5; }); +assert.equal(1, foundIndex); // Replacement for `{}` key-value storage. // Keys can be anything. @@ -184,30 +200,35 @@ var map = new Map([['Bob', 42], ['Foo', 'bar']]); map.set('John', 25); map.set('Alice', 400); map.set(['meh'], 555); -assert(map.get(['meh']) === undefined); // undefined because you need to use exactly the same object. +assert.equal(undefined, map.get(['meh'])); // undefined because you need to use exactly the same object. map.delete('Alice'); map.keys(); map.values(); -assert(map.size === 4); +assert.equal(4, map.size); // Useful for storing unique items. var set = new Set([0, 1]); set.add(2); set.add(5); -assert(set.has(0) === true); -assert(set.has(1) === true); -assert(set.has(2) === true); -assert(set.has(4) === false); +assert.equal(true, set.has(0)); +assert.equal(true, set.has(1)); +assert.equal(true, set.has(2)); +assert.equal(false, set.has(4)); +assert.equal(true, set.has(5)); set.delete(5); +assert.equal(false, set.has(5)); // Promises, see // http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript // https://github.com/petkaantonov/bluebird/#what-are-promises-and-why-should-i-use-them Promise.resolve(5).then(function (value) { - if (value) throw new Error("whoops!"); + assert.equal(value, 5); + if (value) throw new Error('whoops!'); // do some stuff return anotherPromise(); }).catch(function (e) { + assert.equal(e.message, 'whoops!'); + assert.equal(true, e instanceof Error); // any errors thrown asynchronously end up here }); ``` @@ -216,12 +237,6 @@ Promise.resolve(5).then(function (value) { - `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 fd52e0b97..c0f5fbcd0 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.8", + "version": "0.33.12", "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 851b83046..65f0f5cc6 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.8 - * see https://github.com/paulmillr/es6-shim/blob/0.33.8/LICENSE + * es6-sham: v0.33.12 + * see https://github.com/paulmillr/es6-shim/blob/0.33.12/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ @@ -28,7 +28,9 @@ 'use strict'; /*jshint evil: true */ + /* eslint-disable no-new-func */ var getGlobal = new Function('return this;'); + /* eslint-enable no-new-func */ /*jshint evil: false */ var globals = getGlobal(); @@ -85,20 +87,24 @@ }; } catch (e) { // do one or more feature detections - set = {__proto__: null}; + set = { __proto__: null }; // if proto does not work, needs to fallback // some Opera, Rhino, ducktape if (set instanceof Object) { setPrototypeOf = createAndCopy; } else { // verify if null objects are buggy + /* eslint-disable no-proto */ set.__proto__ = objProto; + /* eslint-enable no-proto */ // if null objects are buggy // nodejs 0.8 to 0.10 if (set instanceof Object) { setPrototypeOf = function (origin, proto) { // use such bug to promote + /* eslint-disable no-proto */ origin.__proto__ = proto; + /* eslint-enable no-proto */ return origin; }; } else { @@ -108,7 +114,9 @@ // if proto is not null if (getPrototypeOf(origin)) { // use __proto__ to promote + /* eslint-disable no-proto */ origin.__proto__ = proto; + /* eslint-enable no-proto */ return origin; } else { // otherwise unable to promote: fallback diff --git a/js/vendor/es6-shim/es6-sham.map b/js/vendor/es6-shim/es6-sham.map index aed17fdff..8f3589e2e 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,GAAIV,EAAeS,GAAS,CAE1BA,EAAOK,UAAYJ,CACnB,OAAOD,OACF,CAEL,MAAOD,GAAcC,EAAQC,OAMvChB,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,YAIA,IAAIC,GAAY,GAAIC,UAAS,eAI7B,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,GAAQG,UAAW,KAGnB,IAAIH,YAAejB,GAAQ,CACzBC,EAAiBa,MACZ,CAGLG,EAAIG,UAAYb,CAIhB,IAAIU,YAAejB,GAAQ,CACzBC,EAAiB,SAAUc,EAAQC,GAGjCD,EAAOK,UAAYJ,CAEnB,OAAOD,QAEJ,CAGLd,EAAiB,SAAUc,EAAQC,GAEjC,GAAIV,EAAeS,GAAS,CAG1BA,EAAOK,UAAYJ,CAEnB,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 f8372331f..a0f862efe 100644 --- a/js/vendor/es6-shim/es6-sham.min.js +++ b/js/vendor/es6-shim/es6-sham.min.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.8 - * see https://github.com/paulmillr/es6-shim/blob/0.33.8/LICENSE + * es6-sham: v0.33.12 + * see https://github.com/paulmillr/es6-shim/blob/0.33.12/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 feb438909..d1d052fe3 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.8 - * see https://github.com/paulmillr/es6-shim/blob/0.33.8/LICENSE + * es6-shim: v0.33.12 + * see https://github.com/paulmillr/es6-shim/blob/0.33.12/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ @@ -61,26 +61,8 @@ var _forEach = Function.call.bind(Array.prototype.forEach); var _reduce = Function.call.bind(Array.prototype.reduce); var _filter = Function.call.bind(Array.prototype.filter); - var _every = Function.call.bind(Array.prototype.every); + var _some = Function.call.bind(Array.prototype.some); - var createDataProperty = function createDataProperty(object, name, value) { - if (supportsDescriptors) { - Object.defineProperty(object, name, { - configurable: true, - enumerable: true, - writable: true, - value: value - }); - } else { - object[name] = value; - } - }; - var createDataPropertyOrThrow = function createDataPropertyOrThrow(object, name, value) { - createDataProperty(object, name, value); - if (!ES.SameValue(object[name], value)) { - throw new TypeError('property is nonconfigurable'); - } - }; var defineProperty = function (object, name, value, force) { if (!force && name in object) { return; } if (supportsDescriptors) { @@ -135,6 +117,7 @@ }; var getGlobal = function () { + /* global self, window, global */ // the only reliable means to get the global object is // `Function('return this')()` // However, this causes CSP violations in Chrome apps. @@ -146,7 +129,6 @@ var globals = getGlobal(); var globalIsFinite = globals.isFinite; - var hasStrictMode = (function () { return this === null; }.call(null)); var _indexOf = Function.call.bind(String.prototype.indexOf); var _toString = Function.call.bind(Object.prototype.toString); var _concat = Function.call.bind(Array.prototype.concat); @@ -167,89 +149,6 @@ var Symbol = globals.Symbol || {}; var symbolSpecies = Symbol.species || '@@species'; - var Value = { - getter: function (object, name, getter) { - if (!supportsDescriptors) { - throw new TypeError('getters require true ES5 support'); - } - Object.defineProperty(object, name, { - configurable: true, - enumerable: false, - get: getter - }); - }, - proxy: function (originalObject, key, targetObject) { - if (!supportsDescriptors) { - throw new TypeError('getters require true ES5 support'); - } - var originalDescriptor = Object.getOwnPropertyDescriptor(originalObject, key); - Object.defineProperty(targetObject, key, { - configurable: originalDescriptor.configurable, - enumerable: originalDescriptor.enumerable, - get: function getKey() { return originalObject[key]; }, - set: function setKey(value) { originalObject[key] = value; } - }); - }, - redefine: function (object, property, newValue) { - if (supportsDescriptors) { - var descriptor = Object.getOwnPropertyDescriptor(object, property); - descriptor.value = newValue; - Object.defineProperty(object, property, descriptor); - } else { - object[property] = newValue; - } - }, - defineByDescriptor: function (object, property, descriptor) { - if (supportsDescriptors) { - Object.defineProperty(object, property, descriptor); - } else if ('value' in descriptor) { - object[property] = descriptor.value; - } - }, - preserveToString: function (target, source) { - if (source && ES.IsCallable(source.toString)) { - defineProperty(target, 'toString', source.toString.bind(source), true); - } - } - }; - - var wrapConstructor = function wrapConstructor(original, replacement, keysToSkip) { - Value.preserveToString(replacement, original); - if (Object.setPrototypeOf) { - // sets up proper prototype chain where possible - Object.setPrototypeOf(original, 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); - }; - - var defaultSpeciesGetter = function () { return this; }; - var addDefaultSpecies = function (C) { - if (supportsDescriptors && !_hasOwnProperty(C, symbolSpecies)) { - Value.getter(C, symbolSpecies, defaultSpeciesGetter); - } - }; - var Type = { - primitive: function (x) { return x === null || (typeof x !== 'function' && typeof x !== 'object'); }, - 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) { - return typeof globals.Symbol === 'function' && typeof x === 'symbol'; - } - }; - var numberIsNaN = Number.isNaN || function isNaN(value) { // NaN !== NaN, but they are identical. // NaNs are the only non-reflexive value, i.e., if x !== x, @@ -262,10 +161,29 @@ return typeof value === 'number' && globalIsFinite(value); }; - var overrideNative = function overrideNative(object, property, replacement) { - var original = object[property]; - defineProperty(object, property, replacement, true); - Value.preserveToString(object[property], original); + // 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 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 Type = { + primitive: function (x) { return x === null || (typeof x !== 'function' && typeof x !== 'object'); }, + 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) { + return typeof globals.Symbol === 'function' && typeof x === 'symbol'; + } }; // This is a private name in the es6 spec, equal to '[Symbol.iterator]' @@ -280,29 +198,12 @@ if (globals.Set && typeof new globals.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } - var addIterator = function (prototype, impl) { - var implementation = impl || function iterator() { return this; }; - defineProperty(prototype, $iterator$, implementation); - if (!prototype[$iterator$] && Type.symbol($iterator$)) { - // implementations are buggy when $iterator$ is a Symbol - prototype[$iterator$] = implementation; - } - }; - // 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 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; + // Reflect + if (!globals.Reflect) { + defineProperty(globals, 'Reflect', {}); + } + var Reflect = globals.Reflect; var ES = { // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args @@ -459,19 +360,18 @@ }, Construct: function (C, args, newTarget, isES6internal) { - if (newTarget === void 0) { - newTarget = C; - } + var target = typeof newTarget === 'undefined' ? C : newTarget; + if (!isES6internal) { // Try to use Reflect.construct if available - return Reflect.construct(C, args, newTarget); + return Reflect.construct(C, args, target); } // OK, we have to fake it. This will only work if the // C.[[ConstructorKind]] == "base" -- but that's the only // kind we can make in ES5 code anyway. - // OrdinaryCreateFromConstructor(newTarget, "%ObjectPrototype%") - var proto = newTarget.prototype; + // OrdinaryCreateFromConstructor(target, "%ObjectPrototype%") + var proto = target.prototype; if (!ES.TypeIsObject(proto)) { proto = Object.prototype; } @@ -513,6 +413,114 @@ } }; + var Value = { + getter: function (object, name, getter) { + if (!supportsDescriptors) { + throw new TypeError('getters require true ES5 support'); + } + Object.defineProperty(o |