polyfill-library 3.110.0 → 3.110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,10 +4,10 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- #### [v3.110.0](https://github.com/Financial-Times/polyfill-library/compare/v3.110.0...v3.110.0)
7
+ #### [v3.110.1](https://github.com/Financial-Times/polyfill-library/compare/v3.110.1...v3.110.1)
8
8
 
9
- #### v3.110.0
9
+ #### v3.110.1
10
10
 
11
- > 7 December 2021
11
+ > 8 December 2021
12
12
 
13
- - add changelog for v3.110.0 [`40f87d4`](https://github.com/Financial-Times/polyfill-library/commit/40f87d475f0e4c9cddb0febd2f4555bcc1ff32ae)
13
+ - add changelog for 3.110.1 [`559f122`](https://github.com/Financial-Times/polyfill-library/commit/559f122145bcfc1322590018089c284d6312becb)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polyfill-library",
3
- "version": "3.110.0",
3
+ "version": "3.110.1",
4
4
  "description": "A polyfill combinator",
5
5
  "main": "lib/index.js",
6
6
  "contributors": [
@@ -1 +1 @@
1
- {"aliases":["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","DataView"],"license":"MIT","repo":"https://github.com/inexorabletash/polyfill","docs":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray","browsers":{"android":"<37","bb":"*","chrome":"<32","edge":"<14","edge_mob":"<14","firefox":"<44","firefox_mob":"<44","ie":"*","ie_mob":"*","ios_chr":"<7","ios_saf":"<7","op_mini":"*","op_mob":"<19","opera":"<19","safari":"<7","samsung_mob":"<2"},"install":{"module":"js-polyfills","paths":["typedarray.js"]},"detectSource":"","baseDir":"ArrayBuffer","hasTests":false,"isTestable":true,"isPublic":true,"size":16129}
1
+ {"aliases":["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","DataView"],"license":"MIT","repo":"https://github.com/inexorabletash/polyfill","docs":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray","notes":["In Internet Explorer 8 there is no support for square-bracket notation, instead you will need to use the methods _getter and _setter."],"browsers":{"android":"<37","bb":"*","chrome":"<32","edge":"<14","edge_mob":"<14","firefox":"<44","firefox_mob":"<44","ie":"*","ie_mob":"*","ios_chr":"<7","ios_saf":"<7","op_mini":"*","op_mob":"<19","opera":"<19","safari":"<7","samsung_mob":"<2"},"install":{"module":"js-polyfills","paths":["typedarray.js"],"postinstall":"update.task.js"},"detectSource":"","baseDir":"ArrayBuffer","hasTests":false,"isTestable":true,"isPublic":true,"size":16144}
@@ -1 +1 @@
1
- !function(t){"use strict";function e(t){switch(typeof t){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return null===t?"null":"object"}}function r(t){return Object.prototype.toString.call(t).replace(/^\[object *|\]$/g,"")}function n(t){return"function"==typeof t}function o(t){if(null===t||t===B)throw TypeError();return Object(t)}function i(t){return t>>0}function f(t){return t>>>0}function u(e){if(!("TYPED_ARRAY_POLYFILL_NO_ARRAY_ACCESSORS"in t)){if(e.length>N)throw RangeError("Array too large for polyfill");var r;for(r=0;r<e.length;r+=1)!function n(t){Object.defineProperty(e,t,{get:function(){return e._getter(t)},set:function(r){e._setter(t,r)},enumerable:!0,configurable:!1})}(r)}}function a(t,e){var r=32-e;return t<<r>>r}function h(t,e){var r=32-e;return t<<r>>>r}function y(t){return[255&t]}function s(t){return a(t[0],8)}function l(t){return[255&t]}function p(t){return h(t[0],8)}function c(t){return t=x(Number(t)),[t<0?0:t>255?255:255&t]}function b(t){return[255&t,t>>8&255]}function g(t){return a(t[1]<<8|t[0],16)}function E(t){return[255&t,t>>8&255]}function v(t){return h(t[1]<<8|t[0],16)}function _(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function O(t){return a(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function d(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function j(t){return h(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function P(t,e,r){function n(t){var e=m(t),r=t-e;return r<.5?e:r>.5?e+1:e%2?e+1:e}var o,i,f,u=(1<<e-1)-1;if(t!==t)i=(1<<e)-1,f=F(2,r-1),o=0;else if(t===Infinity||t===-Infinity)i=(1<<e)-1,f=0,o=t<0?1:0;else if(0===t)i=0,f=0,o=1/t==-Infinity?1:0;else if(o=t<0,(t=M(t))>=F(2,1-u)){i=Y(m(I(t)/S),1023);var a=t/F(2,i);a<1&&(i-=1,a*=2),a>=2&&(i+=1,a/=2);var h=F(2,r);f=n(a*h)-h,i+=u,f/h>=1&&(i+=1,f=0),i>2*u&&(i=(1<<e)-1,f=0)}else i=0,f=n(t/F(2,1-u-r));var y,s=[];for(y=r;y;y-=1)s.push(f%2?1:0),f=m(f/2);for(y=e;y;y-=1)s.push(i%2?1:0),i=m(i/2);s.push(o?1:0),s.reverse();for(var l=s.join(""),p=[];l.length;)p.unshift(parseInt(l.substring(0,8),2)),l=l.substring(8);return p}function T(t,e,r){var n,o,i,f,u,a,h,y,s=[];for(n=0;n<t.length;++n)for(i=t[n],o=8;o;o-=1)s.push(i%2?1:0),i>>=1;return s.reverse(),f=s.join(""),u=(1<<e-1)-1,a=parseInt(f.substring(0,1),2)?-1:1,h=parseInt(f.substring(1,1+e),2),y=parseInt(f.substring(1+e),2),h===(1<<e)-1?0!==y?NaN:a*Infinity:h>0?a*F(2,h-u)*(1+y/F(2,r)):0!==y?a*F(2,-(u-1))*(y/F(2,r)):a<0?-0:0}function w(t){return T(t,11,52)}function A(t){return P(t,11,52)}function L(t){return T(t,8,23)}function R(t){return P(t,8,23)}var B=void 0,N=1e5,S=Math.LN2,M=Math.abs,m=Math.floor,I=Math.log,U=Math.max,Y=Math.min,F=Math.pow,x=Math.round;!function(){var t=Object.defineProperty,e=!function(){try{return Object.defineProperty({},"x",{})}catch(t){return!1}}();t&&!e||(Object.defineProperty=function(e,r,n){if(t)try{return t(e,r,n)}catch(o){}if(e!==Object(e))throw TypeError("Object.defineProperty called on non-object");return Object.prototype.__defineGetter__&&"get"in n&&Object.prototype.__defineGetter__.call(e,r,n.get),Object.prototype.__defineSetter__&&"set"in n&&Object.prototype.__defineSetter__.call(e,r,n.set),"value"in n&&(e[r]=n.value),e})}(),function(){function a(t){if((t=i(t))<0)throw RangeError("ArrayBuffer size is not a small enough positive integer.");Object.defineProperty(this,"byteLength",{value:t}),Object.defineProperty(this,"_bytes",{value:Array(t)});for(var e=0;e<t;e+=1)this._bytes[e]=0}function h(){if(!arguments.length||"object"!=typeof arguments[0])return function(t){if((t=i(t))<0)throw RangeError("length is not a small enough positive integer.");Object.defineProperty(this,"length",{value:t}),Object.defineProperty(this,"byteLength",{value:t*this.BYTES_PER_ELEMENT}),Object.defineProperty(this,"buffer",{value:new a(this.byteLength)}),Object.defineProperty(this,"byteOffset",{value:0})}.apply(this,arguments);if(arguments.length>=1&&"object"===e(arguments[0])&&arguments[0]instanceof h)return function(t){if(this.constructor!==t.constructor)throw TypeError();var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r<this.length;r+=1)this._setter(r,t._getter(r))}.apply(this,arguments);if(arguments.length>=1&&"object"===e(arguments[0])&&!(arguments[0]instanceof h)&&!(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t){var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r<this.length;r+=1){var n=t[r];this._setter(r,Number(n))}}.apply(this,arguments);if(arguments.length>=1&&"object"===e(arguments[0])&&(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t,e,r){if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(e%this.BYTES_PER_ELEMENT)throw RangeError("buffer length minus the byteOffset is not a multiple of the element size.");if(r===B){var n=t.byteLength-e;if(n%this.BYTES_PER_ELEMENT)throw RangeError("length of buffer minus byteOffset not a multiple of the element size");r=n/this.BYTES_PER_ELEMENT}else r=f(r),n=r*this.BYTES_PER_ELEMENT;if(e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e}),Object.defineProperty(this,"length",{value:r})}.apply(this,arguments);throw TypeError()}function P(t,e,r){var n=function(){Object.defineProperty(this,"constructor",{value:n}),h.apply(this,arguments),u(this)};"__proto__"in n?n.__proto__=h:(n.from=h.from,n.of=h.of),n.BYTES_PER_ELEMENT=t;var o=function(){};return o.prototype=T,n.prototype=new o,Object.defineProperty(n.prototype,"BYTES_PER_ELEMENT",{value:t}),Object.defineProperty(n.prototype,"_pack",{value:e}),Object.defineProperty(n.prototype,"_unpack",{value:r}),n}t.ArrayBuffer=t.ArrayBuffer||a,Object.defineProperty(h,"from",{value:function(t){return new this(t)}}),Object.defineProperty(h,"of",{value:function(){return new this(arguments)}});var T={};h.prototype=T,Object.defineProperty(h.prototype,"_getter",{value:function(t){if(arguments.length<1)throw SyntaxError("Not enough arguments");if((t=f(t))>=this.length)return B;var e,r,n=[];for(e=0,r=this.byteOffset+t*this.BYTES_PER_ELEMENT;e<this.BYTES_PER_ELEMENT;e+=1,r+=1)n.push(this.buffer._bytes[r]);return this._unpack(n)}}),Object.defineProperty(h.prototype,"get",{value:h.prototype._getter}),Object.defineProperty(h.prototype,"_setter",{value:function(t,e){if(arguments.length<2)throw SyntaxError("Not enough arguments");if(!((t=f(t))>=this.length)){var r,n,o=this._pack(e);for(r=0,n=this.byteOffset+t*this.BYTES_PER_ELEMENT;r<this.BYTES_PER_ELEMENT;r+=1,n+=1)this.buffer._bytes[n]=o[r]}}}),Object.defineProperty(h.prototype,"constructor",{value:h}),Object.defineProperty(h.prototype,"copyWithin",{value:function(t,e){var r=arguments[2],n=o(this),u=n.length,a=f(u);a=U(a,0);var h,y=i(t);h=y<0?U(a+y,0):Y(y,a);var s,l=i(e);s=l<0?U(a+l,0):Y(l,a);var p;p=r===B?a:i(r);var c;c=p<0?U(a+p,0):Y(p,a);var b,g=Y(c-s,a-h);for(s<h&&h<s+g?(b=-1,s=s+g-1,h=h+g-1):b=1;g>0;)n._setter(h,n._getter(s)),s+=b,h+=b,g-=1;return n}}),Object.defineProperty(h.prototype,"every",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i<r;i++)if(!t.call(o,e._getter(i),i,e))return!1;return!0}}),Object.defineProperty(h.prototype,"fill",{value:function(t){var e=arguments[1],r=arguments[2],n=o(this),u=n.length,a=f(u);a=U(a,0);var h,y=i(e);h=y<0?U(a+y,0):Y(y,a);var s;s=r===B?a:i(r);var l;for(l=s<0?U(a+s,0):Y(s,a);h<l;)n._setter(h,t),h+=1;return n}}),Object.defineProperty(h.prototype,"filter",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=[],i=arguments[1],u=0;u<r;u++){var a=e._getter(u);t.call(i,a,u,e)&&o.push(a)}return new this.constructor(o)}}),Object.defineProperty(h.prototype,"find",{value:function(t){var e=o(this),r=e.length,i=f(r);if(!n(t))throw TypeError();for(var u=arguments.length>1?arguments[1]:B,a=0;a<i;){var h=e._getter(a),y=t.call(u,h,a,e);if(Boolean(y))return h;++a}return B}}),Object.defineProperty(h.prototype,"findIndex",{value:function(t){var e=o(this),r=e.length,i=f(r);if(!n(t))throw TypeError();for(var u=arguments.length>1?arguments[1]:B,a=0;a<i;){var h=e._getter(a),y=t.call(u,h,a,e);if(Boolean(y))return a;++a}return-1}}),Object.defineProperty(h.prototype,"forEach",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i<r;i++)t.call(o,e._getter(i),i,e)}}),Object.defineProperty(h.prototype,"indexOf",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(0===r)return-1;var n=0;if(arguments.length>0&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n)))),n>=r)return-1;for(var o=n>=0?n:U(r-M(n),0);o<r;o++)if(e._getter(o)===t)return o;return-1}}),Object.defineProperty(h.prototype,"join",{value:function(t){if(this===B||null===this)throw TypeError();for(var e=Object(this),r=f(e.length),n=Array(r),o=0;o<r;++o)n[o]=e._getter(o);return n.join(t===B?",":t)}}),Object.defineProperty(h.prototype,"lastIndexOf",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(0===r)return-1;var n=r;arguments.length>1&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n))));for(var o=n>=0?Y(n,r-1):r-M(n);o>=0;o--)if(e._getter(o)===t)return o;return-1}}),Object.defineProperty(h.prototype,"map",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();var o=[];o.length=r;for(var i=arguments[1],u=0;u<r;u++)o[u]=t.call(i,e._getter(u),u,e);return new this.constructor(o)}}),Object.defineProperty(h.prototype,"reduce",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();if(0===r&&1===arguments.length)throw TypeError();var o,i=0;for(o=arguments.length>=2?arguments[1]:e._getter(i++);i<r;)o=t.call(B,o,e._getter(i),i,e),i++;return o}}),Object.defineProperty(h.prototype,"reduceRight",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();if(0===r&&1===arguments.length)throw TypeError();var o,i=r-1;for(o=arguments.length>=2?arguments[1]:e._getter(i--);i>=0;)o=t.call(B,o,e._getter(i),i,e),i--;return o}}),Object.defineProperty(h.prototype,"reverse",{value:function(){if(this===B||null===this)throw TypeError();for(var t=Object(this),e=f(t.length),r=m(e/2),n=0,o=e-1;n<r;++n,--o){var i=t._getter(n);t._setter(n,t._getter(o)),t._setter(o,i)}return t}}),Object.defineProperty(h.prototype,"set",{value:function(t,e){if(arguments.length<1)throw SyntaxError("Not enough arguments");var r,n,o,i,u,a,h,y,s,l;if("object"==typeof arguments[0]&&arguments[0].constructor===this.constructor){if(r=arguments[0],(o=f(arguments[1]))+r.length>this.length)throw RangeError("Offset plus length of array is out of range");if(y=this.byteOffset+o*this.BYTES_PER_ELEMENT,s=r.length*this.BYTES_PER_ELEMENT,r.buffer===this.buffer){for(l=[],u=0,a=r.byteOffset;u<s;u+=1,a+=1)l[u]=r.buffer._bytes[a];for(u=0,h=y;u<s;u+=1,h+=1)this.buffer._bytes[h]=l[u]}else for(u=0,a=r.byteOffset,h=y;u<s;u+=1,a+=1,h+=1)this.buffer._bytes[h]=r.buffer._bytes[a]}else{if("object"!=typeof arguments[0]||"undefined"==typeof arguments[0].length)throw TypeError("Unexpected argument type(s)");if(n=arguments[0],i=f(n.length),(o=f(arguments[1]))+i>this.length)throw RangeError("Offset plus length of array is out of range");for(u=0;u<i;u+=1)a=n[u],this._setter(o+u,Number(a))}}}),Object.defineProperty(h.prototype,"slice",{value:function(t,e){for(var r=o(this),n=r.length,u=f(n),a=i(t),h=a<0?U(u+a,0):Y(a,u),y=e===B?u:i(e),s=y<0?U(u+y,0):Y(y,u),l=s-h,p=r.constructor,c=new p(l),b=0;h<s;){var g=r._getter(h);c._setter(b,g),++h,++b}return c}}),Object.defineProperty(h.prototype,"some",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i<r;i++)if(t.call(o,e._getter(i),i,e))return!0;return!1}}),Object.defineProperty(h.prototype,"sort",{value:function(t){function e(e,r){return e!==e&&r!==r?0:e!==e?1:r!==r?-1:t!==B?t(e,r):e<r?-1:e>r?1:0}if(this===B||null===this)throw TypeError();for(var r=Object(this),n=f(r.length),o=Array(n),i=0;i<n;++i)o[i]=r._getter(i);for(o.sort(e),i=0;i<n;++i)r._setter(i,o[i]);return r}}),Object.defineProperty(h.prototype,"subarray",{value:function(t,e){function r(t,e,r){return t<e?e:t>r?r:t}t=i(t),e=i(e),arguments.length<1&&(t=0),arguments.length<2&&(e=this.length),t<0&&(t=this.length+t),e<0&&(e=this.length+e),t=r(t,0,this.length),e=r(e,0,this.length);var n=e-t;return n<0&&(n=0),new this.constructor(this.buffer,this.byteOffset+t*this.BYTES_PER_ELEMENT,n)}});var N=P(1,y,s),S=P(1,l,p),I=P(1,c,p),F=P(2,b,g),x=P(2,E,v),k=P(4,_,O),C=P(4,d,j),z=P(4,R,L),D=P(8,A,w);t.Int8Array=t.Int8Array||N,t.Uint8Array=t.Uint8Array||S,t.Uint8ClampedArray=t.Uint8ClampedArray||I,t.Int16Array=t.Int16Array||F,t.Uint16Array=t.Uint16Array||x,t.Int32Array=t.Int32Array||k,t.Uint32Array=t.Uint32Array||C,t.Float32Array=t.Float32Array||z,t.Float64Array=t.Float64Array||D}(),function(){function e(t,e){return n(t.get)?t.get(e):t[e]}function o(t,e,n){if(!(t instanceof ArrayBuffer||"ArrayBuffer"===r(t)))throw TypeError();if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(n=n===B?t.byteLength-e:f(n),e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e})}function i(t){return function r(n,o){if((n=f(n))+t.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");n+=this.byteOffset;for(var i=new Uint8Array(this.buffer,n,t.BYTES_PER_ELEMENT),u=[],h=0;h<t.BYTES_PER_ELEMENT;h+=1)u.push(e(i,h));return Boolean(o)===Boolean(a)&&u.reverse(),e(new t(new Uint8Array(u).buffer),0)}}function u(t){return function r(n,o,i){if((n=f(n))+t.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");var u,h,y=new t([o]),s=new Uint8Array(y.buffer),l=[];for(u=0;u<t.BYTES_PER_ELEMENT;u+=1)l.push(e(s,u));Boolean(i)===Boolean(a)&&l.reverse(),h=new Uint8Array(this.buffer,n,t.BYTES_PER_ELEMENT),h.set(l)}}var a=function(){var t=new Uint16Array([4660]);return 18===e(new Uint8Array(t.buffer),0)}();Object.defineProperty(o.prototype,"getUint8",{value:i(Uint8Array)}),Object.defineProperty(o.prototype,"getInt8",{value:i(Int8Array)}),Object.defineProperty(o.prototype,"getUint16",{value:i(Uint16Array)}),Object.defineProperty(o.prototype,"getInt16",{value:i(Int16Array)}),Object.defineProperty(o.prototype,"getUint32",{value:i(Uint32Array)}),Object.defineProperty(o.prototype,"getInt32",{value:i(Int32Array)}),Object.defineProperty(o.prototype,"getFloat32",{value:i(Float32Array)}),Object.defineProperty(o.prototype,"getFloat64",{value:i(Float64Array)}),Object.defineProperty(o.prototype,"setUint8",{value:u(Uint8Array)}),Object.defineProperty(o.prototype,"setInt8",{value:u(Int8Array)}),Object.defineProperty(o.prototype,"setUint16",{value:u(Uint16Array)}),Object.defineProperty(o.prototype,"setInt16",{value:u(Int16Array)}),Object.defineProperty(o.prototype,"setUint32",{value:u(Uint32Array)}),Object.defineProperty(o.prototype,"setInt32",{value:u(Int32Array)}),Object.defineProperty(o.prototype,"setFloat32",{value:u(Float32Array)}),Object.defineProperty(o.prototype,"setFloat64",{value:u(Float64Array)}),t.DataView=t.DataView||o}()}(self);
1
+ !function(t){"use strict";function e(t){switch(typeof t){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return null===t?"null":"object"}}function r(t){return Object.prototype.toString.call(t).replace(/^\[object *|\]$/g,"")}function n(t){return"function"==typeof t}function o(t){if(null===t||t===B)throw TypeError();return Object(t)}function i(t){return t>>0}function f(t){return t>>>0}function u(e){if(!("TYPED_ARRAY_POLYFILL_NO_ARRAY_ACCESSORS"in t)){if(e.length>N)throw RangeError("Array too large for polyfill");var r;for(r=0;r<e.length;r+=1)!function n(t){try{Object.defineProperty(e,t,{get:function(){return e._getter(t)},set:function(r){e._setter(t,r)},enumerable:!0,configurable:!1})}catch(r){}}(r)}}function a(t,e){var r=32-e;return t<<r>>r}function h(t,e){var r=32-e;return t<<r>>>r}function y(t){return[255&t]}function s(t){return a(t[0],8)}function l(t){return[255&t]}function p(t){return h(t[0],8)}function c(t){return t=x(Number(t)),[t<0?0:t>255?255:255&t]}function b(t){return[255&t,t>>8&255]}function g(t){return a(t[1]<<8|t[0],16)}function E(t){return[255&t,t>>8&255]}function v(t){return h(t[1]<<8|t[0],16)}function _(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function O(t){return a(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function d(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function j(t){return h(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function P(t,e,r){function n(t){var e=m(t),r=t-e;return r<.5?e:r>.5?e+1:e%2?e+1:e}var o,i,f,u=(1<<e-1)-1;if(t!==t)i=(1<<e)-1,f=F(2,r-1),o=0;else if(t===Infinity||t===-Infinity)i=(1<<e)-1,f=0,o=t<0?1:0;else if(0===t)i=0,f=0,o=1/t==-Infinity?1:0;else if(o=t<0,(t=M(t))>=F(2,1-u)){i=Y(m(I(t)/S),1023);var a=t/F(2,i);a<1&&(i-=1,a*=2),a>=2&&(i+=1,a/=2);var h=F(2,r);f=n(a*h)-h,i+=u,f/h>=1&&(i+=1,f=0),i>2*u&&(i=(1<<e)-1,f=0)}else i=0,f=n(t/F(2,1-u-r));var y,s=[];for(y=r;y;y-=1)s.push(f%2?1:0),f=m(f/2);for(y=e;y;y-=1)s.push(i%2?1:0),i=m(i/2);s.push(o?1:0),s.reverse();for(var l=s.join(""),p=[];l.length;)p.unshift(parseInt(l.substring(0,8),2)),l=l.substring(8);return p}function T(t,e,r){var n,o,i,f,u,a,h,y,s=[];for(n=0;n<t.length;++n)for(i=t[n],o=8;o;o-=1)s.push(i%2?1:0),i>>=1;return s.reverse(),f=s.join(""),u=(1<<e-1)-1,a=parseInt(f.substring(0,1),2)?-1:1,h=parseInt(f.substring(1,1+e),2),y=parseInt(f.substring(1+e),2),h===(1<<e)-1?0!==y?NaN:a*Infinity:h>0?a*F(2,h-u)*(1+y/F(2,r)):0!==y?a*F(2,-(u-1))*(y/F(2,r)):a<0?-0:0}function w(t){return T(t,11,52)}function A(t){return P(t,11,52)}function L(t){return T(t,8,23)}function R(t){return P(t,8,23)}var B=void 0,N=1e5,S=Math.LN2,M=Math.abs,m=Math.floor,I=Math.log,U=Math.max,Y=Math.min,F=Math.pow,x=Math.round;!function(){var t=Object.defineProperty,e=!function(){try{return Object.defineProperty({},"x",{})}catch(t){return!1}}();t&&!e||(Object.defineProperty=function(e,r,n){if(t)try{return t(e,r,n)}catch(o){}if(e!==Object(e))throw TypeError("Object.defineProperty called on non-object");return Object.prototype.__defineGetter__&&"get"in n&&Object.prototype.__defineGetter__.call(e,r,n.get),Object.prototype.__defineSetter__&&"set"in n&&Object.prototype.__defineSetter__.call(e,r,n.set),"value"in n&&(e[r]=n.value),e})}(),function(){function a(t){if((t=i(t))<0)throw RangeError("ArrayBuffer size is not a small enough positive integer.");Object.defineProperty(this,"byteLength",{value:t}),Object.defineProperty(this,"_bytes",{value:Array(t)});for(var e=0;e<t;e+=1)this._bytes[e]=0}function h(){if(!arguments.length||"object"!=typeof arguments[0])return function(t){if((t=i(t))<0)throw RangeError("length is not a small enough positive integer.");Object.defineProperty(this,"length",{value:t}),Object.defineProperty(this,"byteLength",{value:t*this.BYTES_PER_ELEMENT}),Object.defineProperty(this,"buffer",{value:new a(this.byteLength)}),Object.defineProperty(this,"byteOffset",{value:0})}.apply(this,arguments);if(arguments.length>=1&&"object"===e(arguments[0])&&arguments[0]instanceof h)return function(t){if(this.constructor!==t.constructor)throw TypeError();var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r<this.length;r+=1)this._setter(r,t._getter(r))}.apply(this,arguments);if(arguments.length>=1&&"object"===e(arguments[0])&&!(arguments[0]instanceof h)&&!(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t){var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r<this.length;r+=1){var n=t[r];this._setter(r,Number(n))}}.apply(this,arguments);if(arguments.length>=1&&"object"===e(arguments[0])&&(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t,e,r){if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(e%this.BYTES_PER_ELEMENT)throw RangeError("buffer length minus the byteOffset is not a multiple of the element size.");if(r===B){var n=t.byteLength-e;if(n%this.BYTES_PER_ELEMENT)throw RangeError("length of buffer minus byteOffset not a multiple of the element size");r=n/this.BYTES_PER_ELEMENT}else r=f(r),n=r*this.BYTES_PER_ELEMENT;if(e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e}),Object.defineProperty(this,"length",{value:r})}.apply(this,arguments);throw TypeError()}function P(t,e,r){var n=function(){Object.defineProperty(this,"constructor",{value:n}),h.apply(this,arguments),u(this)};"__proto__"in n?n.__proto__=h:(n.from=h.from,n.of=h.of),n.BYTES_PER_ELEMENT=t;var o=function(){};return o.prototype=T,n.prototype=new o,Object.defineProperty(n.prototype,"BYTES_PER_ELEMENT",{value:t}),Object.defineProperty(n.prototype,"_pack",{value:e}),Object.defineProperty(n.prototype,"_unpack",{value:r}),n}t.ArrayBuffer=t.ArrayBuffer||a,Object.defineProperty(h,"from",{value:function(t){return new this(t)}}),Object.defineProperty(h,"of",{value:function(){return new this(arguments)}});var T={};h.prototype=T,Object.defineProperty(h.prototype,"_getter",{value:function(t){if(arguments.length<1)throw SyntaxError("Not enough arguments");if((t=f(t))>=this.length)return B;var e,r,n=[];for(e=0,r=this.byteOffset+t*this.BYTES_PER_ELEMENT;e<this.BYTES_PER_ELEMENT;e+=1,r+=1)n.push(this.buffer._bytes[r]);return this._unpack(n)}}),Object.defineProperty(h.prototype,"get",{value:h.prototype._getter}),Object.defineProperty(h.prototype,"_setter",{value:function(t,e){if(arguments.length<2)throw SyntaxError("Not enough arguments");if(!((t=f(t))>=this.length)){var r,n,o=this._pack(e);for(r=0,n=this.byteOffset+t*this.BYTES_PER_ELEMENT;r<this.BYTES_PER_ELEMENT;r+=1,n+=1)this.buffer._bytes[n]=o[r]}}}),Object.defineProperty(h.prototype,"constructor",{value:h}),Object.defineProperty(h.prototype,"copyWithin",{value:function(t,e){var r=arguments[2],n=o(this),u=n.length,a=f(u);a=U(a,0);var h,y=i(t);h=y<0?U(a+y,0):Y(y,a);var s,l=i(e);s=l<0?U(a+l,0):Y(l,a);var p;p=r===B?a:i(r);var c;c=p<0?U(a+p,0):Y(p,a);var b,g=Y(c-s,a-h);for(s<h&&h<s+g?(b=-1,s=s+g-1,h=h+g-1):b=1;g>0;)n._setter(h,n._getter(s)),s+=b,h+=b,g-=1;return n}}),Object.defineProperty(h.prototype,"every",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i<r;i++)if(!t.call(o,e._getter(i),i,e))return!1;return!0}}),Object.defineProperty(h.prototype,"fill",{value:function(t){var e=arguments[1],r=arguments[2],n=o(this),u=n.length,a=f(u);a=U(a,0);var h,y=i(e);h=y<0?U(a+y,0):Y(y,a);var s;s=r===B?a:i(r);var l;for(l=s<0?U(a+s,0):Y(s,a);h<l;)n._setter(h,t),h+=1;return n}}),Object.defineProperty(h.prototype,"filter",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=[],i=arguments[1],u=0;u<r;u++){var a=e._getter(u);t.call(i,a,u,e)&&o.push(a)}return new this.constructor(o)}}),Object.defineProperty(h.prototype,"find",{value:function(t){var e=o(this),r=e.length,i=f(r);if(!n(t))throw TypeError();for(var u=arguments.length>1?arguments[1]:B,a=0;a<i;){var h=e._getter(a),y=t.call(u,h,a,e);if(Boolean(y))return h;++a}return B}}),Object.defineProperty(h.prototype,"findIndex",{value:function(t){var e=o(this),r=e.length,i=f(r);if(!n(t))throw TypeError();for(var u=arguments.length>1?arguments[1]:B,a=0;a<i;){var h=e._getter(a),y=t.call(u,h,a,e);if(Boolean(y))return a;++a}return-1}}),Object.defineProperty(h.prototype,"forEach",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i<r;i++)t.call(o,e._getter(i),i,e)}}),Object.defineProperty(h.prototype,"indexOf",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(0===r)return-1;var n=0;if(arguments.length>0&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n)))),n>=r)return-1;for(var o=n>=0?n:U(r-M(n),0);o<r;o++)if(e._getter(o)===t)return o;return-1}}),Object.defineProperty(h.prototype,"join",{value:function(t){if(this===B||null===this)throw TypeError();for(var e=Object(this),r=f(e.length),n=Array(r),o=0;o<r;++o)n[o]=e._getter(o);return n.join(t===B?",":t)}}),Object.defineProperty(h.prototype,"lastIndexOf",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(0===r)return-1;var n=r;arguments.length>1&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n))));for(var o=n>=0?Y(n,r-1):r-M(n);o>=0;o--)if(e._getter(o)===t)return o;return-1}}),Object.defineProperty(h.prototype,"map",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();var o=[];o.length=r;for(var i=arguments[1],u=0;u<r;u++)o[u]=t.call(i,e._getter(u),u,e);return new this.constructor(o)}}),Object.defineProperty(h.prototype,"reduce",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();if(0===r&&1===arguments.length)throw TypeError();var o,i=0;for(o=arguments.length>=2?arguments[1]:e._getter(i++);i<r;)o=t.call(B,o,e._getter(i),i,e),i++;return o}}),Object.defineProperty(h.prototype,"reduceRight",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();if(0===r&&1===arguments.length)throw TypeError();var o,i=r-1;for(o=arguments.length>=2?arguments[1]:e._getter(i--);i>=0;)o=t.call(B,o,e._getter(i),i,e),i--;return o}}),Object.defineProperty(h.prototype,"reverse",{value:function(){if(this===B||null===this)throw TypeError();for(var t=Object(this),e=f(t.length),r=m(e/2),n=0,o=e-1;n<r;++n,--o){var i=t._getter(n);t._setter(n,t._getter(o)),t._setter(o,i)}return t}}),Object.defineProperty(h.prototype,"set",{value:function(t,e){if(arguments.length<1)throw SyntaxError("Not enough arguments");var r,n,o,i,u,a,h,y,s,l;if("object"==typeof arguments[0]&&arguments[0].constructor===this.constructor){if(r=arguments[0],(o=f(arguments[1]))+r.length>this.length)throw RangeError("Offset plus length of array is out of range");if(y=this.byteOffset+o*this.BYTES_PER_ELEMENT,s=r.length*this.BYTES_PER_ELEMENT,r.buffer===this.buffer){for(l=[],u=0,a=r.byteOffset;u<s;u+=1,a+=1)l[u]=r.buffer._bytes[a];for(u=0,h=y;u<s;u+=1,h+=1)this.buffer._bytes[h]=l[u]}else for(u=0,a=r.byteOffset,h=y;u<s;u+=1,a+=1,h+=1)this.buffer._bytes[h]=r.buffer._bytes[a]}else{if("object"!=typeof arguments[0]||"undefined"==typeof arguments[0].length)throw TypeError("Unexpected argument type(s)");if(n=arguments[0],i=f(n.length),(o=f(arguments[1]))+i>this.length)throw RangeError("Offset plus length of array is out of range");for(u=0;u<i;u+=1)a=n[u],this._setter(o+u,Number(a))}}}),Object.defineProperty(h.prototype,"slice",{value:function(t,e){for(var r=o(this),n=r.length,u=f(n),a=i(t),h=a<0?U(u+a,0):Y(a,u),y=e===B?u:i(e),s=y<0?U(u+y,0):Y(y,u),l=s-h,p=r.constructor,c=new p(l),b=0;h<s;){var g=r._getter(h);c._setter(b,g),++h,++b}return c}}),Object.defineProperty(h.prototype,"some",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i<r;i++)if(t.call(o,e._getter(i),i,e))return!0;return!1}}),Object.defineProperty(h.prototype,"sort",{value:function(t){function e(e,r){return e!==e&&r!==r?0:e!==e?1:r!==r?-1:t!==B?t(e,r):e<r?-1:e>r?1:0}if(this===B||null===this)throw TypeError();for(var r=Object(this),n=f(r.length),o=Array(n),i=0;i<n;++i)o[i]=r._getter(i);for(o.sort(e),i=0;i<n;++i)r._setter(i,o[i]);return r}}),Object.defineProperty(h.prototype,"subarray",{value:function(t,e){function r(t,e,r){return t<e?e:t>r?r:t}t=i(t),e=i(e),arguments.length<1&&(t=0),arguments.length<2&&(e=this.length),t<0&&(t=this.length+t),e<0&&(e=this.length+e),t=r(t,0,this.length),e=r(e,0,this.length);var n=e-t;return n<0&&(n=0),new this.constructor(this.buffer,this.byteOffset+t*this.BYTES_PER_ELEMENT,n)}});var N=P(1,y,s),S=P(1,l,p),I=P(1,c,p),F=P(2,b,g),x=P(2,E,v),k=P(4,_,O),C=P(4,d,j),z=P(4,R,L),D=P(8,A,w);t.Int8Array=t.Int8Array||N,t.Uint8Array=t.Uint8Array||S,t.Uint8ClampedArray=t.Uint8ClampedArray||I,t.Int16Array=t.Int16Array||F,t.Uint16Array=t.Uint16Array||x,t.Int32Array=t.Int32Array||k,t.Uint32Array=t.Uint32Array||C,t.Float32Array=t.Float32Array||z,t.Float64Array=t.Float64Array||D}(),function(){function e(t,e){return n(t.get)?t.get(e):t[e]}function o(t,e,n){if(!(t instanceof ArrayBuffer||"ArrayBuffer"===r(t)))throw TypeError();if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(n=n===B?t.byteLength-e:f(n),e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e})}function i(t){return function r(n,o){if((n=f(n))+t.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");n+=this.byteOffset;for(var i=new Uint8Array(this.buffer,n,t.BYTES_PER_ELEMENT),u=[],h=0;h<t.BYTES_PER_ELEMENT;h+=1)u.push(e(i,h));return Boolean(o)===Boolean(a)&&u.reverse(),e(new t(new Uint8Array(u).buffer),0)}}function u(t){return function r(n,o,i){if((n=f(n))+t.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");var u,h,y=new t([o]),s=new Uint8Array(y.buffer),l=[];for(u=0;u<t.BYTES_PER_ELEMENT;u+=1)l.push(e(s,u));Boolean(i)===Boolean(a)&&l.reverse(),h=new Uint8Array(this.buffer,n,t.BYTES_PER_ELEMENT),h.set(l)}}var a=function(){var t=new Uint16Array([4660]);return 18===e(new Uint8Array(t.buffer),0)}();Object.defineProperty(o.prototype,"getUint8",{value:i(Uint8Array)}),Object.defineProperty(o.prototype,"getInt8",{value:i(Int8Array)}),Object.defineProperty(o.prototype,"getUint16",{value:i(Uint16Array)}),Object.defineProperty(o.prototype,"getInt16",{value:i(Int16Array)}),Object.defineProperty(o.prototype,"getUint32",{value:i(Uint32Array)}),Object.defineProperty(o.prototype,"getInt32",{value:i(Int32Array)}),Object.defineProperty(o.prototype,"getFloat32",{value:i(Float32Array)}),Object.defineProperty(o.prototype,"getFloat64",{value:i(Float64Array)}),Object.defineProperty(o.prototype,"setUint8",{value:u(Uint8Array)}),Object.defineProperty(o.prototype,"setInt8",{value:u(Int8Array)}),Object.defineProperty(o.prototype,"setUint16",{value:u(Uint16Array)}),Object.defineProperty(o.prototype,"setInt16",{value:u(Int16Array)}),Object.defineProperty(o.prototype,"setUint32",{value:u(Uint32Array)}),Object.defineProperty(o.prototype,"setInt32",{value:u(Int32Array)}),Object.defineProperty(o.prototype,"setFloat32",{value:u(Float32Array)}),Object.defineProperty(o.prototype,"setFloat64",{value:u(Float64Array)}),t.DataView=t.DataView||o}()}(self);
@@ -119,12 +119,14 @@
119
119
  if (obj.length > MAX_ARRAY_LENGTH) throw RangeError('Array too large for polyfill');
120
120
 
121
121
  function makeArrayAccessor(index) {
122
- Object.defineProperty(obj, index, {
123
- 'get': function() { return obj._getter(index); },
124
- 'set': function(v) { obj._setter(index, v); },
125
- enumerable: true,
126
- configurable: false
127
- });
122
+ try {
123
+ Object.defineProperty(obj, index, {
124
+ 'get': function() { return obj._getter(index); },
125
+ 'set': function(v) { obj._setter(index, v); },
126
+ enumerable: true,
127
+ configurable: false
128
+ });
129
+ } catch (_){ }
128
130
  }
129
131
 
130
132
  var i;
@@ -0,0 +1 @@
1
+ {"aliases":["dom4","default-3.4","default-3.5","default-3.6","default"],"dependencies":["Element"],"docs":"https://developer.mozilla.org/en-US/docs/Web/API/Node/isSameNode","browsers":{"chrome":"<1","firefox":"<48","safari":"<3","edge":"<12","edge_mob":"<12","ie":"<9","ie_mob":"<9","firefox_mob":"<48","opera":"<12.1","opera_mini":"<12.1","ios_saf":"<1","ios_chr":"<1","samsung_mob":"<1","bb":"*","android":"<1"},"detectSource":"document.isSameNode\n","baseDir":"Node/prototype/isSameNode","hasTests":true,"isTestable":true,"isPublic":true,"size":321}
@@ -0,0 +1 @@
1
+ !function(){function e(e){if(!(0 in arguments))throw new TypeError("1 argument is required");return this===e}if("HTMLElement"in self&&"isSameNode"in HTMLElement.prototype)try{delete HTMLElement.prototype.isSameNode}catch(t){}"Node"in self?Node.prototype.isSameNode=e:document.isSameNode=Element.prototype.isSameNode=e}();
@@ -0,0 +1,27 @@
1
+
2
+ // Node.prototype.isSameNode
3
+ (function() {
4
+
5
+ function isSameNode(otherNode) {
6
+ if (!(0 in arguments)) {
7
+ throw new TypeError('1 argument is required');
8
+ }
9
+
10
+ return this === otherNode;
11
+ }
12
+
13
+ // IE
14
+ if ('HTMLElement' in self && 'isSameNode' in HTMLElement.prototype) {
15
+ try {
16
+ delete HTMLElement.prototype.isSameNode;
17
+ // eslint-disable-next-line no-empty
18
+ } catch (e) {}
19
+ }
20
+
21
+ if ('Node' in self) {
22
+ Node.prototype.isSameNode = isSameNode;
23
+ } else {
24
+ document.isSameNode = Element.prototype.isSameNode = isSameNode;
25
+ }
26
+
27
+ }());
@@ -1 +1 @@
1
- {"aliases":["TextDecoder"],"dependencies":[],"license":"CC0-1.0","spec":"https://encoding.spec.whatwg.org/#interface-textencoder","docs":"https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder","repo":"https://github.com/anonyco/FastestSmallestTextEncoderDecoder","browsers":{"chrome":"<38","firefox":"<19","firefox_mob":"<19","edge":"<79","edge_mob":"<79","ie":"*","ie_mob":"*","safari":"<10.1","ios_saf":"<10.3","opera":"<25","android":"38","samsung_mob":"<3.0"},"detectSource":"\"TextEncoder\"in self&&\"TextDecoder\"in self\n","baseDir":"TextEncoder","hasTests":true,"isTestable":true,"isPublic":true,"size":3349}
1
+ {"aliases":["TextDecoder"],"dependencies":["ArrayBuffer"],"license":"CC0-1.0","spec":"https://encoding.spec.whatwg.org/#interface-textencoder","docs":"https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder","repo":"https://github.com/anonyco/FastestSmallestTextEncoderDecoder","browsers":{"chrome":"<38","firefox":"<19","firefox_mob":"<19","edge":"<79","edge_mob":"<79","ie":"*","ie_mob":"*","safari":"<10.1","ios_saf":"<10.3","opera":"<25","android":"38","samsung_mob":"<3.0"},"detectSource":"\"TextEncoder\"in self&&\"TextDecoder\"in self\n","baseDir":"TextEncoder","hasTests":true,"isTestable":true,"isPublic":true,"size":3582}
@@ -1 +1 @@
1
- var ENCODEINTO_BUILD=!1;!function(e){"use strict";function r(){}function t(e){var r=0|e.charCodeAt(0);if(55296<=r)if(r<=56319){var t=0|e.charCodeAt(1);if(56320<=t&&t<=57343){if((r=(r<<10)+t-56613888|0)>65535)return i(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else r=65533}else r<=57343&&(r=65533);return r<=2047?i(192|r>>6,128|63&r):i(224|r>>12,128|r>>6&63,128|63&r)}function n(){}function a(e,r){var n=void 0===e?"":(""+e).replace(y,t),a=0|n.length,o=0,c=0,i=0,f=0|r.length,s=0|e.length;f<a&&(a=f);e:for(;o<a;o=o+1|0){switch((c=0|n.charCodeAt(o))>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i=i+1|0;case 8:case 9:case 10:case 11:break;case 12:case 13:if((o+1|0)<f){i=i+1|0;break}case 14:if((o+2|0)<f){i=i+1|0;break}case 15:if((o+3|0)<f){i=i+1|0;break}default:break e}r[o]=c}return{written:o,read:s<i?s:i}}var o,c,i=String.fromCharCode,f={}.toString,s=f.call(e.SharedArrayBuffer),l=e.Uint8Array,u=l||Array,d=l?ArrayBuffer:u,h=d.isView||function(e){return e&&"length"in e},g=f.call(d.prototype),p=(encodeURIComponent,parseInt,n.prototype),v=e.TextEncoder,y=/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,D=new(l?Uint16Array:u)(32);r.prototype.decode=function(e){var r,t=e;if(!h(t)){if((r=f.call(t))!==g&&r!==s&&"[object Undefined]"!==r)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");t=l?new u(t):t||[]}for(var n="",a="",o=0,c=0|t.length,d=c-32|0,p=0,v=0,y=0,C=0,w=0,A=0,b=-1;o<c;){for(p=o<=d?32:c-o|0;A<p;o=o+1|0,A=A+1|0){switch((v=255&t[o])>>4){case 15:if((w=255&t[o=o+1|0])>>6!=2||247<v){o=o-1|0;break}y=(7&v)<<6|63&w,C=5,v=256;case 14:w=255&t[o=o+1|0],y<<=6,y|=(15&v)<<6|63&w,C=w>>6==2?C+4|0:24,v=v+256&768;case 13:case 12:w=255&t[o=o+1|0],y<<=6,y|=(31&v)<<6|63&w,C=C+7|0,o<c&&w>>6==2&&y>>C&&y<1114112?(v=y,y=y-65536|0,0<=y?(b=55296+(y>>10)|0,v=56320+(1023&y)|0,A<31?(D[A]=b,A=A+1|0,b=-1):(w=b,b=v,v=w)):p=p+1|0):(v>>=8,o=o-v-1|0,v=65533),C=0,y=0,p=o<=d?32:c-o|0;default:D[A]=v;continue;case 11:case 10:case 9:case 8:}D[A]=65533}if(a+=i(D[0],D[1],D[2],D[3],D[4],D[5],D[6],D[7],D[8],D[9],D[10],D[11],D[12],D[13],D[14],D[15],D[16],D[17],D[18],D[19],D[20],D[21],D[22],D[23],D[24],D[25],D[26],D[27],D[28],D[29],D[30],D[31]),A<32&&(a=a.slice(0,A-32|0)),o<c){if(D[0]=b,A=~b>>>31,b=-1,a.length<n.length)continue}else-1!==b&&(a+=i(b));n+=a,a=""}return n},p.encode=function(e){var r,t=void 0===e?"":""+e,n=0|t.length,a=new u(8+(n<<1)|0),o=0,c=0,i=0,f=0,s=!l;for(o=0;o<n;o=o+1|0,c=c+1|0)if((i=0|t.charCodeAt(o))<=127)a[c]=i;else if(i<=2047)a[c]=192|i>>6,a[c=c+1|0]=128|63&i;else{e:{if(55296<=i)if(i<=56319){if(56320<=(f=0|t.charCodeAt(o=o+1|0))&&f<=57343){if((i=(i<<10)+f-56613888|0)>65535){a[c]=240|i>>18,a[c=c+1|0]=128|i>>12&63,a[c=c+1|0]=128|i>>6&63,a[c=c+1|0]=128|63&i;continue}break e}i=65533}else i<=57343&&(i=65533);!s&&o<<1<c&&o<<1<(c-7|0)&&(s=!0,r=new u(3*n),r.set(a),a=r)}a[c]=224|i>>12,a[c=c+1|0]=128|i>>6&63,a[c=c+1|0]=128|63&i}return l?a.subarray(0,c):a.slice(0,c)},ENCODEINTO_BUILD&&(p.encodeInto=a),v?ENCODEINTO_BUILD&&!(o=v.prototype).encodeInto&&(c=new v,o.encodeInto=function(e,r){var t=0|e.length,n=0|r.length;if(t<n>>1){var o=c.encode(e);if((0|o.length)<n)return r.set(o),{read:t,written:0|o.length}}return a(e,r)}):(e.TextDecoder=r,e.TextEncoder=n)}(typeof global==""+void 0?typeof self==""+void 0?this:self:global);
1
+ var ENCODEINTO_BUILD=!1;!function(e){"use strict";function r(e,r){return A?e[r]:e._getter(r)}function t(e,r,t){A?e[r]=t:e._setter(r,t)}function n(){}function a(e){var r=0|e.charCodeAt(0);if(55296<=r)if(r<=56319){var t=0|e.charCodeAt(1);if(56320<=t&&t<=57343){if((r=(r<<10)+t-56613888|0)>65535)return s(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else r=65533}else r<=57343&&(r=65533);return r<=2047?s(192|r>>6,128|63&r):s(224|r>>12,128|r>>6&63,128|63&r)}function o(){}function c(e,r){var n=void 0===e?"":(""+e).replace(w,a),o=0|n.length,c=0,i=0,f=0,s=0|r.length,u=0|e.length;s<o&&(o=s);e:for(;c<o;c=c+1|0){switch((i=0|n.charCodeAt(c))>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:f=f+1|0;case 8:case 9:case 10:case 11:break;case 12:case 13:if((c+1|0)<s){f=f+1|0;break}case 14:if((c+2|0)<s){f=f+1|0;break}case 15:if((c+3|0)<s){f=f+1|0;break}default:break e}t(r,c,i)}return{written:c,read:u<f?u:f}}var i,f,s=String.fromCharCode,u={}.toString,l=u.call(e.SharedArrayBuffer),d=e.Uint8Array,h=d||Array,g=d?ArrayBuffer:h,p=g.isView||function(e){return e&&"length"in e},v=u.call(g.prototype),y=(encodeURIComponent,parseInt,o.prototype),D=e.TextEncoder,w=/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,C=new(d?Uint16Array:h)(32),A=function(){return 42===new d([42,43])[0]}();n.prototype.decode=function(e){var n,a=e;if(!p(a)){if((n=u.call(a))!==v&&n!==l&&"[object Undefined]"!==n)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");a=d?new h(a):a||[]}for(var o="",c="",i=0,f=0|a.length,g=f-32|0,y=0,D=0,w=0,A=0,b=0,I=0,F=-1;i<f;){for(y=i<=g?32:f-i|0;I<y;i=i+1|0,I=I+1|0){switch((D=255&r(a,i))>>4){case 15:if((b=255&r(a,i=i+1|0))>>6!=2||247<D){i=i-1|0;break}w=(7&D)<<6|63&b,A=5,D=256;case 14:b=255&r(a,i=i+1|0),w<<=6,w|=(15&D)<<6|63&b,A=b>>6==2?A+4|0:24,D=D+256&768;case 13:case 12:b=255&r(a,i=i+1|0),w<<=6,w|=(31&D)<<6|63&b,A=A+7|0,i<f&&b>>6==2&&w>>A&&w<1114112?(D=w,w=w-65536|0,0<=w?(F=55296+(w>>10)|0,D=56320+(1023&w)|0,I<31?(t(C,I,F),I=I+1|0,F=-1):(b=F,F=D,D=b)):y=y+1|0):(D>>=8,i=i-D-1|0,D=65533),A=0,w=0,y=i<=g?32:f-i|0;default:t(C,I,D);continue;case 11:case 10:case 9:case 8:}t(C,I,65533)}if(c+=s(r(C,0),r(C,1),r(C,2),r(C,3),r(C,4),r(C,5),r(C,6),r(C,7),r(C,8),r(C,9),r(C,10),r(C,11),r(C,12),r(C,13),r(C,14),r(C,15),r(C,16),r(C,17),r(C,18),r(C,19),r(C,20),r(C,21),r(C,22),r(C,23),r(C,24),r(C,25),r(C,26),r(C,27),r(C,28),r(C,29),r(C,30),r(C,31)),I<32&&(c=c.slice(0,I-32|0)),i<f){if(t(C,0,F),I=~F>>>31,F=-1,c.length<o.length)continue}else-1!==F&&(c+=s(F));o+=c,c=""}return o},y.encode=function(e){var r,n=void 0===e?"":""+e,a=0|n.length,o=new h(8+(a<<1)|0),c=0,i=0,f=0,s=0,u=!d;for(c=0;c<a;c=c+1|0,i=i+1|0)if((f=0|n.charCodeAt(c))<=127)t(o,i,f);else if(f<=2047)t(o,i,192|f>>6),t(o,i=i+1|0,128|63&f);else{e:{if(55296<=f)if(f<=56319){if(56320<=(s=0|n.charCodeAt(c=c+1|0))&&s<=57343){if((f=(f<<10)+s-56613888|0)>65535){t(o,i,240|f>>18),t(o,i=i+1|0,128|f>>12&63),t(o,i=i+1|0,128|f>>6&63),t(o,i=i+1|0,128|63&f);continue}break e}f=65533}else f<=57343&&(f=65533);!u&&c<<1<i&&c<<1<(i-7|0)&&(u=!0,r=new h(3*a),r.set(o),o=r)}t(o,i,224|f>>12),t(o,i=i+1|0,128|f>>6&63),t(o,i=i+1|0,128|63&f)}return d?o.subarray(0,i):o.slice(0,i)},ENCODEINTO_BUILD&&(y.encodeInto=c),D?ENCODEINTO_BUILD&&!(i=D.prototype).encodeInto&&(f=new D,i.encodeInto=function(e,r){var t=0|e.length,n=0|r.length;if(t<n>>1){var a=f.encode(e);if((0|a.length)<n)return r.set(a),{read:t,written:0|a.length}}return c(e,r)}):(e.TextDecoder=n,e.TextEncoder=o)}(typeof global==""+void 0?typeof self==""+void 0?this:self:global);
@@ -27,6 +27,29 @@ var ENCODEINTO_BUILD = false;
27
27
  var globalTextEncoderPrototype;
28
28
  var globalTextEncoderInstance;
29
29
 
30
+ // In Internet Explorer 8 there is no support for square-bracket notation
31
+ // in the TypedArrays polyfill instead so we need to use the private `_getter` and `_setter` methods.
32
+ var typedArraysSupportIndexLookup = (function() {
33
+ var arr = new NativeUint8Array([42,43]);
34
+ return arr[0] === 42
35
+ })();
36
+
37
+ function getTypedArrayIndex(array, index) {
38
+ if (typedArraysSupportIndexLookup) {
39
+ return array[index];
40
+ } else {
41
+ return array._getter(index);
42
+ }
43
+ }
44
+
45
+ function setTypedArrayIndex(array, index, value) {
46
+ if (typedArraysSupportIndexLookup) {
47
+ array[index] = value;
48
+ } else {
49
+ array._setter(index, value);
50
+ }
51
+ }
52
+
30
53
  /*function decoderReplacer(encoded) {
31
54
  var cp0 = encoded.charCodeAt(0), codePoint=0x110000, i=0, stringLen=encoded.length|0, result="";
32
55
  switch(cp0 >> 4) {
@@ -79,10 +102,10 @@ var ENCODEINTO_BUILD = false;
79
102
  for (; index < len; ) {
80
103
  nextEnd = index <= lenMinus32 ? 32 : len - index|0;
81
104
  for (; pos < nextEnd; index=index+1|0, pos=pos+1|0) {
82
- cp0 = inputAs8[index] & 0xff;
105
+ cp0 = getTypedArrayIndex(inputAs8, index) & 0xff;
83
106
  switch(cp0 >> 4) {
84
107
  case 15:
85
- cp1 = inputAs8[index=index+1|0] & 0xff;
108
+ cp1 = getTypedArrayIndex(inputAs8, index=index+1|0) & 0xff;
86
109
  if ((cp1 >> 6) !== 2 || 247 < cp0) {
87
110
  index = index - 1|0;
88
111
  break;
@@ -91,14 +114,14 @@ var ENCODEINTO_BUILD = false;
91
114
  minBits = 5; // 20 ensures it never passes -> all invalid replacements
92
115
  cp0 = 0x100; // keep track of th bit size
93
116
  case 14:
94
- cp1 = inputAs8[index=index+1|0] & 0xff;
117
+ cp1 = getTypedArrayIndex(inputAs8, index=index+1|0) & 0xff;
95
118
  codePoint <<= 6;
96
119
  codePoint |= ((cp0 & 15) << 6) | (cp1 & 63);
97
120
  minBits = (cp1 >> 6) === 2 ? minBits + 4|0 : 24; // 24 ensures it never passes -> all invalid replacements
98
121
  cp0 = (cp0 + 0x100) & 0x300; // keep track of th bit size
99
122
  case 13:
100
123
  case 12:
101
- cp1 = inputAs8[index=index+1|0] & 0xff;
124
+ cp1 = getTypedArrayIndex(inputAs8, index=index+1|0) & 0xff;
102
125
  codePoint <<= 6;
103
126
  codePoint |= ((cp0 & 31) << 6) | cp1 & 63;
104
127
  minBits = minBits + 7|0;
@@ -114,7 +137,7 @@ var ENCODEINTO_BUILD = false;
114
137
  cp0 = (codePoint & 0x3ff) + 0xDC00|0; // lowSurrogate (will be inserted later in the switch-statement)
115
138
 
116
139
  if (pos < 31) { // notice 31 instead of 32
117
- tmpBufferU16[pos] = tmp;
140
+ setTypedArrayIndex(tmpBufferU16, pos, tmp);
118
141
  pos = pos + 1|0;
119
142
  tmp = -1;
120
143
  } else {// else, we are at the end of the inputAs8 and let tmp0 be filled in later on
@@ -149,28 +172,28 @@ var ENCODEINTO_BUILD = false;
149
172
  case 2:
150
173
  case 1:
151
174
  case 0:
152
- tmpBufferU16[pos] = cp0;
175
+ setTypedArrayIndex(tmpBufferU16, pos, cp0);
153
176
  continue;*/
154
177
  default:
155
- tmpBufferU16[pos] = cp0; // fill with invalid replacement character
178
+ setTypedArrayIndex(tmpBufferU16, pos, cp0); // fill with invalid replacement character
156
179
  continue;
157
180
  case 11:
158
181
  case 10:
159
182
  case 9:
160
183
  case 8:
161
184
  }
162
- tmpBufferU16[pos] = 0xfffd; // fill with invalid replacement character
185
+ setTypedArrayIndex(tmpBufferU16, pos, 0xfffd); // fill with invalid replacement character
163
186
  }
164
187
  tmpStr += fromCharCode(
165
- tmpBufferU16[ 0], tmpBufferU16[ 1], tmpBufferU16[ 2], tmpBufferU16[ 3], tmpBufferU16[ 4], tmpBufferU16[ 5], tmpBufferU16[ 6], tmpBufferU16[ 7],
166
- tmpBufferU16[ 8], tmpBufferU16[ 9], tmpBufferU16[10], tmpBufferU16[11], tmpBufferU16[12], tmpBufferU16[13], tmpBufferU16[14], tmpBufferU16[15],
167
- tmpBufferU16[16], tmpBufferU16[17], tmpBufferU16[18], tmpBufferU16[19], tmpBufferU16[20], tmpBufferU16[21], tmpBufferU16[22], tmpBufferU16[23],
168
- tmpBufferU16[24], tmpBufferU16[25], tmpBufferU16[26], tmpBufferU16[27], tmpBufferU16[28], tmpBufferU16[29], tmpBufferU16[30], tmpBufferU16[31]
188
+ getTypedArrayIndex(tmpBufferU16, 0), getTypedArrayIndex(tmpBufferU16, 1), getTypedArrayIndex(tmpBufferU16, 2), getTypedArrayIndex(tmpBufferU16, 3), getTypedArrayIndex(tmpBufferU16, 4), getTypedArrayIndex(tmpBufferU16, 5), getTypedArrayIndex(tmpBufferU16, 6), getTypedArrayIndex(tmpBufferU16, 7),
189
+ getTypedArrayIndex(tmpBufferU16, 8), getTypedArrayIndex(tmpBufferU16, 9), getTypedArrayIndex(tmpBufferU16,10), getTypedArrayIndex(tmpBufferU16,11), getTypedArrayIndex(tmpBufferU16,12), getTypedArrayIndex(tmpBufferU16,13), getTypedArrayIndex(tmpBufferU16,14), getTypedArrayIndex(tmpBufferU16,15),
190
+ getTypedArrayIndex(tmpBufferU16,16), getTypedArrayIndex(tmpBufferU16,17), getTypedArrayIndex(tmpBufferU16,18), getTypedArrayIndex(tmpBufferU16,19), getTypedArrayIndex(tmpBufferU16,20), getTypedArrayIndex(tmpBufferU16,21), getTypedArrayIndex(tmpBufferU16,22), getTypedArrayIndex(tmpBufferU16,23),
191
+ getTypedArrayIndex(tmpBufferU16,24), getTypedArrayIndex(tmpBufferU16,25), getTypedArrayIndex(tmpBufferU16,26), getTypedArrayIndex(tmpBufferU16,27), getTypedArrayIndex(tmpBufferU16,28), getTypedArrayIndex(tmpBufferU16,29), getTypedArrayIndex(tmpBufferU16,30), getTypedArrayIndex(tmpBufferU16,31)
169
192
  );
170
193
  if (pos < 32) tmpStr = tmpStr.slice(0, pos-32|0);//-(32-pos));
171
194
  if (index < len) {
172
195
  //fromCharCode.apply(0, tmpBufferU16 : NativeUint8Array ? tmpBufferU16.subarray(0,pos) : tmpBufferU16.slice(0,pos));
173
- tmpBufferU16[0] = tmp;
196
+ setTypedArrayIndex(tmpBufferU16, 0, tmp);
174
197
  pos = (~tmp) >>> 31;//tmp !== -1 ? 1 : 0;
175
198
  tmp = -1;
176
199
 
@@ -228,10 +251,10 @@ var ENCODEINTO_BUILD = false;
228
251
  for (i=0; i<len; i=i+1|0, pos=pos+1|0) {
229
252
  point = encodedString.charCodeAt(i)|0;
230
253
  if (point <= 0x007f) {
231
- result[pos] = point;
254
+ setTypedArrayIndex(result, pos, point);
232
255
  } else if (point <= 0x07ff) {
233
- result[pos] = (0x6<<5)|(point>>6);
234
- result[pos=pos+1|0] = (0x2<<6)|(point&0x3f);
256
+ setTypedArrayIndex(result, pos, (0x6<<5)|(point>>6));
257
+ setTypedArrayIndex(result, pos=pos+1|0, (0x2<<6)|(point&0x3f));
235
258
  } else {
236
259
  widenCheck: {
237
260
  if (0xD800 <= point) {
@@ -242,10 +265,10 @@ var ENCODEINTO_BUILD = false;
242
265
  //point = ((point - 0xD800)<<10) + nextcode - 0xDC00 + 0x10000|0;
243
266
  point = (point<<10) + nextcode - 0x35fdc00|0;
244
267
  if (point > 0xffff) {
245
- result[pos] = (0x1e/*0b11110*/<<3) | (point>>18);
246
- result[pos=pos+1|0] = (0x2/*0b10*/<<6) | ((point>>12)&0x3f/*0b00111111*/);
247
- result[pos=pos+1|0] = (0x2/*0b10*/<<6) | ((point>>6)&0x3f/*0b00111111*/);
248
- result[pos=pos+1|0] = (0x2/*0b10*/<<6) | (point&0x3f/*0b00111111*/);
268
+ setTypedArrayIndex(result, pos, (0x1e/*0b11110*/<<3) | (point>>18));
269
+ setTypedArrayIndex(result, pos=pos+1|0, (0x2/*0b10*/<<6) | ((point>>12)&0x3f/*0b00111111*/));
270
+ setTypedArrayIndex(result, pos=pos+1|0, (0x2/*0b10*/<<6) | ((point>>6)&0x3f/*0b00111111*/));
271
+ setTypedArrayIndex(result, pos=pos+1|0, (0x2/*0b10*/<<6) | (point&0x3f/*0b00111111*/));
249
272
  continue;
250
273
  }
251
274
  break widenCheck;
@@ -262,9 +285,9 @@ var ENCODEINTO_BUILD = false;
262
285
  result = tmpResult;
263
286
  }
264
287
  }
265
- result[pos] = (0xe/*0b1110*/<<4) | (point>>12);
266
- result[pos=pos+1|0] =(0x2/*0b10*/<<6) | ((point>>6)&0x3f/*0b00111111*/);
267
- result[pos=pos+1|0] =(0x2/*0b10*/<<6) | (point&0x3f/*0b00111111*/);
288
+ setTypedArrayIndex(result, pos, (0xe/*0b1110*/<<4) | (point>>12));
289
+ setTypedArrayIndex(result, pos=pos+1|0,(0x2/*0b10*/<<6) | ((point>>6)&0x3f/*0b00111111*/));
290
+ setTypedArrayIndex(result, pos=pos+1|0,(0x2/*0b10*/<<6) | (point&0x3f/*0b00111111*/));
268
291
  }
269
292
  }
270
293
  return NativeUint8Array ? result.subarray(0, pos) : result.slice(0, pos);
@@ -313,7 +336,7 @@ var ENCODEINTO_BUILD = false;
313
336
  break putChars;
314
337
  }
315
338
  //read = read + ((char >> 6) !== 2) |0;
316
- u8Arr[i] = char;
339
+ setTypedArrayIndex(u8Arr, i, char);
317
340
  }
318
341
  }
319
342
  return {"written": i, "read": inputLength < read ? inputLength : read};
@@ -332,10 +355,10 @@ var ENCODEINTO_BUILD = false;
332
355
  read = read - 1|0;
333
356
  break; // we have reached the end of the string
334
357
  }
335
- u8Arr[i=i+1|0] = point;
358
+ setTypedArrayIndex(u8Arr, i=i+1|0, point);
336
359
  } else if (point <= 0x07ff) {
337
- u8Arr[i=i+1|0] = (0x6<<5)|(point>>6);
338
- u8Arr[i=i+1|0] = (0x2<<6)|(point&0x3f);
360
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x6<<5)|(point>>6));
361
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6)|(point&0x3f));
339
362
  } else {
340
363
  if (0xD800 <= point && point <= 0xDBFF) {
341
364
  nextcode = encodedString.charCodeAt(read)|0; // defaults to 0 when NaN, causing null replacement character
@@ -345,10 +368,10 @@ var ENCODEINTO_BUILD = false;
345
368
  //point = ((point - 0xD800)<<10) + nextcode - 0xDC00 + 0x10000|0;
346
369
  point = (point<<10) + nextcode - 0x35fdc00|0;
347
370
  if (point > 0xffff) {
348
- u8Arr[i=i+1|0] = (0x1e<<3) | (point>>18);
349
- u8Arr[i=i+1|0] = (0x2<<6) | ((point>>12)&0x3f);
350
- u8Arr[i=i+1|0] = (0x2<<6) | ((point>>6)&0x3f);
351
- u8Arr[i=i+1|0] = (0x2<<6) | (point&0x3f);
371
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x1e<<3) | (point>>18));
372
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | ((point>>12)&0x3f));
373
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | ((point>>6)&0x3f));
374
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | (point&0x3f));
352
375
  continue;
353
376
  }
354
377
  } else if (nextcode === 0 && encodedLen <= read) {
@@ -357,9 +380,9 @@ var ENCODEINTO_BUILD = false;
357
380
  point = 65533;//0b1111111111111101; // invalid replacement character
358
381
  }
359
382
  }
360
- u8Arr[i=i+1|0] = (0xe<<4) | (point>>12);
361
- u8Arr[i=i+1|0] = (0x2<<6) | ((point>>6)&0x3f);
362
- u8Arr[i=i+1|0] = (0x2<<6) | (point&0x3f);
383
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0xe<<4) | (point>>12));
384
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | ((point>>6)&0x3f));
385
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | (point&0x3f));
363
386
  if (u8LenLeft < (i + ((encodedLen - read) << 1)|0)) {
364
387
  // These 3x chars are the only way to inflate the size to 3x
365
388
  u8LenLeft = u8LenLeft - i|0;
@@ -380,12 +403,12 @@ var ENCODEINTO_BUILD = false;
380
403
  break; // we have reached the end of the string
381
404
  }
382
405
  u8LenLeft = u8LenLeft - 1|0;
383
- u8Arr[i=i+1|0] = point;
406
+ setTypedArrayIndex(u8Arr, i=i+1|0, point);
384
407
  } else if (point <= 0x07ff) {
385
408
  u8LenLeft = u8LenLeft - 2|0;
386
409
  if (0 <= u8LenLeft) {
387
- u8Arr[i=i+1|0] = (0x6<<5)|(point>>6);
388
- u8Arr[i=i+1|0] = (0x2<<6)|(point&0x3f);
410
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x6<<5)|(point>>6));
411
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6)|(point&0x3f));
389
412
  }
390
413
  } else {
391
414
  if (0xD800 <= point && point <= 0xDBFF) {
@@ -399,10 +422,10 @@ var ENCODEINTO_BUILD = false;
399
422
  if (point > 0xffff) {
400
423
  u8LenLeft = u8LenLeft - 4|0;
401
424
  if (0 <= u8LenLeft) {
402
- u8Arr[i=i+1|0] = (0x1e<<3) | (point>>18);
403
- u8Arr[i=i+1|0] = (0x2<<6) | ((point>>12)&0x3f);
404
- u8Arr[i=i+1|0] = (0x2<<6) | ((point>>6)&0x3f);
405
- u8Arr[i=i+1|0] = (0x2<<6) | (point&0x3f);
425
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x1e<<3) | (point>>18));
426
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | ((point>>12)&0x3f));
427
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | ((point>>6)&0x3f));
428
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | (point&0x3f));
406
429
  }
407
430
  continue;
408
431
  }
@@ -417,9 +440,9 @@ var ENCODEINTO_BUILD = false;
417
440
  }
418
441
  u8LenLeft = u8LenLeft - 3|0;
419
442
  if (0 <= u8LenLeft) {
420
- u8Arr[i=i+1|0] = (0xe<<<4) | (point>>12);
421
- u8Arr[i=i+1|0] = (0x2<<6) | ((point>>6)&0x3f);
422
- u8Arr[i=i+1|0] = (0x2<<6) | (point&0x3f);
443
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0xe<<<4) | (point>>12));
444
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | ((point>>6)&0x3f));
445
+ setTypedArrayIndex(u8Arr, i=i+1|0, (0x2<<6) | (point&0x3f));
423
446
  }
424
447
  }
425
448
  }
@@ -1 +1 @@
1
- {"aliases":["es2022"],"dependencies":["_ESAbstract.CreateMethodProperty","_ESAbstract.Get","_ESAbstract.ToIntegerOrInfinity","_ESAbstract.ToString","ArrayBuffer"],"spec":"https://tc39.es/ecma262/#sec-%typedarray%.prototype.at","docs":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/at","browsers":{"android":"*","bb":"*","chrome":"< 92","edge":"*","edge_mob":"*","firefox":"< 90","firefox_mob":"< 90","ie":"*","ie_mob":"*","ios_chr":"*","ios_saf":"*","op_mini":"*","op_mob":"*","opera":"< 78","safari":"*","samsung_mob":"< 16"},"detectSource":"\"Int8Array\"in self&&\"at\"in self.Int8Array.prototype\n","baseDir":"TypedArray/prototype/at","hasTests":true,"isTestable":true,"isPublic":true,"size":747}
1
+ {"aliases":["es2022"],"dependencies":["_ESAbstract.CreateMethodProperty","_ESAbstract.ToIntegerOrInfinity","_ESAbstract.ToString","ArrayBuffer"],"spec":"https://tc39.es/ecma262/#sec-%typedarray%.prototype.at","docs":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/at","browsers":{"android":"*","bb":"*","chrome":"< 92","edge":"*","edge_mob":"*","firefox":"< 90","firefox_mob":"< 90","ie":"*","ie_mob":"*","ios_chr":"*","ios_saf":"*","op_mini":"*","op_mob":"*","opera":"< 78","safari":"*","samsung_mob":"< 16"},"detectSource":"\"Int8Array\"in self&&\"at\"in self.Int8Array.prototype\n","baseDir":"TypedArray/prototype/at","hasTests":true,"isTestable":true,"isPublic":true,"size":855}
@@ -1 +1 @@
1
- !function(){function t(t){var r=this,e=r.length,o=ToIntegerOrInfinity(t),a=o>=0?o:e+o;return a<0||a>=e?undefined:Get(r,ToString(a))}"__proto__"in self.Int8Array.prototype?CreateMethodProperty(self.Int8Array.prototype.__proto__,"at",t):(CreateMethodProperty(self.Int8Array.prototype,"at",t),CreateMethodProperty(self.Uint8Array.prototype,"at",t),CreateMethodProperty(self.Uint8ClampedArray.prototype,"at",t),CreateMethodProperty(self.Int16Array.prototype,"at",t),CreateMethodProperty(self.Uint16Array.prototype,"at",t),CreateMethodProperty(self.Int32Array.prototype,"at",t),CreateMethodProperty(self.Uint32Array.prototype,"at",t),CreateMethodProperty(self.Float32Array.prototype,"at",t),CreateMethodProperty(self.Float64Array.prototype,"at",t))}();
1
+ !function(){function t(t,r){return e?t[r]:t._getter(r)}function r(r){var e=this,o=e.length,a=ToIntegerOrInfinity(r),p=a>=0?a:o+a;return p<0||p>=o?undefined:t(e,ToString(p))}var e=function(){var t=new Uint8Array(2);return t[0]=42,42===t[0]};"__proto__"in self.Int8Array.prototype?CreateMethodProperty(self.Int8Array.prototype.__proto__,"at",r):(CreateMethodProperty(self.Int8Array.prototype,"at",r),CreateMethodProperty(self.Uint8Array.prototype,"at",r),CreateMethodProperty(self.Uint8ClampedArray.prototype,"at",r),CreateMethodProperty(self.Int16Array.prototype,"at",r),CreateMethodProperty(self.Uint16Array.prototype,"at",r),CreateMethodProperty(self.Int32Array.prototype,"at",r),CreateMethodProperty(self.Uint32Array.prototype,"at",r),CreateMethodProperty(self.Float32Array.prototype,"at",r),CreateMethodProperty(self.Float64Array.prototype,"at",r))}();
@@ -1,8 +1,24 @@
1
1
 
2
2
  // TypedArray.prototype.at
3
- /* global CreateMethodProperty, Get, ToIntegerOrInfinity, ToString */
3
+ /* global CreateMethodProperty, Uint8Array, ToIntegerOrInfinity, ToString */
4
4
  // 23.2.3.1. %TypedArray%.prototype.at ( index )
5
5
  (function () {
6
+ // In Internet Explorer 8 there is no support for square-bracket notation
7
+ // in the TypedArrays polyfill instead so we need to use the private `_getter` method
8
+ var typedArraysSupportIndexLookup = (function() {
9
+ var uint8 = new Uint8Array(2);
10
+ uint8[0] = 42;
11
+ return uint8[0] === 42
12
+ })
13
+
14
+ function getTypedArrayIndex(array, index) {
15
+ if (typedArraysSupportIndexLookup) {
16
+ return array[index];
17
+ } else {
18
+ return array._getter(index);
19
+ }
20
+ }
21
+
6
22
  function at(index) {
7
23
  // 1. Let O be the this value.
8
24
  var O = this;
@@ -20,7 +36,8 @@
20
36
  // 7. If k < 0 or k ≥ len, return undefined.
21
37
  if (k < 0 || k >= len) return undefined;
22
38
  // 8. Return ! Get(O, ! ToString(𝔽(k))).
23
- return Get(O, ToString(k));
39
+ // return Get(O, ToString(k));
40
+ return getTypedArrayIndex(O, ToString(k));
24
41
  }
25
42
 
26
43
  if ('__proto__' in self.Int8Array.prototype) {