Browse Source

目前发现的ie8下的问题

es6
Frank.Qiu 6 years ago
parent
commit
5d798c28a6
  1. 44
      dist/fineui.js
  2. 44
      dist/polyfill.js
  3. 43
      src/polyfill/lodash.js

44
dist/fineui.js vendored

@ -154,7 +154,49 @@ window.localStorage || (window.localStorage = {
clear: function () {
this.items = {};
}
});if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
});
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else {
Set = function () {

44
dist/polyfill.js vendored

@ -154,7 +154,49 @@ window.localStorage || (window.localStorage = {
clear: function () {
this.items = {};
}
});if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
});
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else {
Set = function () {

43
src/polyfill/lodash.js

@ -0,0 +1,43 @@
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}
Loading…
Cancel
Save