jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378248 )
Change subject: Remove unused polyfills from EasyDeflate lib ...................................................................... Remove unused polyfills from EasyDeflate lib Base64 and TypedArrays polyfills were required to support IE9, but VE now requires IE10. * http://www.caniuse.com/#feat=atob-btoa * http://www.caniuse.com/#feat=typedarrays Change-Id: I311a16f98fb1d091f55dda52d97bebfc012e2a14 --- M extension.json D lib/Base64.js/LICENSE D lib/Base64.js/README.md D lib/Base64.js/base64.js D lib/Easy-Deflate/typedarrays.js 5 files changed, 1 insertion(+), 234 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/extension.json b/extension.json index f986095..42529c1 100644 --- a/extension.json +++ b/extension.json @@ -186,22 +186,9 @@ ] }, "ResourceModules": { - "Base64.js": { - "scripts": [ - "lib/Base64.js/base64.js" - ], - "targets": [ - "desktop", - "mobile" - ] - }, "easy-deflate.core": { "scripts": [ - "lib/Easy-Deflate/easydeflate.js", - "lib/Easy-Deflate/typedarrays.js" - ], - "dependencies": [ - "Base64.js" + "lib/Easy-Deflate/easydeflate.js" ], "targets": [ "desktop", diff --git a/lib/Base64.js/LICENSE b/lib/Base64.js/LICENSE deleted file mode 100644 index 4832767..0000000 --- a/lib/Base64.js/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (c) 2011..2012 David Chambers <d...@hashify.me> - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/lib/Base64.js/README.md b/lib/Base64.js/README.md deleted file mode 100644 index e5dafed..0000000 --- a/lib/Base64.js/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Base64.js - -≈ 500 byte* polyfill for browsers which don't provide [`window.btoa`][1] and -[`window.atob`][2]. - -Although the script does no harm in browsers which do provide these functions, -a conditional script loader such as [yepnope][3] can prevent unnecessary HTTP -requests. - -```javascript -yepnope({ - test: window.btoa && window.atob, - nope: 'base64.js', - callback: function () { - // `btoa` and `atob` are now safe to use - } -}) -``` - -Base64.js stems from a [gist][4] by [yahiko][5]. - -### Running the test suite - - make setup - make test - -\* Minified and gzipped. Run `make bytes` to verify. - - -[1]: https://developer.mozilla.org/en/DOM/window.btoa -[2]: https://developer.mozilla.org/en/DOM/window.atob -[3]: http://yepnopejs.com/ -[4]: https://gist.github.com/229984 -[5]: https://github.com/yahiko diff --git a/lib/Base64.js/base64.js b/lib/Base64.js/base64.js deleted file mode 100644 index b82dded..0000000 --- a/lib/Base64.js/base64.js +++ /dev/null @@ -1,61 +0,0 @@ -;(function () { - - var object = typeof exports != 'undefined' ? exports : this; // #8: web workers - var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - function InvalidCharacterError(message) { - this.message = message; - } - InvalidCharacterError.prototype = new Error; - InvalidCharacterError.prototype.name = 'InvalidCharacterError'; - - // encoder - // [https://gist.github.com/999166] by [https://github.com/nignag] - object.btoa || ( - object.btoa = function (input) { - var str = String(input); - for ( - // initialize result and counter - var block, charCode, idx = 0, map = chars, output = ''; - // if the next str index does not exist: - // change the mapping table to "=" - // check if d has no fractional digits - str.charAt(idx | 0) || (map = '=', idx % 1); - // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 - output += map.charAt(63 & block >> 8 - idx % 1 * 8) - ) { - charCode = str.charCodeAt(idx += 3/4); - if (charCode > 0xFF) { - throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); - } - block = block << 8 | charCode; - } - return output; - }); - - // decoder - // [https://gist.github.com/1020396] by [https://github.com/atk] - object.atob || ( - object.atob = function (input) { - var str = String(input).replace(/=+$/, ''); - if (str.length % 4 == 1) { - throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); - } - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = str.charAt(idx++); - // character found in table? initialize bit storage and add its ascii value; - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = chars.indexOf(buffer); - } - return output; - }); - -}()); diff --git a/lib/Easy-Deflate/typedarrays.js b/lib/Easy-Deflate/typedarrays.js deleted file mode 100644 index 87e2377..0000000 --- a/lib/Easy-Deflate/typedarrays.js +++ /dev/null @@ -1,111 +0,0 @@ -/** -Copyright (c) 2013, Specialisterne. -All rights reserved. -Authors: -Jacob Christian Munch-Andersen - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**/ -;(function(){ - /** - * Light shim for JavaScript typed arrays. - * - * IMPORTANT: This code is not intended to replicate the behaviour of typed - * arrays in JavaScript exacly, several features are left out or implemented - * dirreferently in order to acheive high performance and browser - * compatibility. Code should be tested thorougly both with this shim active - * and with a native implementation. - * - * For more information and newest version go to: - * https://github.com/Jacob-Christian-Munch-Andersen/Typed-arrays-light-shim - **/ - function Typedarray(length,elementlength,begin,end){ - var obj=[] - var a - if(typeof length=="number"){ - for(a=0;a<length;a++){ - obj.push(0) - } - } - else{ - if(end==null){ - begin=0 - end=length.length - } - for(a=begin;a<end;a++){ - obj.push(length[a]) - } - } - obj.subarray=subarray - obj.set=set - obj.byteLength=obj.length*elementlength - obj.byteOffset=0 - function subarray(begin,end){ - return Typedarray(obj,elementlength,begin,end) - } - function set(arr,w){ - w=w||0 - var a - var target=obj - var len=arr.length - for(a=0;a<len;a++,w++){ - target[w]=arr[a] - } - } - return obj - } - function array1(length){ - return Typedarray(length,1) - } - function array2(length){ - return Typedarray(length,2) - } - function array4(length){ - return Typedarray(length,4) - } - function array8(length){ - return Typedarray(length,8) - } - if(!window.Uint8Array){ - window.Uint8Array=array1 - } - if(!window.Int8Array){ - window.Int8Array=array1 - } - if(!window.Uint16Array){ - window.Uint16Array=array2 - } - if(!window.Int16Array){ - window.Int16Array=array2 - } - if(!window.Uint32Array){ - window.Uint32Array=array4 - } - if(!window.Int32Array){ - window.Int32Array=array4 - } - if(!window.Float32Array){ - window.Float32Array=array4 - } - if(!window.Float64Array){ - window.Float64Array=array8 - } -}()) -- To view, visit https://gerrit.wikimedia.org/r/378248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I311a16f98fb1d091f55dda52d97bebfc012e2a14 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits