Browse Source

Add polyfill for Object.values (#6697)

master
Yamagishi Kazutoshi 6 years ago
committed by Eugen Rochko
parent
commit
188aa3ea50
3 changed files with 7 additions and 0 deletions
  1. +5
    -0
      app/javascript/mastodon/base_polyfills.js
  2. +1
    -0
      app/javascript/mastodon/load_polyfills.js
  3. +1
    -0
      package.json

+ 5
- 0
app/javascript/mastodon/base_polyfills.js View File

@ -3,6 +3,7 @@ import 'intl/locale-data/jsonp/en';
import 'es6-symbol/implement'; import 'es6-symbol/implement';
import includes from 'array-includes'; import includes from 'array-includes';
import assign from 'object-assign'; import assign from 'object-assign';
import values from 'object.values';
import isNaN from 'is-nan'; import isNaN from 'is-nan';
if (!Array.prototype.includes) { if (!Array.prototype.includes) {
@ -13,6 +14,10 @@ if (!Object.assign) {
Object.assign = assign; Object.assign = assign;
} }
if (!Object.values) {
values.shim();
}
if (!Number.isNaN) { if (!Number.isNaN) {
Number.isNaN = isNaN; Number.isNaN = isNaN;
} }

+ 1
- 0
app/javascript/mastodon/load_polyfills.js View File

@ -14,6 +14,7 @@ function loadPolyfills() {
const needsBasePolyfills = !( const needsBasePolyfills = !(
window.Intl && window.Intl &&
Object.assign && Object.assign &&
Object.values &&
Number.isNaN && Number.isNaN &&
window.Symbol && window.Symbol &&
Array.prototype.includes Array.prototype.includes

+ 1
- 0
package.json View File

@ -71,6 +71,7 @@
"npmlog": "^4.1.2", "npmlog": "^4.1.2",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
"object-fit-images": "^3.2.3", "object-fit-images": "^3.2.3",
"object.values": "^1.0.4",
"offline-plugin": "^4.8.3", "offline-plugin": "^4.8.3",
"path-complete-extname": "^0.1.0", "path-complete-extname": "^0.1.0",
"pg": "^6.4.0", "pg": "^6.4.0",

Loading…
Cancel
Save