Browse Source

chore: get-prototype采用core-js的polyfill

es6
iapyang 5 years ago
parent
commit
c934821078
  1. 2
      src/polyfill/lodash.js
  2. 1
      webpack/webpack.common.js

2
src/polyfill/lodash.js

@ -30,6 +30,7 @@ if (!Array.isArray) {
}; };
} }
/* core-jspolyfill
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method // https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") { if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype Object.getPrototypeOf = "".__proto__ === String.prototype
@ -41,6 +42,7 @@ if (typeof Object.getPrototypeOf !== "function") {
return object.constructor.prototype; return object.constructor.prototype;
}; };
} }
*/
if(!Date.now) { if(!Date.now) {
Date.now = function () { Date.now = function () {

1
webpack/webpack.common.js

@ -13,6 +13,7 @@ module.exports = {
"core-js/features/object/create", "core-js/features/object/create",
"core-js/features/object/assign", "core-js/features/object/assign",
"core-js/features/object/get-own-property-symbols", "core-js/features/object/get-own-property-symbols",
"core-js/features/object/get-prototype-of",
"core-js/features/array/for-each", "core-js/features/array/for-each",
"core-js/features/array/index-of", "core-js/features/array/index-of",
"core-js/features/function/bind", "core-js/features/function/bind",

Loading…
Cancel
Save