Skip to content

Commit

Permalink
chore: update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Apr 25, 2024
1 parent 2b0fc33 commit 7045d57
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 12 deletions.
7 changes: 3 additions & 4 deletions crates/swc/tests/fixture/issues-8xxx/8095/es2020/output/1.js
@@ -1,10 +1,9 @@
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var _class;
const foo = _class = class _class {
const foo = (_class = class _class {
foo(v) {
return v;
}
};
_ts_decorate([
}, _ts_decorate([
foo
], _class.prototype, "foo", null);
], _class.prototype, "foo", null));
7 changes: 3 additions & 4 deletions crates/swc/tests/fixture/issues-8xxx/8095/es2022/output/1.js
@@ -1,10 +1,9 @@
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var _class;
const foo = _class = class _class {
const foo = (_class = class _class {
foo(v) {
return v;
}
};
_ts_decorate([
}, _ts_decorate([
foo
], _class.prototype, "foo", null);
], _class.prototype, "foo", null));
7 changes: 3 additions & 4 deletions crates/swc/tests/fixture/issues-8xxx/8095/es5/output/1.js
Expand Up @@ -2,7 +2,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var _class;
var foo = _class = function() {
var foo = (_class = function() {
"use strict";
function _class() {
_class_call_check(this, _class);
Expand All @@ -16,7 +16,6 @@ var foo = _class = function() {
}
]);
return _class;
}();
_ts_decorate([
}(), _ts_decorate([
foo
], _class.prototype, "foo", null);
], _class.prototype, "foo", null));
14 changes: 14 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/8515/input/.swcrc
@@ -0,0 +1,14 @@
{
"jsc": {
"target": "es2016",
"keepClassNames": true,
"parser": {
"syntax": "ecmascript",
"decorators": true
},
"transform": {
"legacyDecorator": true,
"useDefineForClassFields": true
}
}
}
9 changes: 9 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/8515/input/index.js
@@ -0,0 +1,9 @@
import { addX, addY } from 'someLib'

var C = @addX @addY class extends Component {
}

@addX @addY
class OtherClass extends Component {

}
14 changes: 14 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/8515/output/index.js
@@ -0,0 +1,14 @@
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
import { addX, addY } from 'someLib';
var _class;
var C = (_class = class _class extends Component {
}, _class = _ts_decorate([
addX,
addY
], _class));
let OtherClass = class OtherClass extends Component {
};
OtherClass = _ts_decorate([
addX,
addY
], OtherClass);

0 comments on commit 7045d57

Please sign in to comment.