Version can be float and correctly lookup envMap
This commit is contained in:
parent
b5af93f348
commit
6edae49d4d
@ -438,7 +438,7 @@
|
|||||||
"firefox": 25,
|
"firefox": 25,
|
||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 4,
|
"node": 4,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 32
|
"opera": 32
|
||||||
},
|
},
|
||||||
"es6.array.find-index": {
|
"es6.array.find-index": {
|
||||||
@ -447,7 +447,7 @@
|
|||||||
"firefox": 25,
|
"firefox": 25,
|
||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 4,
|
"node": 4,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 32
|
"opera": 32
|
||||||
},
|
},
|
||||||
"es6.array.fill": {
|
"es6.array.fill": {
|
||||||
@ -456,7 +456,7 @@
|
|||||||
"firefox": 31,
|
"firefox": 31,
|
||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 4,
|
"node": 4,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 32
|
"opera": 32
|
||||||
},
|
},
|
||||||
"es6.array.iterator": {
|
"es6.array.iterator": {
|
||||||
@ -466,7 +466,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.number.is-finite": {
|
"es6.number.is-finite": {
|
||||||
@ -544,7 +544,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.asinh": {
|
"es6.math.asinh": {
|
||||||
@ -554,7 +554,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.atanh": {
|
"es6.math.atanh": {
|
||||||
@ -564,7 +564,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.cbrt": {
|
"es6.math.cbrt": {
|
||||||
@ -574,7 +574,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.clz32": {
|
"es6.math.clz32": {
|
||||||
@ -594,7 +594,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.expm1": {
|
"es6.math.expm1": {
|
||||||
@ -604,7 +604,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.fround": {
|
"es6.math.fround": {
|
||||||
@ -614,7 +614,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.hypot": {
|
"es6.math.hypot": {
|
||||||
@ -624,7 +624,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.imul": {
|
"es6.math.imul": {
|
||||||
@ -644,7 +644,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.log10": {
|
"es6.math.log10": {
|
||||||
@ -654,7 +654,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.log2": {
|
"es6.math.log2": {
|
||||||
@ -664,7 +664,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.sign": {
|
"es6.math.sign": {
|
||||||
@ -684,7 +684,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.tanh": {
|
"es6.math.tanh": {
|
||||||
@ -694,7 +694,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es6.math.trunc": {
|
"es6.math.trunc": {
|
||||||
@ -704,7 +704,7 @@
|
|||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 0.12,
|
"node": 0.12,
|
||||||
"android": 5.1,
|
"android": 5.1,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 25
|
"opera": 25
|
||||||
},
|
},
|
||||||
"es7.array.includes": {
|
"es7.array.includes": {
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
"firefox": 34,
|
"firefox": 34,
|
||||||
"safari": 8,
|
"safari": 8,
|
||||||
"node": 4,
|
"node": 4,
|
||||||
"ios": 9,
|
"ios": 8,
|
||||||
"opera": 31
|
"opera": 31
|
||||||
},
|
},
|
||||||
"check-es2015-constants": {
|
"check-es2015-constants": {
|
||||||
|
|||||||
@ -58,11 +58,12 @@ const invertedEqualsEnv = Object.keys(envs)
|
|||||||
environments.some((env) => {
|
environments.some((env) => {
|
||||||
// go through all environment names to find the the current one
|
// go through all environment names to find the the current one
|
||||||
// and try to get the version as integer
|
// and try to get the version as integer
|
||||||
const version = parseInt(checkEnv.replace(env, ""), 10);
|
const version = parseFloat(checkEnv.replace(env, ""));
|
||||||
if (!isNaN(version)) {
|
if (!isNaN(version)) {
|
||||||
Object.keys(envs).forEach((equals) => {
|
Object.keys(envs).forEach((equals) => {
|
||||||
|
equals = envMap[equals] || equals;
|
||||||
// Go through all envs from compat-table and get int version
|
// Go through all envs from compat-table and get int version
|
||||||
const equalsVersion = parseInt(equals.replace(env, ""), 10);
|
const equalsVersion = parseFloat(equals.replace(env, ""));
|
||||||
// If the current version is smaller than the version that was mentioned
|
// If the current version is smaller than the version that was mentioned
|
||||||
// in `equals` we can add an entry, as older versions should include features
|
// in `equals` we can add an entry, as older versions should include features
|
||||||
// that newer ones have
|
// that newer ones have
|
||||||
@ -78,8 +79,6 @@ const invertedEqualsEnv = Object.keys(envs)
|
|||||||
return a;
|
return a;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
invertedEqualsEnv.safari8 = ["ios9"];
|
|
||||||
|
|
||||||
const compatibilityTests = flattenDeep([
|
const compatibilityTests = flattenDeep([
|
||||||
es6Data,
|
es6Data,
|
||||||
es6PlusData,
|
es6PlusData,
|
||||||
@ -141,7 +140,7 @@ const getLowestImplementedVersion = ({ features }, env) => {
|
|||||||
.filter((test) => tests[i].res[test] === true || tests[i].res[test] === "strict")
|
.filter((test) => tests[i].res[test] === true || tests[i].res[test] === "strict")
|
||||||
// normalize some keys
|
// normalize some keys
|
||||||
.map((test) => envMap[test] || test)
|
.map((test) => envMap[test] || test)
|
||||||
.filter((test) => !isNaN(parseInt(test.replace(env, ""))))
|
.filter((test) => !isNaN(parseFloat(test.replace(env, ""))))
|
||||||
.shift();
|
.shift();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user