Skip to content

Commit

Permalink
fix: more
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Nov 2, 2020
1 parent f02c533 commit 868613d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 29 deletions.
59 changes: 30 additions & 29 deletions lib/config/browserslistTargetHandler.js
Expand Up @@ -110,14 +110,14 @@ const resolve = browsers => {
firefox: 67,
and_ff: 67,
// ie: Not supported,
// Since Node.js 13.14.0 no warning about usage, but it was added 8.5.0 with some limitations and it was improved in 12.0.0 and 13.2.0
node: [13, 14],
opera: 50,
opera_android: 46,
op_mob: 46,
safari: [11, 1],
ios_saf: [11, 3],
samsung: [8, 0],
webview_android: 63
android: 63,
// Since Node.js 13.14.0 no warning about usage, but it was added 8.5.0 with some limitations and it was improved in 12.0.0 and 13.2.0
node: [13, 14]
});

return {
Expand All @@ -129,14 +129,16 @@ const resolve = browsers => {
// Prior to Firefox 46, a <code>TypeError</code> was thrown on redeclaration instead of a <code>SyntaxError</code>.
firefox: 36,
and_ff: 36,
ie: 11,
node: [6, 0],
// Not supported in for-in and for-of loops
// ie: Not supported
opera: 9,
opera_android: [10, 1],
op_mob: [10, 1],
safari: [5, 1],
ios_saf: 6,
samsung: [1, 5],
webview_android: 37
// Before 5.0 supported correctly in strict mode, otherwise supported without block scope
samsung: [5, 0],
android: 37,
node: [6, 0]
}),
arrowFunction: rawChecker({
chrome: 45,
Expand All @@ -147,13 +149,13 @@ const resolve = browsers => {
firefox: 39,
and_ff: 39,
// ie: Not supported,
node: [6, 0],
opera: 32,
opera_android: 32,
op_mob: 32,
safari: 10,
ios_saf: 10,
samsung: [5, 0],
webview_android: 45
android: 45,
node: [6, 0]
}),
forOf: rawChecker({
chrome: 38,
Expand All @@ -163,13 +165,13 @@ const resolve = browsers => {
firefox: 51,
and_ff: 51,
// ie: Not supported,
node: [0, 12],
opera: 25,
opera_android: 25,
op_mob: 25,
safari: 7,
ios_saf: 7,
samsung: [3, 0],
webview_android: 38
android: 38,
node: [0, 12]
}),
destructuring: rawChecker({
chrome: 49,
Expand All @@ -178,13 +180,13 @@ const resolve = browsers => {
firefox: 41,
and_ff: 41,
// ie: Not supported,
node: [6, 0],
opera: 36,
opera_android: 36,
op_mob: 36,
safari: 8,
ios_saf: 8,
samsung: [5, 0],
webview_android: 49
android: 49,
node: [6, 0]
}),
bigIntLiteral: rawChecker({
chrome: 67,
Expand All @@ -193,13 +195,13 @@ const resolve = browsers => {
firefox: 68,
and_ff: 68,
// ie: Not supported,
node: [10, 4],
opera: 54,
opera_android: 48,
op_mob: 48,
safari: 14,
ios_saf: 14,
samsung: [9, 0],
webview_android: 67
android: 67,
node: [10, 4]
}),
// Support syntax `import` and `export` and no limitations and bugs on Node.js
// Not include `export * as namespace`
Expand All @@ -210,14 +212,13 @@ const resolve = browsers => {
firefox: 60,
and_ff: 60,
// ie: Not supported,
// Since Node.js 13.14.0 no warning about usage, but it was added 8.5.0 with some limitations and it was improved in 12.0.0 and 13.2.0
node: [13, 14],
opera: 48,
opera_android: 45,
op_mob: 45,
safari: [10, 1],
ios_saf: [10, 3],
samsung: [8, 0]
// webview_android: Not supported,
samsung: [8, 0],
// Since Node.js 13.14.0 no warning about usage, but it was added 8.5.0 with some limitations and it was improved in 12.0.0 and 13.2.0
node: [13, 14]
}),

// browserslistChecker("es6-module") && rawChecker({ node: [12, 17] }),
Expand All @@ -232,13 +233,13 @@ const resolve = browsers => {
firefox: 65,
and_ff: 65,
// ie: Not supported,
node: [12, 0],
opera: 58,
opera_android: 50,
op_mob: 50,
safari: [12, 1],
ios_saf: [12, 2],
samsung: [10, 0],
webview_android: 71
android: 71,
node: [12, 0]
}),

browser: browserProperty,
Expand Down
27 changes: 27 additions & 0 deletions test/__snapshots__/target-browserslist.unittest.js.snap
Expand Up @@ -189,6 +189,33 @@ Object {
}
`;

exports[`browserslist target ["android 81"] 1`] = `
Object {
"arrowFunction": true,
"bigIntLiteral": true,
"browser": true,
"const": true,
"destructuring": true,
"document": true,
"dynamicImport": true,
"dynamicImportInWorker": true,
"electron": false,
"fetchWasm": true,
"forOf": true,
"global": false,
"globalThis": true,
"importScripts": false,
"importScriptsInWorker": true,
"module": false,
"node": false,
"nodeBuiltins": false,
"nwjs": false,
"require": false,
"web": true,
"webworker": false,
}
`;

exports[`browserslist target ["baidu 7.12"] 1`] = `
Object {
"arrowFunction": false,
Expand Down
1 change: 1 addition & 0 deletions test/target-browserslist.unittest.js
Expand Up @@ -13,6 +13,7 @@ describe("browserslist target", () => {
["android 4"],
["android 4.1"],
["android 4.4.3-4.4.4"],
["android 81"],

// Chrome
// Browserslist return `chrome` versions for `electron 11.0` query
Expand Down

0 comments on commit 868613d

Please sign in to comment.