test(es): Add a test to ensure that an issue is not a bug of swc (#4227)

This commit is contained in:
Donny/강동윤 2022-04-02 15:29:09 +09:00 committed by GitHub
parent 3337777f8c
commit bbbaf15bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 137 additions and 0 deletions

View File

@ -0,0 +1,22 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false
},
"target": "es5",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6",
"strict": false,
"strictMode": false,
"lazy": false,
"noInterop": false
},
"minify": false
}

View File

@ -0,0 +1,5 @@
import 'reflect-metadata'
const v0 = (async v1 => v1).constructor;
const res = v0(() => Reflect.get(v3, 'a'));
console.log(res)

View File

@ -0,0 +1,23 @@
import * as swcHelpers from "@swc/helpers";
import regeneratorRuntime from "regenerator-runtime";
import "reflect-metadata";
var v0 = function() {
var _ref = swcHelpers.asyncToGenerator(regeneratorRuntime.mark(function _callee(v1) {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.abrupt("return", v1);
case 1:
case "end":
return _ctx.stop();
}
}, _callee);
}));
return function(v1) {
return _ref.apply(this, arguments);
};
}().constructor;
var res = v0(function() {
return Reflect.get(v3, "a");
});
console.log(res);

View File

@ -0,0 +1,22 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false
},
"target": "es2015",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6",
"strict": false,
"strictMode": false,
"lazy": false,
"noInterop": false
},
"minify": false
}

View File

@ -0,0 +1,5 @@
import 'reflect-metadata'
const v0 = (async v1 => v1).constructor;
const res = v0(() => Reflect.get(v3, 'a'));
console.log(res)

View File

@ -0,0 +1,13 @@
import * as swcHelpers from "@swc/helpers";
import 'reflect-metadata';
const v0 = function() {
var _ref = swcHelpers.asyncToGenerator(function*(v1) {
return v1;
});
return function(v1) {
return _ref.apply(this, arguments);
};
}().constructor;
const res = v0(()=>Reflect.get(v3, 'a')
);
console.log(res);

View File

@ -0,0 +1,18 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false
},
"target": "es5",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "commonjs"
},
"minify": false
}

View File

@ -0,0 +1,5 @@
import 'reflect-metadata'
const v0 = (async v1 => v1).constructor;
const res = v0(() => Reflect.get(v3, 'a'));
console.log(res)

View File

@ -0,0 +1,24 @@
"use strict";
var swcHelpers = require("@swc/helpers");
var _regeneratorRuntime = swcHelpers.interopRequireDefault(require("regenerator-runtime"));
require("reflect-metadata");
var v0 = function() {
var _ref = swcHelpers.asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(v1) {
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.abrupt("return", v1);
case 1:
case "end":
return _ctx.stop();
}
}, _callee);
}));
return function(v1) {
return _ref.apply(this, arguments);
};
}().constructor;
var res = v0(function() {
return Reflect.get(v3, "a");
});
console.log(res);