gearheads
/
mastodon
Archived
2
0
Fork 0

Fix old browsers crashing because of missing `finally` polyfill in web UI (#13115)

Fix #13015
gh/stable
ThibG 2020-02-18 17:22:44 +01:00 committed by GitHub
parent 7584342d83
commit 1314bba68a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import assign from 'object-assign';
import values from 'object.values'; import values from 'object.values';
import isNaN from 'is-nan'; import isNaN from 'is-nan';
import { decode as decodeBase64 } from './utils/base64'; import { decode as decodeBase64 } from './utils/base64';
import promiseFinally from 'promise.prototype.finally';
if (!Array.prototype.includes) { if (!Array.prototype.includes) {
includes.shim(); includes.shim();
@ -23,6 +24,8 @@ if (!Number.isNaN) {
Number.isNaN = isNaN; Number.isNaN = isNaN;
} }
promiseFinally.shim();
if (!HTMLCanvasElement.prototype.toBlob) { if (!HTMLCanvasElement.prototype.toBlob) {
const BASE64_MARKER = ';base64,'; const BASE64_MARKER = ';base64,';

View File

@ -18,7 +18,8 @@ function loadPolyfills() {
Number.isNaN && Number.isNaN &&
Object.assign && Object.assign &&
Object.values && Object.values &&
window.Symbol window.Symbol &&
Promise.prototype.finally
); );
// Latest version of Firefox and Safari do not have IntersectionObserver. // Latest version of Firefox and Safari do not have IntersectionObserver.

View File

@ -67,8 +67,8 @@
"@babel/preset-env": "^7.8.3", "@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3", "@babel/preset-react": "^7.8.3",
"@babel/runtime": "^7.8.3", "@babel/runtime": "^7.8.3",
"@gamestdio/websocket": "^0.3.2",
"@clusterws/cws": "^0.17.3", "@clusterws/cws": "^0.17.3",
"@gamestdio/websocket": "^0.3.2",
"array-includes": "^3.1.1", "array-includes": "^3.1.1",
"arrow-key-navigation": "^1.1.0", "arrow-key-navigation": "^1.1.0",
"autoprefixer": "^9.7.4", "autoprefixer": "^9.7.4",
@ -120,6 +120,7 @@
"pg": "^6.4.0", "pg": "^6.4.0",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"postcss-object-fit-images": "^1.1.2", "postcss-object-fit-images": "^1.1.2",
"promise.prototype.finally": "^3.1.2",
"prop-types": "^15.5.10", "prop-types": "^15.5.10",
"punycode": "^2.1.0", "punycode": "^2.1.0",
"rails-ujs": "^5.2.4", "rails-ujs": "^5.2.4",

View File

@ -3711,6 +3711,23 @@ es-abstract@^1.13.0, es-abstract@^1.15.0, es-abstract@^1.17.0, es-abstract@^1.17
string.prototype.trimleft "^2.1.1" string.prototype.trimleft "^2.1.1"
string.prototype.trimright "^2.1.1" string.prototype.trimright "^2.1.1"
es-abstract@^1.17.0-next.0:
version "1.17.4"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184"
integrity sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==
dependencies:
es-to-primitive "^1.2.1"
function-bind "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.1"
is-callable "^1.1.5"
is-regex "^1.0.5"
object-inspect "^1.7.0"
object-keys "^1.1.1"
object.assign "^4.1.0"
string.prototype.trimleft "^2.1.1"
string.prototype.trimright "^2.1.1"
es-to-primitive@^1.2.1: es-to-primitive@^1.2.1:
version "1.2.1" version "1.2.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
@ -8347,6 +8364,15 @@ promise-inflight@^1.0.1:
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM=
promise.prototype.finally@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/promise.prototype.finally/-/promise.prototype.finally-3.1.2.tgz#b8af89160c9c673cefe3b4c4435b53cfd0287067"
integrity sha512-A2HuJWl2opDH0EafgdjwEw7HysI8ff/n4lW4QEVBCUXFk9QeGecBWv0Deph0UmLe3tTNYegz8MOjsVuE6SMoJA==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.17.0-next.0"
function-bind "^1.1.1"
prompts@^2.0.1: prompts@^2.0.1:
version "2.0.3" version "2.0.3"
resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.3.tgz#c5ccb324010b2e8f74752aadceeb57134c1d2522" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.3.tgz#c5ccb324010b2e8f74752aadceeb57134c1d2522"