Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/preset_env_base/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub fn should_enable(target: &Versions, feature: &Versions, default: bool) -> bo
_ => None,
});

feature_or_fallback_version.map_or(true, |v| v > target_version)
feature_or_fallback_version.map_or(default, |v| v > target_version)
})
},
)
Expand Down
38 changes: 10 additions & 28 deletions crates/swc/tests/fixture/issues-4xxx/4224/1/output/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
var _async_to_generator = require("@swc/helpers/_/_async_to_generator");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _ts_generator = require("@swc/helpers/_/_ts_generator");
var A = function A() {
"use strict";
var _this = this;
_class_call_check._(this, A);
this.foo = function() {
return _async_to_generator._(function() {
return _ts_generator._(this, function(_state) {
this.x();
return [
2
];
});
}).call(_this);
};
this.bar = function() {
return _async_to_generator._(function() {
return _ts_generator._(this, function(_state) {
this.x();
return [
2
];
});
}).call(_this);
};
};
class A {
constructor(){
this.foo = async ()=>{
this.x();
};
this.bar = async ()=>{
this.x();
};
}
}
console.log(A);
5 changes: 2 additions & 3 deletions crates/swc/tests/fixture/issues-6xxx/6371/output/input.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
function add(a, b) {
var _arguments = arguments;
var d = function() {
return _arguments.length;
const d = ()=>{
return arguments.length;
};
return d();
}
24 changes: 3 additions & 21 deletions crates/swc/tests/fixture/issues-6xxx/6727/output/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
var _async_to_generator = require("@swc/helpers/_/_async_to_generator");
var _type_of = require("@swc/helpers/_/_type_of");
var _ts_generator = require("@swc/helpers/_/_ts_generator");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.promise.js");
function a() {
return _async_to_generator._(function() {
return _ts_generator._(this, function(_state) {
switch(_state.label){
case 0:
return [
4,
Promise.resolve()
];
case 1:
_state.sent();
return [
2
];
}
});
})();
async function a() {
await Promise.resolve();
}
console.log(typeof a === "undefined" ? "undefined" : _type_of._(a));
console.log(typeof a);
1 change: 1 addition & 0 deletions crates/swc_ecma_preset_env/src/transform_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ mod tests {
use super::*;

#[test]
#[ignore = "ie is not supported by browserslist anymore"]
fn arrow() {
assert!(Feature::ArrowFunctions.should_enable(
&BrowserData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import "core-js/modules/web.dom.iterable.js";
var p = Promise.resolve(0);
Promise.all([
p
]).then(function(outcome) {
]).then((outcome)=>{
alert("OK");
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import "core-js/modules/es6.object.to-string.js";
import "core-js/modules/es6.promise.js";
import "core-js/modules/es7.promise.finally.js";
var p = Promise.resolve(0);
p.finally(function() {
p.finally(()=>{
alert("OK");
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import "core-js/modules/web.dom.iterable.js";
var p = Promise.resolve(0);
Promise.race([
p
]).then(function(outcome) {
]).then((outcome)=>{
alert("OK");
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import "core-js/modules/web.dom-collections.iterator.js";
var p = Promise.resolve(0);
Promise.all([
p
]).then(function(outcome) {
]).then((outcome)=>{
alert("OK");
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.promise.finally.js";
import "core-js/modules/es.promise.js";
var p = Promise.resolve(0);
p.finally(function() {
p.finally(()=>{
alert("OK");
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import "core-js/modules/web.dom-collections.iterator.js";
var p = Promise.resolve(0);
Promise.race([
p
]).then(function(outcome) {
]).then((outcome)=>{
alert("OK");
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import "core-js/modules/es.regexp.constructor.js";
import "core-js/modules/es.regexp.exec.js";
import "core-js/modules/es.regexp.to-string.js";
var a = RegExp("(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})", "u");
var b = RegExp(".", "s");
var c = RegExp(".", "imsuy");
const a = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/u;
const b = /./s;
const c = /./imsuy;
console.log(a.unicode);
console.log(b.dotAll);
console.log(c.sticky);
Expand Down
Loading