diff options
-rw-r--r-- | js/vendor/es6-shim/.bower.json | 8 | ||||
-rw-r--r-- | js/vendor/es6-shim/CHANGELOG.md | 7 | ||||
-rw-r--r-- | js/vendor/es6-shim/bower.json | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/component.json | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-shim.js | 85 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-shim.map | 2 | ||||
-rw-r--r-- | js/vendor/es6-shim/es6-shim.min.js | 4 | ||||
-rw-r--r-- | js/vendor/es6-shim/package.json | 6 |
8 files changed, 91 insertions, 25 deletions
diff --git a/js/vendor/es6-shim/.bower.json b/js/vendor/es6-shim/.bower.json index 354c79ee2..fa6307c70 100644 --- a/js/vendor/es6-shim/.bower.json +++ b/js/vendor/es6-shim/.bower.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.30.0", + "version": "0.31.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.30.0", + "_release": "0.31.0", "_resolution": { "type": "version", - "tag": "0.30.0", - "commit": "ba581d8a4b9c1bdbadc71188d18a011f6be638a0" + "tag": "0.31.0", + "commit": "dbbbe60d5cef7cb64f179c1c6fc483d3a1e26c5f" }, "_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 976cdef7b..8f2b84314 100644 --- a/js/vendor/es6-shim/CHANGELOG.md +++ b/js/vendor/es6-shim/CHANGELOG.md @@ -1,5 +1,12 @@ # es6-shim x.x.x (not yet released) +# es6-shim 0.31.0 (1 May 2015) +* All Array.prototype methods should use `ToLength`, not `ToUint32`, on `this.length`. +* Preserve and use original Array.prototype functions (for later shimming) +* Make String#{startsWith, endsWith, includes} tests a bit more granular. +* Fix Map/Set invalid receiver error messages for WebKit +* Update `grunt-saucelabs`, `jscs` + # es6-shim 0.30.0 (26 Apr 2015) * `Map` and `Set` methods are not generic, and must only be called on valid `Map` and `Set` objects. * Use the native `Number#clz` (in Safari 8, eg) inside `Math.clz32` diff --git a/js/vendor/es6-shim/bower.json b/js/vendor/es6-shim/bower.json index 386992c6b..440cc8ee4 100644 --- a/js/vendor/es6-shim/bower.json +++ b/js/vendor/es6-shim/bower.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.30.0", + "version": "0.31.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 7e18ff677..257db652f 100644 --- a/js/vendor/es6-shim/component.json +++ b/js/vendor/es6-shim/component.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.30.0", + "version": "0.31.0", "repo": "paulmillr/es6-shim", "description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines", "keywords": [ diff --git a/js/vendor/es6-shim/es6-shim.js b/js/vendor/es6-shim/es6-shim.js index 1ab73a3ea..1e80a9ff4 100644 --- a/js/vendor/es6-shim/es6-shim.js +++ b/js/vendor/es6-shim/es6-shim.js @@ -53,6 +53,11 @@ }; var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported(); + var _forEach = Function.call.bind(Array.prototype.forEach); + var _map = Function.call.bind(Array.prototype.map); + var _reduce = Function.call.bind(Array.prototype.reduce); + var _filter = Function.call.bind(Array.prototype.filter); + var defineProperty = function (object, name, value, force) { if (!force && name in object) { return; } if (supportsDescriptors) { @@ -70,7 +75,7 @@ // Define configurable, writable and non-enumerable props // if they don’t exist. var defineProperties = function (object, map) { - Object.keys(map).forEach(function (name) { + _forEach(Object.keys(map), function (name) { var method = map[name]; defineProperty(object, name, method, false); }); @@ -888,6 +893,60 @@ overrideNative(Array, 'from', ArrayShims.from); } + var toLengthsCorrectly = function (method, reversed) { + var obj = { length: -1 }; + obj[reversed ? ((-1 >>> 0) - 1) : 0] = true; + return valueOrFalseIfThrows(function () { + method.call(obj, function () { + // note: in nonconforming browsers, this will be called + // -1 >>> 0 times, which is 4294967295, so the throw matters. + throw new RangeError('should not reach here'); + }, []); + }); + }; + if (!toLengthsCorrectly(Array.prototype.forEach)) { + var originalForEach = Array.prototype.forEach; + overrideNative(Array.prototype, 'forEach', function forEach(callbackFn) { + if (this.length >= 0) { return originalForEach.apply(this, arguments); } + }, true); + } + if (!toLengthsCorrectly(Array.prototype.map)) { + var originalMap = Array.prototype.map; + overrideNative(Array.prototype, 'map', function map(callbackFn) { + if (this.length >= 0) { return originalMap.apply(this, arguments); } + }, true); + } + if (!toLengthsCorrectly(Array.prototype.filter)) { + var originalFilter = Array.prototype.filter; + overrideNative(Array.prototype, 'filter', function filter(callbackFn) { + if (this.length >= 0) { return originalFilter.apply(this, arguments); } + }, true); + } + if (!toLengthsCorrectly(Array.prototype.some)) { + var originalSome = Array.prototype.some; + overrideNative(Array.prototype, 'some', function some(callbackFn) { + if (this.length >= 0) { return originalSome.apply(this, arguments); } + }, true); + } + if (!toLengthsCorrectly(Array.prototype.every)) { + var originalEvery = Array.prototype.every; + overrideNative(Array.prototype, 'every', function every(callbackFn) { + if (this.length >= 0) { return originalEvery.apply(this, arguments); } + }, true); + } + if (!toLengthsCorrectly(Array.prototype.reduce)) { + var originalReduce = Array.prototype.reduce; + overrideNative(Array.prototype, 'reduce', function reduce(callbackFn) { + if (this.length >= 0) { return originalReduce.apply(this, arguments); } + }, true); + } + if (!toLengthsCorrectly(Array.prototype.reduceRight, true)) { + var originalReduceRight = Array.prototype.reduceRight; + overrideNative(Array.prototype, 'reduceRight', function reduceRight(callbackFn) { + if (this.length >= 0) { return originalReduceRight.apply(this, arguments); } + }, true); + } + var maxSafeInteger = Math.pow(2, 53) - 1; defineProperties(Number, { MAX_SAFE_INTEGER: maxSafeInteger, @@ -948,9 +1007,9 @@ var keys = Object.keys(Object(source)); var symbols; if (ES.IsCallable(Object.getOwnPropertySymbols)) { - symbols = Object.getOwnPropertySymbols(Object(source)).filter(isEnumerableOn(source)); + symbols = _filter(Object.getOwnPropertySymbols(Object(source)), isEnumerableOn(source)); } - return keys.concat(symbols || []).reduce(assignTo(source), target); + return _reduce(keys.concat(symbols || []), assignTo(source), target); }; var ObjectShims = { @@ -959,7 +1018,7 @@ if (!ES.TypeIsObject(target)) { throw new TypeError('target must be an object'); } - return Array.prototype.reduce.call(sliceArgs.apply(0, arguments), assignReducer); + return _reduce(sliceArgs.apply(0, arguments), assignReducer); }, // Added in WebKit in https://bugs.webkit.org/show_bug.cgi?id=143865 @@ -1201,7 +1260,7 @@ // sets up proper prototype chain where possible Object.setPrototypeOf(OrigRegExp, RegExpShim); } - Object.getOwnPropertyNames(OrigRegExp).forEach(function (key) { + _forEach(Object.getOwnPropertyNames(OrigRegExp), function (key) { if (key === '$input') { return; } // Chrome < v39 & Opera < 26 have a nonstandard "$input" property if (key in noop) { return; } Value.proxy(OrigRegExp, key, RegExpShim); @@ -1222,7 +1281,7 @@ leftContext: '$`', rightContext: '$\'' }; - Object.keys(regexGlobals).forEach(function (prop) { + _forEach(Object.keys(regexGlobals), function (prop) { if (prop in RegExp && !(regexGlobals[prop] in RegExp)) { Value.getter(RegExp, regexGlobals[prop], function get() { return RegExp[prop]; @@ -1353,8 +1412,8 @@ if (allZero) { return 0; } var largest = Math.max.apply(Math, numbers); - var divided = numbers.map(function (number) { return number / largest; }); - var sum = divided.map(square).reduce(add); + var divided = _map(numbers, function (number) { return number / largest; }); + var sum = _reduce(_map(divided, square), add); return largest * Math.sqrt(sum); }, @@ -1595,7 +1654,7 @@ }; var triggerPromiseReactions = function (reactions, x) { - reactions.forEach(function (reaction) { + _forEach(reactions, function (reaction) { enqueue(function () { // PromiseReactionTask var handler = reaction.handler; @@ -1865,7 +1924,7 @@ // Their fast path also requires that the environment preserve // property insertion order, which is not guaranteed by the spec. var testOrder = function (a) { - var b = Object.keys(a.reduce(function (o, k) { + var b = Object.keys(_reduce(a, function (o, k) { o[k] = true; return o; }, {})); @@ -2216,7 +2275,7 @@ var ensureMap = function ensureMap(set) { if (!set['[[SetData]]']) { var m = set['[[SetData]]'] = new collectionShims.Map(); - Object.keys(set._storage).forEach(function (k) { + _forEach(Object.keys(set._storage), function (k) { // fast check for leading '$' if (k.charCodeAt(0) === 36) { k = k.slice(1); @@ -2329,7 +2388,7 @@ iterable = arguments[0]; } if (Array.isArray(iterable) || Type.string(iterable)) { - Array.prototype.forEach.call(iterable, function (entry) { + _forEach(iterable, function (entry) { m.set(entry[0], entry[1]); }); } else if (iterable instanceof Map) { @@ -2785,7 +2844,7 @@ sup: function sub() { return ES.CreateHTML(this, 'sup', '', ''); } }; defineProperties(String.prototype, stringHTMLshims); - Object.keys(stringHTMLshims).forEach(function (key) { + _forEach(Object.keys(stringHTMLshims), function (key) { var method = String.prototype[key]; var shouldOverwrite = false; if (ES.IsCallable(method)) { diff --git a/js/vendor/es6-shim/es6-shim.map b/js/vendor/es6-shim/es6-shim.map index 433952cec..a812157a1 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","not","notThunker","func","notThunk","apply","arguments","throwsError","e","valueOrFalseIfThrows","isCallableWithoutNew","arePropertyDescriptorsSupported","Object","defineProperty","supportsDescriptors","object","name","value","force","configurable","enumerable","writable","defineProperties","map","keys","forEach","method","create","prototype","properties","Prototype","supportsSubclassing","C","f","setPrototypeOf","Sub","Subclass","arg","o","constructor","startsWithRejectsRegex","String","startsWith","startsWithHandlesInfinity","Infinity","getGlobal","Function","globals","globalIsFinite","isFinite","hasStrictMode","call","startsWithIsCompliant","_indexOf","bind","indexOf","_toString","toString","_hasOwnProperty","hasOwnProperty","ArrayIterator","noop","Symbol","symbolSpecies","species","Type","x","string","regex","symbol","numberIsNaN","Number","isNaN","numberIsFinite","Value","getter","TypeError","get","proxy","originalObject","key","targetObject","originalDescriptor","getOwnPropertyDescriptor","getKey","set","setKey","redefine","property","newValue","descriptor","preserveToString","target","source","overrideNative","replacement","original","$iterator$","iterator","Set","addIterator","impl","implementation","isArguments","str","result","length","callee","safeApply","ES","Call","F","V","args","IsCallable","RequireObjectCoercible","optMessage","TypeIsObject","ToObject","ToInt32","ToNumber","ToUint32","ToInteger","number","Math","floor","abs","ToLength","len","MAX_SAFE_INTEGER","SameValue","a","b","SameValueZero","IsIterable","GetIterator","itFn","it","IteratorNext","next","Construct","obj","_es6construct","CreateHTML","tag","attribute","S","p1","escapedV","replace","p2","p3","emulateES6construct","fromCodePoint","originalFromCodePoint","codePoints","StringShims","i","RangeError","push","fromCharCode","join","raw","callSite","cooked","rawString","literalsegments","stringElements","nextIndex","nextKey","nextSeg","nextSub",1,"stringRepeat","repeat","s","times","half","stringMaxLength","StringPrototypeShims","thisStr","numTimes","searchString","searchStr","startArg","start","max","slice","endsWith","thisLen","posArg","pos","end","min","includes","position","codePointAt","first","charCodeAt","isEnd","second","hasStringTrimBug","trim","ws","trimRegexp","RegExp","StringIterator","_s","_i","done","substr","ArrayShims","from","iterable","mapFn","list","hasThisArg","thisArg","usingIterator","iterationValue","Array","of","iteratorResult","array","kind","retval","ObjectIterator","getAllKeys","shift","arrayOfSupportsSubclassing","Foo","fooArr","ArrayPrototypeShims","copyWithin","relativeTarget","relativeStart","to","fin","count","direction","fill","O","relativeEnd","find","predicate","findIndex","values","entries","unscopables","originalArrayPrototypeValues","getPrototypeOf","arrayFromSwallowsNegativeLengths","arrayFromHandlesIterables","arr","maxSafeInteger","pow","MIN_SAFE_INTEGER","EPSILON","parseInt","parseFloat","isInteger","isSafeInteger","item","idx","isEnumerableOn","propertyIsEnumerable","sliceArgs","initial","desiredArgCount","assignTo","assignToSource","assignReducer","symbols","getOwnPropertySymbols","filter","concat","reduce","ObjectShims","assign","is","assignHasPendingExceptions","preventExtensions","thrower","ES5ObjectShims","magic","checkArgs","proto","polyfill","FAKENULL","gpo","spo","p","objectKeysAcceptsPrimitives","originalObjectKeys","getOwnPropertyNames","objectGOPNAcceptsPrimitives","originalObjectGetOwnPropertyNames","objectGOPDAcceptsPrimitives","originalObjectGetOwnPropertyDescriptor","seal","objectSealAcceptsPrimitives","originalObjectSeal","isSealed","objectIsSealedAcceptsPrimitives","originalObjectIsSealed","freeze","objectFreezeAcceptsPrimitives","originalObjectFreeze","isFrozen","objectIsFrozenAcceptsPrimitives","originalObjectIsFrozen","objectPreventExtensionsAcceptsPrimitives","originalObjectPreventExtensions","isExtensible","objectIsExtensibleAcceptsPrimitives","originalObjectIsExtensible","objectGetProtoAcceptsPrimitives","originalGetProto","flags","regExpFlagsGetter","global","ignoreCase","multiline","unicode","sticky","regExpSupportsFlagsWithRegex","OrigRegExp","RegExpShim","pattern","regexGlobals","input","lastMatch","lastParen","leftContext","rightContext","prop","square","n","add","inverseEpsilon","roundTiesToEven","BINARY_32_EPSILON","BINARY_32_MAX_VALUE","BINARY_32_MIN_VALUE","numberCLZ","clz","MathShims","acosh","NaN","log","E","sqrt","asinh","atanh","cbrt","negate","exp","clz32","LOG2E","cosh","expm1","t","sum","hypot","y","anyNaN","allZero","anyInfinity","numbers","every","num","largest","divided","log2","log10","LOG10E","log1p","sign","sinh","tanh","trunc","imul","ah","al","bh","bl","fround","v","MAX_VALUE","expm1OfTen","origMathRound","round","roundHandlesBoundaryConditions","smallestPositiveNumberWhereRoundBreaks","largestPositiveNumberWhereRoundBreaks","roundDoesNotIncreaseIntegers","ceil","origImul","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","Identity","Thrower","catch","resolutionHandler","resolveReaction","rejectReaction","accept","defer","chain","promiseSupportsSubclassing","promiseIgnoresNonFunctionThenCallbacks","promiseRequiresObjectContext","testOrder","k","preservesInsertionOrder","preservesNumericInsertionOrder","fastkey","type","emptyObject","collectionShims","Map","empty","MapEntry","prev","isRemoved","isMap","_es6map","requireMapSlot","MapIterator","head","_head","_storage","_size","adder","nextItem","Map$prototype","fkey","entry","has","delete","clear","callback","context","isSet","_es6set","requireSetSlot","SetShim","[[SetData]]","Set$prototype","ensureMap","m","charAt","size","hasFKey","entireSet","mapAcceptsArguments","OrigMapNoArgs","isArray","mapUsesSameValueZero","mapSupportsChaining","origMapSet","origMapGet","origMapHas","setUsesSameValueZero","setSupportsChaining","origSetAdd","origSetHas","origSetDel","SetDelete","mapSupportsSubclassing","M","mapFailsToSupportSubclassing","mapRequiresNew","OrigMap","setSupportsSubclassing","setFailsToSupportSubclassing","setRequiresNew","OrigSet","mapIterationThrowsStopIterator","Reflect","throwUnlessTargetIsObject","construct","deleteProperty","desc","enumerate","ownKeys","callAndCatchException","ConvertExceptionToBoolean","internalGet","receiver","parent","undefined","internalSet","existingDesc","propertyKey","attributes","objectDotGetPrototypeOf","willCreateCircularPrototype","Date","dateToString","shimmedDateToString","valueOf","stringHTMLshims","anchor","big","blink","bold","fixed","fontcolor","color","fontsize","italics","link","url","small","strike","sub","sup","shouldOverwrite","output","quotesCount","match","toLowerCase"],"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,GAAM,QAASC,IAAWC,GAC5B,MAAO,SAAS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