diff --git a/.changeset/nasty-students-obey.md b/.changeset/nasty-students-obey.md
new file mode 100644
index 00000000000..86033459433
--- /dev/null
+++ b/.changeset/nasty-students-obey.md
@@ -0,0 +1,5 @@
+---
+swc_ecma_transforms_base: minor
+---
+
+perf(es/compat): Reimplement constructor transform
diff --git a/crates/swc/tests/fixture/issues-0xxx/846/case1/output/index.js b/crates/swc/tests/fixture/issues-0xxx/846/case1/output/index.js
index e669a3106a4..70ebd17d6d2 100644
--- a/crates/swc/tests/fixture/issues-0xxx/846/case1/output/index.js
+++ b/crates/swc/tests/fixture/issues-0xxx/846/case1/output/index.js
@@ -1,10 +1,9 @@
-var _assert_this_initialized = require("@swc/helpers/_/_assert_this_initialized");
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _decorate = require("@swc/helpers/_/_decorate");
var _get = require("@swc/helpers/_/_get");
var _get_prototype_of = require("@swc/helpers/_/_get_prototype_of");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var SomeClass = _decorate._([], function(_initialize) {
"use strict";
var SomeClass = function SomeClass() {
@@ -31,12 +30,11 @@ var OtherClass = _decorate._([], function(_initialize, _SomeClass) {
var OtherClass = /*#__PURE__*/ function(_SomeClass) {
"use strict";
_inherits._(OtherClass, _SomeClass);
- var _super = _create_super._(OtherClass);
function OtherClass() {
_class_call_check._(this, OtherClass);
var _this;
- _this = _super.apply(this, arguments);
- _initialize(_assert_this_initialized._(_this));
+ _this = _call_super._(this, OtherClass, arguments);
+ _initialize(_this);
return _this;
}
return OtherClass;
diff --git a/crates/swc/tests/fixture/issues-1xxx/1490/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1490/case1/output/index.js
index 193635f83a5..ad9380df4fb 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1490/case1/output/index.js
+++ b/crates/swc/tests/fixture/issues-1xxx/1490/case1/output/index.js
@@ -1,16 +1,15 @@
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _create_class = require("@swc/helpers/_/_create_class");
var _get = require("@swc/helpers/_/_get");
var _get_prototype_of = require("@swc/helpers/_/_get_prototype_of");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var ColouredCanvasElement = /*#__PURE__*/ function(CanvasElement1) {
"use strict";
_inherits._(ColouredCanvasElement, CanvasElement1);
- var _super = _create_super._(ColouredCanvasElement);
function ColouredCanvasElement() {
_class_call_check._(this, ColouredCanvasElement);
- return _super.apply(this, arguments);
+ return _call_super._(this, ColouredCanvasElement, arguments);
}
_create_class._(ColouredCanvasElement, [
{
diff --git a/crates/swc/tests/fixture/issues-1xxx/1490/full/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1490/full/output/index.js
index 27dca97ba0f..f5bab0e1eb1 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1490/full/output/index.js
+++ b/crates/swc/tests/fixture/issues-1xxx/1490/full/output/index.js
@@ -1,11 +1,11 @@
"use strict";
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _create_class = require("@swc/helpers/_/_create_class");
var _get = require("@swc/helpers/_/_get");
var _get_prototype_of = require("@swc/helpers/_/_get_prototype_of");
var _inherits = require("@swc/helpers/_/_inherits");
var _wrap_native_super = require("@swc/helpers/_/_wrap_native_super");
-var _create_super = require("@swc/helpers/_/_create_super");
var Element = /*#__PURE__*/ function() {
function Element() {
_class_call_check._(this, Element);
@@ -22,10 +22,9 @@ var Element = /*#__PURE__*/ function() {
}();
var CanvasElement = /*#__PURE__*/ function(Element) {
_inherits._(CanvasElement, Element);
- var _super = _create_super._(CanvasElement);
function CanvasElement() {
_class_call_check._(this, CanvasElement);
- return _super.apply(this, arguments);
+ return _call_super._(this, CanvasElement, arguments);
}
_create_class._(CanvasElement, [
{
@@ -40,10 +39,9 @@ var CanvasElement = /*#__PURE__*/ function(Element) {
}(_wrap_native_super._(Element));
var ColouredCanvasElement = /*#__PURE__*/ function(CanvasElement) {
_inherits._(ColouredCanvasElement, CanvasElement);
- var _super = _create_super._(ColouredCanvasElement);
function ColouredCanvasElement() {
_class_call_check._(this, ColouredCanvasElement);
- return _super.apply(this, arguments);
+ return _call_super._(this, ColouredCanvasElement, arguments);
}
_create_class._(ColouredCanvasElement, [
{
@@ -58,10 +56,9 @@ var ColouredCanvasElement = /*#__PURE__*/ function(CanvasElement) {
}(CanvasElement);
var ColouredSquare = /*#__PURE__*/ function(ColouredCanvasElement) {
_inherits._(ColouredSquare, ColouredCanvasElement);
- var _super = _create_super._(ColouredSquare);
function ColouredSquare() {
_class_call_check._(this, ColouredSquare);
- return _super.apply(this, arguments);
+ return _call_super._(this, ColouredSquare, arguments);
}
return ColouredSquare;
}(ColouredCanvasElement);
diff --git a/crates/swc/tests/fixture/issues-1xxx/1505/case1/output/index.ts b/crates/swc/tests/fixture/issues-1xxx/1505/case1/output/index.ts
index 0474a5b5726..a2863124f58 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1505/case1/output/index.ts
+++ b/crates/swc/tests/fixture/issues-1xxx/1505/case1/output/index.ts
@@ -1,7 +1,7 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var MyClass = function MyClass() {
"use strict";
_class_call_check(this, MyClass);
@@ -10,10 +10,9 @@ export var fn = function() {
var _class = /*#__PURE__*/ function(MyClass) {
"use strict";
_inherits(_class, MyClass);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(MyClass);
diff --git a/crates/swc/tests/fixture/issues-1xxx/1505/case2/output/index.ts b/crates/swc/tests/fixture/issues-1xxx/1505/case2/output/index.ts
index 2a44be8427d..61f411cb05a 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1505/case2/output/index.ts
+++ b/crates/swc/tests/fixture/issues-1xxx/1505/case2/output/index.ts
@@ -1,6 +1,6 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var MyClass = function MyClass() {
"use strict";
_class_call_check(this, MyClass);
@@ -9,10 +9,9 @@ export var fn = function() {
return /*#__PURE__*/ function(MyClass) {
"use strict";
_inherits(_class, MyClass);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(MyClass);
diff --git a/crates/swc/tests/fixture/issues-1xxx/1505/case3/output/index.tsx b/crates/swc/tests/fixture/issues-1xxx/1505/case3/output/index.tsx
index b8e32278bcf..5c390a3c3cc 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1505/case3/output/index.tsx
+++ b/crates/swc/tests/fixture/issues-1xxx/1505/case3/output/index.tsx
@@ -1,7 +1,7 @@
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _define_property = require("@swc/helpers/_/_define_property");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var Component = function Component() {
"use strict";
_class_call_check._(this, Component);
@@ -14,10 +14,9 @@ var withTeamsForUser = function(_WrappedComponent) {
var _class = /*#__PURE__*/ function(Component) {
"use strict";
_inherits._(_class, Component);
- var _super = _create_super._(_class);
function _class() {
_class_call_check._(this, _class);
- return _super.apply(this, arguments);
+ return _call_super._(this, _class, arguments);
}
return _class;
}(Component);
diff --git a/crates/swc/tests/fixture/issues-1xxx/1505/case4/output/index.tsx b/crates/swc/tests/fixture/issues-1xxx/1505/case4/output/index.tsx
index fd6de4cd362..e8d3304f58e 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1505/case4/output/index.tsx
+++ b/crates/swc/tests/fixture/issues-1xxx/1505/case4/output/index.tsx
@@ -1,13 +1,12 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var a = /*#__PURE__*/ function(Component1) {
"use strict";
_inherits(a, Component1);
- var _super = _create_super(a);
function a() {
_class_call_check(this, a);
- return _super.apply(this, arguments);
+ return _call_super(this, a, arguments);
}
return a;
}(Component);
diff --git a/crates/swc/tests/fixture/issues-1xxx/1505/case5/output/index.tsx b/crates/swc/tests/fixture/issues-1xxx/1505/case5/output/index.tsx
index afc15af89ea..1ab78d70a30 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1505/case5/output/index.tsx
+++ b/crates/swc/tests/fixture/issues-1xxx/1505/case5/output/index.tsx
@@ -1,15 +1,14 @@
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _define_property = require("@swc/helpers/_/_define_property");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var withTeamsForUser = function() {
var _class = /*#__PURE__*/ function(Component1) {
"use strict";
_inherits._(_class, Component1);
- var _super = _create_super._(_class);
function _class() {
_class_call_check._(this, _class);
- return _super.apply(this, arguments);
+ return _call_super._(this, _class, arguments);
}
return _class;
}(Component);
diff --git a/crates/swc/tests/fixture/issues-1xxx/1505/tsx-default/output/index.ts b/crates/swc/tests/fixture/issues-1xxx/1505/tsx-default/output/index.ts
index 2a44be8427d..61f411cb05a 100644
--- a/crates/swc/tests/fixture/issues-1xxx/1505/tsx-default/output/index.ts
+++ b/crates/swc/tests/fixture/issues-1xxx/1505/tsx-default/output/index.ts
@@ -1,6 +1,6 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var MyClass = function MyClass() {
"use strict";
_class_call_check(this, MyClass);
@@ -9,10 +9,9 @@ export var fn = function() {
return /*#__PURE__*/ function(MyClass) {
"use strict";
_inherits(_class, MyClass);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(MyClass);
diff --git a/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map b/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map
index 75ce485e233..2b748f6f912 100644
--- a/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map
+++ b/crates/swc/tests/fixture/issues-5xxx/5272/1/output/a.map
@@ -1,5 +1,5 @@
{
- "mappings": ";;;+BACaA;;;eAAAA;;;;;;;oBADQ;AACd,IAAA,AAAMA,oBAAD,AAAL;;gBAAMA;iCAAAA;aAAAA;kCAAAA;;;oBAAAA;;YACTC,KAAAA;mBAAAA,SAAAA;gBACI,OAAO,IAAI,IAAI,CAACC,GAAG;YACvB;;;WAHSF;EAAYG,UAAI",
+ "mappings": ";;;+BACaA;;;eAAAA;;;;;;;oBADQ;AACd,IAAA,AAAMA,oBAAD,AAAL;;gBAAMA;aAAAA;kCAAAA;mCAAAA;;oBAAAA;;YACTC,KAAAA;mBAAAA,SAAAA;gBACI,OAAO,IAAI,IAAI,CAACC,GAAG;YACvB;;;WAHSF;EAAYG,UAAI",
"names": [
"Foo",
"bar",
diff --git a/crates/swc/tests/fixture/issues-5xxx/5272/1/output/source/a/a.ts b/crates/swc/tests/fixture/issues-5xxx/5272/1/output/source/a/a.ts
index 19644b89285..2121c99c098 100644
--- a/crates/swc/tests/fixture/issues-5xxx/5272/1/output/source/a/a.ts
+++ b/crates/swc/tests/fixture/issues-5xxx/5272/1/output/source/a/a.ts
@@ -7,18 +7,17 @@ Object.defineProperty(exports, "Foo", {
return Foo;
}
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _create_class = require("@swc/helpers/_/_create_class");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var _base = require("../b/base");
var Foo = /*#__PURE__*/ function(Base) {
"use strict";
_inherits._(Foo, Base);
- var _super = _create_super._(Foo);
function Foo() {
_class_call_check._(this, Foo);
- return _super.apply(this, arguments);
+ return _call_super._(this, Foo, arguments);
}
_create_class._(Foo, [
{
diff --git a/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js
index 48aacf38a1c..c78020d9ab4 100644
--- a/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js
+++ b/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js
@@ -1,17 +1,16 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
import React from 'react';
import { withRouter } from 'react-router-dom';
var App = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(App, _React_Component);
- var _super = _create_super(App);
function App() {
_class_call_check(this, App);
- return _super.apply(this, arguments);
+ return _call_super(this, App, arguments);
}
_create_class(App, [
{
diff --git a/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js b/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js
index 8a7f6a367b9..6c706dd87fc 100644
--- a/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js
+++ b/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js
@@ -5,7 +5,7 @@ export default {
"use strict";
_inherits(ClassName1, ClassName);
function ClassName1() {
- return ClassName.call(this);
+ return ClassName.call(this) || this;
}
return ClassName1;
}(ClassName)
diff --git a/crates/swc/tests/fixture/issues-9xxx/9494/input/.swcrc b/crates/swc/tests/fixture/issues-9xxx/9494/input/.swcrc
new file mode 100644
index 00000000000..744ceb040bb
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-9xxx/9494/input/.swcrc
@@ -0,0 +1,9 @@
+{
+ "jsc": {
+ "parser": {
+ "syntax": "ecmascript"
+ },
+ "externalHelpers": false,
+ "target": "es5"
+ }
+}
\ No newline at end of file
diff --git a/crates/swc/tests/fixture/issues-9xxx/9494/input/index.js b/crates/swc/tests/fixture/issues-9xxx/9494/input/index.js
new file mode 100644
index 00000000000..bbc821f16b6
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-9xxx/9494/input/index.js
@@ -0,0 +1,17 @@
+class Foo1 extends Bar {
+ constructor() {
+ super(); // ok
+ }
+}
+
+class Foo2 extends Bar {
+ constructor() {
+ 0, super(); // ?
+ }
+}
+
+class Foo3 extends Bar {
+ constructor() {
+ [super()]; // ?
+ }
+}
\ No newline at end of file
diff --git a/crates/swc/tests/fixture/issues-9xxx/9494/output/index.js b/crates/swc/tests/fixture/issues-9xxx/9494/output/index.js
new file mode 100644
index 00000000000..04ac9f07b84
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-9xxx/9494/output/index.js
@@ -0,0 +1,35 @@
+var _call_super = require("@swc/helpers/_/_call_super");
+var _class_call_check = require("@swc/helpers/_/_class_call_check");
+var _inherits = require("@swc/helpers/_/_inherits");
+var Foo1 = /*#__PURE__*/ function(Bar1) {
+ "use strict";
+ _inherits._(Foo1, Bar1);
+ function Foo1() {
+ _class_call_check._(this, Foo1);
+ return _call_super._(this, Foo1); // ok
+ }
+ return Foo1;
+}(Bar);
+var Foo2 = /*#__PURE__*/ function(Bar1) {
+ "use strict";
+ _inherits._(Foo2, Bar1);
+ function Foo2() {
+ _class_call_check._(this, Foo2);
+ var _this;
+ return 0, _this = _call_super._(this, Foo2); // ?
+ }
+ return Foo2;
+}(Bar);
+var Foo3 = /*#__PURE__*/ function(Bar1) {
+ "use strict";
+ _inherits._(Foo3, Bar1);
+ function Foo3() {
+ _class_call_check._(this, Foo3);
+ var _this;
+ [
+ _this = _call_super._(this, Foo3)
+ ]; // ?
+ return _this;
+ }
+ return Foo3;
+}(Bar);
diff --git a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/dto/update-user.dto.ts b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/dto/update-user.dto.ts
index 56d561199ff..74e9624851d 100644
--- a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/dto/update-user.dto.ts
+++ b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/dto/update-user.dto.ts
@@ -1,15 +1,14 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { PartialType } from "@nestjs/mapped-types";
import { CreateUserDto } from "./create-user.dto";
export var UpdateUserDto = /*#__PURE__*/ function(_PartialType) {
"use strict";
_inherits(UpdateUserDto, _PartialType);
- var _super = _create_super(UpdateUserDto);
function UpdateUserDto() {
_class_call_check(this, UpdateUserDto);
- return _super.apply(this, arguments);
+ return _call_super(this, UpdateUserDto, arguments);
}
return UpdateUserDto;
}(PartialType(CreateUserDto));
diff --git a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/dto/update-user.dto.ts b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/dto/update-user.dto.ts
index 56d561199ff..74e9624851d 100644
--- a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/dto/update-user.dto.ts
+++ b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/dto/update-user.dto.ts
@@ -1,15 +1,14 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { PartialType } from "@nestjs/mapped-types";
import { CreateUserDto } from "./create-user.dto";
export var UpdateUserDto = /*#__PURE__*/ function(_PartialType) {
"use strict";
_inherits(UpdateUserDto, _PartialType);
- var _super = _create_super(UpdateUserDto);
function UpdateUserDto() {
_class_call_check(this, UpdateUserDto);
- return _super.apply(this, arguments);
+ return _call_super(this, UpdateUserDto, arguments);
}
return UpdateUserDto;
}(PartialType(CreateUserDto));
diff --git a/crates/swc/tests/fixture/new-target/output/class-extends-error.ts b/crates/swc/tests/fixture/new-target/output/class-extends-error.ts
index b1138fbc373..9142e091ad7 100644
--- a/crates/swc/tests/fixture/new-target/output/class-extends-error.ts
+++ b/crates/swc/tests/fixture/new-target/output/class-extends-error.ts
@@ -1,18 +1,18 @@
-var _assert_this_initialized = require("@swc/helpers/_/_assert_this_initialized");
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
var _instanceof = require("@swc/helpers/_/_instanceof");
var _wrap_native_super = require("@swc/helpers/_/_wrap_native_super");
-var _create_super = require("@swc/helpers/_/_create_super");
var CustomError = /*#__PURE__*/ function _target(Error1) {
"use strict";
_inherits._(CustomError, Error1);
- var _super = _create_super._(CustomError);
function CustomError(message) {
_class_call_check._(this, CustomError);
var _this;
- _this = _super.call(this, message); // 'Error' breaks prototype chain here
- Object.setPrototypeOf(_assert_this_initialized._(_this), (_instanceof._(this, CustomError) ? this.constructor : void 0).prototype); // restore prototype chain
+ _this = _call_super._(this, CustomError, [
+ message
+ ]); // 'Error' breaks prototype chain here
+ Object.setPrototypeOf(_this, (_instanceof._(this, CustomError) ? this.constructor : void 0).prototype); // restore prototype chain
return _this;
}
return CustomError;
diff --git a/crates/swc/tests/fixture/next.js/40399/3/output/index.js b/crates/swc/tests/fixture/next.js/40399/3/output/index.js
index 4a5133585f3..032315b4578 100644
--- a/crates/swc/tests/fixture/next.js/40399/3/output/index.js
+++ b/crates/swc/tests/fixture/next.js/40399/3/output/index.js
@@ -1,9 +1,9 @@
var _async_to_generator = require("@swc/helpers/_/_async_to_generator");
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _create_class = require("@swc/helpers/_/_create_class");
var _define_property = require("@swc/helpers/_/_define_property");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var _ts_generator = require("@swc/helpers/_/_ts_generator");
var Foo = function Foo(v) {
"use strict";
@@ -23,10 +23,9 @@ _async_to_generator._(function() {
Bar = /*#__PURE__*/ function(Foo1) {
"use strict";
_inherits._(Bar, Foo1);
- var _super = _create_super._(Bar);
function Bar() {
_class_call_check._(this, Bar);
- return _super.apply(this, arguments);
+ return _call_super._(this, Bar, arguments);
}
_create_class._(Bar, [
{
diff --git a/crates/swc/tests/ts-isolated-declaration/oxc/output/eliminate-imports.ts b/crates/swc/tests/ts-isolated-declaration/oxc/output/eliminate-imports.ts
index 00d67d46d19..9c54ea46de4 100644
--- a/crates/swc/tests/ts-isolated-declaration/oxc/output/eliminate-imports.ts
+++ b/crates/swc/tests/ts-isolated-declaration/oxc/output/eliminate-imports.ts
@@ -1,14 +1,13 @@
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { BExtend } from 'mod';
export var B = /*#__PURE__*/ function(BExtend) {
"use strict";
_inherits(B, BExtend);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(BExtend);
diff --git a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.1.normal.js
index bf577b926ad..cc5bdba074c 100644
--- a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.1.normal.js
+++ b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.1.normal.js
@@ -1,7 +1,7 @@
//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A;
(function(A) {
var Point = function Point() {
@@ -16,10 +16,9 @@ var A;
var Point3d = /*#__PURE__*/ function(Point) {
"use strict";
_inherits(Point3d, Point);
- var _super = _create_super(Point3d);
function Point3d() {
_class_call_check(this, Point3d);
- return _super.apply(this, arguments);
+ return _call_super(this, Point3d, arguments);
}
return Point3d;
}(Point);
diff --git a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.2.minified.js
index 226174607b4..e5d025c7cd3 100644
--- a/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.2.minified.js
+++ b/crates/swc/tests/tsc-references/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.2.minified.js
@@ -1,20 +1,18 @@
//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts]
var A, A1, Point, Point3d;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
A1 = A || (A = {}), Point = function Point() {
_class_call_check(this, Point);
}, A1.Point = Point, A1.Origin = {
x: 0,
y: 0
}, Point3d = /*#__PURE__*/ function(Point) {
- _inherits(Point3d, Point);
- var _super = _create_super(Point3d);
function Point3d() {
- return _class_call_check(this, Point3d), _super.apply(this, arguments);
+ return _class_call_check(this, Point3d), _call_super(this, Point3d, arguments);
}
- return Point3d;
+ return _inherits(Point3d, Point), Point3d;
}(Point), A1.Point3d = Point3d, A1.Origin3d = {
x: 0,
y: 0,
diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.1.normal.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.1.normal.js
index 7ce58981b0e..206678a1387 100644
--- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.1.normal.js
+++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.1.normal.js
@@ -1,7 +1,7 @@
//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A;
(function(A) {
var Point = function Point() {
@@ -15,10 +15,9 @@ var A;
var Point3d = /*#__PURE__*/ function(Point) {
"use strict";
_inherits(Point3d, Point);
- var _super = _create_super(Point3d);
function Point3d() {
_class_call_check(this, Point3d);
- return _super.apply(this, arguments);
+ return _call_super(this, Point3d, arguments);
}
return Point3d;
}(Point);
diff --git a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.2.minified.js b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.2.minified.js
index 935104b792f..7d82ca69023 100644
--- a/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.2.minified.js
+++ b/crates/swc/tests/tsc-references/ExportClassWithInaccessibleTypeInTypeParameterConstraint.2.minified.js
@@ -1,18 +1,16 @@
//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts]
var A, A1, Point3d, Line;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(A1 = A || (A = {})).Origin = {
x: 0,
y: 0
}, Point3d = /*#__PURE__*/ function(Point) {
- _inherits(Point3d, Point);
- var _super = _create_super(Point3d);
function Point3d() {
- return _class_call_check(this, Point3d), _super.apply(this, arguments);
+ return _class_call_check(this, Point3d), _call_super(this, Point3d, arguments);
}
- return Point3d;
+ return _inherits(Point3d, Point), Point3d;
}(function Point() {
_class_call_check(this, Point);
}), A1.Point3d = Point3d, A1.Origin3d = {
diff --git a/crates/swc/tests/tsc-references/apparentTypeSubtyping.1.normal.js b/crates/swc/tests/tsc-references/apparentTypeSubtyping.1.normal.js
index a27b6ddbae1..8d0be91033b 100644
--- a/crates/swc/tests/tsc-references/apparentTypeSubtyping.1.normal.js
+++ b/crates/swc/tests/tsc-references/apparentTypeSubtyping.1.normal.js
@@ -1,9 +1,9 @@
//// [apparentTypeSubtyping.ts]
// subtype checks use the apparent type of the target type
// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S:
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -12,10 +12,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -27,10 +26,9 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/apparentTypeSubtyping.2.minified.js b/crates/swc/tests/tsc-references/apparentTypeSubtyping.2.minified.js
index 0315c324e09..94c774ff293 100644
--- a/crates/swc/tests/tsc-references/apparentTypeSubtyping.2.minified.js
+++ b/crates/swc/tests/tsc-references/apparentTypeSubtyping.2.minified.js
@@ -1,4 +1,4 @@
//// [apparentTypeSubtyping.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/apparentTypeSupertype.1.normal.js b/crates/swc/tests/tsc-references/apparentTypeSupertype.1.normal.js
index ebbb7c092da..4c3003a3a66 100644
--- a/crates/swc/tests/tsc-references/apparentTypeSupertype.1.normal.js
+++ b/crates/swc/tests/tsc-references/apparentTypeSupertype.1.normal.js
@@ -1,9 +1,9 @@
//// [apparentTypeSupertype.ts]
// subtype checks use the apparent type of the target type
// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S:
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -12,10 +12,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/apparentTypeSupertype.2.minified.js b/crates/swc/tests/tsc-references/apparentTypeSupertype.2.minified.js
index 5e9c7ce999c..f5c58188192 100644
--- a/crates/swc/tests/tsc-references/apparentTypeSupertype.2.minified.js
+++ b/crates/swc/tests/tsc-references/apparentTypeSupertype.2.minified.js
@@ -1,4 +1,4 @@
//// [apparentTypeSupertype.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js b/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js
index 27af359969f..435a69c6649 100644
--- a/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js
+++ b/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js
@@ -1,8 +1,8 @@
//// [arrayLiterals.ts]
// Empty array literal with no contextual type has type Undefined[]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var arr1 = [
[],
[
@@ -95,20 +95,18 @@ var Base = function Base() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
return Derived1;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/arrayLiterals.2.minified.js b/crates/swc/tests/tsc-references/arrayLiterals.2.minified.js
index 2d6f4e62ef6..84bd839654e 100644
--- a/crates/swc/tests/tsc-references/arrayLiterals.2.minified.js
+++ b/crates/swc/tests/tsc-references/arrayLiterals.2.minified.js
@@ -1,7 +1,7 @@
//// [arrayLiterals.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
};
@@ -9,18 +9,14 @@ new C(), new C();
var Base = function Base() {
_class_call_check(this, Base);
}, Derived1 = /*#__PURE__*/ function(Base) {
- _inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
- return _class_call_check(this, Derived1), _super.apply(this, arguments);
+ return _class_call_check(this, Derived1), _call_super(this, Derived1, arguments);
}
- return Derived1;
+ return _inherits(Derived1, Base), Derived1;
}(Base), Derived2 = /*#__PURE__*/ function(Base) {
- _inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2;
+ return _inherits(Derived2, Base), Derived2;
}(Base);
new Derived1(), new Derived2(), new Derived1(), new Derived1();
diff --git a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.1.normal.js b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.1.normal.js
index afba4b49aff..8f3a44e479c 100644
--- a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.1.normal.js
+++ b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.1.normal.js
@@ -1,7 +1,7 @@
//// [arrayLiteralsWithRecursiveGenerics.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var List = function List() {
"use strict";
_class_call_check(this, List);
@@ -9,10 +9,9 @@ var List = function List() {
var DerivedList = /*#__PURE__*/ function(List) {
"use strict";
_inherits(DerivedList, List);
- var _super = _create_super(DerivedList);
function DerivedList() {
_class_call_check(this, DerivedList);
- return _super.apply(this, arguments);
+ return _call_super(this, DerivedList, arguments);
}
return DerivedList;
}(List);
diff --git a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.2.minified.js b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.2.minified.js
index 2b1468426e1..c2ad45c5cf6 100644
--- a/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.2.minified.js
+++ b/crates/swc/tests/tsc-references/arrayLiteralsWithRecursiveGenerics.2.minified.js
@@ -1,4 +1,4 @@
//// [arrayLiteralsWithRecursiveGenerics.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.1.normal.js
index 03f85c1bb8f..81f9358f431 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithCallSignatures3.ts]
// these are all permitted with the current rules, since we do not do contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.2.minified.js
index a517a5728a2..f10a16684a4 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures3.2.minified.js
@@ -1,4 +1,4 @@
//// [assignmentCompatWithCallSignatures3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.1.normal.js
index e42ffb47e0f..789052969d6 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithCallSignatures4.ts]
// These are mostly permitted with the current loose rules. All ok unless otherwise noted.
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Errors;
(function(Errors) {
var Base = function Base() {
@@ -12,30 +12,27 @@ var Errors;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.2.minified.js
index de211216c67..37f277488e6 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures4.2.minified.js
@@ -1,6 +1,6 @@
//// [assignmentCompatWithCallSignatures4.ts]
var Errors, WithNonGenericSignaturesInBaseType, WithGenericSignaturesInBaseType;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Errors || (Errors = {}), WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {}), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {});
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.1.normal.js
index 6961b531f81..072b7e28c8e 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithCallSignatures5.ts]
// checking assignment compat for function types. No errors in this file
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.2.minified.js
index 61f1727053d..b9e8352dd58 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures5.2.minified.js
@@ -1,4 +1,4 @@
//// [assignmentCompatWithCallSignatures5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.1.normal.js
index 57533b88211..92513cdd1c9 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithCallSignatures6.ts]
// checking assignment compatibility relations for function types. All valid
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.2.minified.js
index 0519841b53b..1db03eda30e 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures6.2.minified.js
@@ -1,6 +1,6 @@
//// [assignmentCompatWithCallSignatures6.ts]
var x, b, b2, b3, b4, b5, b11, b16;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
x.a = b, b = x.a, x.a2 = b2, b2 = x.a2, x.a3 = b3, b3 = x.a3, x.a4 = b4, b4 = x.a4, x.a5 = b5, b5 = x.a5, x.a11 = b11, b11 = x.a11, x.a16 = b16, x.a16;
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.1.normal.js
index 0ef18f234ef..5af3696af16 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithConstructSignatures3.ts]
// checking assignment compatibility relations for function types. All of these are valid.
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.2.minified.js
index 38d19f52661..e92ea608026 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures3.2.minified.js
@@ -1,4 +1,4 @@
//// [assignmentCompatWithConstructSignatures3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.1.normal.js
index 9e9acaca3da..2a9aa3e10d2 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithConstructSignatures4.ts]
// checking assignment compatibility relations for function types.
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Errors;
(function(Errors) {
var Base = function Base() {
@@ -12,30 +12,27 @@ var Errors;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.2.minified.js
index 2b94e7e9abd..afee77d515a 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures4.2.minified.js
@@ -1,6 +1,6 @@
//// [assignmentCompatWithConstructSignatures4.ts]
var Errors, WithNonGenericSignaturesInBaseType, WithGenericSignaturesInBaseType;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Errors || (Errors = {}), WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {}), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {});
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.1.normal.js
index 42c68bc7cfb..4daf91aec96 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithConstructSignatures5.ts]
// checking assignment compat for function types. All valid
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.2.minified.js
index f683cd505d0..e733cbdd808 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures5.2.minified.js
@@ -1,4 +1,4 @@
//// [assignmentCompatWithConstructSignatures5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.1.normal.js
index 4c9e23abf9b..4bb10c58647 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithConstructSignatures6.ts]
// checking assignment compatibility relations for function types. All valid.
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.2.minified.js
index 2a0a5f5544f..3a4bd16116e 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures6.2.minified.js
@@ -1,6 +1,6 @@
//// [assignmentCompatWithConstructSignatures6.ts]
var x, b, b2, b3, b4, b5, b11, b16;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
x.a = b, b = x.a, x.a2 = b2, b2 = x.a2, x.a3 = b3, b3 = x.a3, x.a4 = b4, b4 = x.a4, x.a5 = b5, b5 = x.a5, x.a11 = b11, b11 = x.a11, x.a16 = b16, x.a16;
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.1.normal.js
index 777de94ea75..f862d6b58f0 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithNumericIndexer.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -23,10 +23,9 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.2.minified.js
index 54583475579..4e5fa246aab 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer.2.minified.js
@@ -1,6 +1,6 @@
//// [assignmentCompatWithNumericIndexer.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.1.normal.js
index 4628c6b2707..8b347b9a485 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithNumericIndexer3.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -14,10 +14,9 @@ b = a; // ok
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.2.minified.js
index 6ec041eb415..c966b03ee88 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithNumericIndexer3.2.minified.js
@@ -1,6 +1,6 @@
//// [assignmentCompatWithNumericIndexer3.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.1.normal.js
index ad74fc529c8..e335d2fc9d3 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithObjectMembers4.ts]
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var OnlyDerived;
(function(OnlyDerived) {
var Base = function Base() {
@@ -12,20 +12,18 @@ var OnlyDerived;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
@@ -78,20 +76,18 @@ var WithBase;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.2.minified.js
index 7a013444e2b..30c7bcb44ec 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers4.2.minified.js
@@ -1,31 +1,25 @@
//// [assignmentCompatWithObjectMembers4.ts]
var OnlyDerived, WithBase, Base, Derived, Derived2, Base1, Derived21;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
OnlyDerived || (OnlyDerived = {}), Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(Base = function Base() {
_class_call_check(this, Base);
}), Derived2 = /*#__PURE__*/ function(Base) {
- _inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2;
+ return _inherits(Derived2, Base), Derived2;
}(Base), new Derived(), new Derived2(), WithBase || (WithBase = {}), Derived21 = /*#__PURE__*/ function(Base) {
- _inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2;
+ return _inherits(Derived2, Base), Derived2;
}(Base1 = function Base() {
_class_call_check(this, Base);
}), new Base1(), new Derived21();
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.1.normal.js
index 6e8465f8ea2..aea8bd97970 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithObjectMembersOptionality.ts]
// Derived member is not optional but base member is, should be ok
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,20 +10,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.2.minified.js
index 8970370ca3c..ecb1ef6219a 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality.2.minified.js
@@ -1,7 +1,7 @@
//// [assignmentCompatWithObjectMembersOptionality.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var TargetHasOptional, SourceHasOptional, Base = function Base() {
_class_call_check(this, Base);
};
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.1.normal.js
index 8bb5e9f03d7..b8011a2a9ec 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.1.normal.js
@@ -1,9 +1,9 @@
//// [assignmentCompatWithObjectMembersOptionality2.ts]
// M is optional and S contains no property with the same name as M
// N is optional and T contains no property with the same name as N
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -11,20 +11,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.2.minified.js
index 751993de81d..b650ea545e3 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersOptionality2.2.minified.js
@@ -1,7 +1,7 @@
//// [assignmentCompatWithObjectMembersOptionality2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var TargetHasOptional, SourceHasOptional, Base = function Base() {
_class_call_check(this, Base);
};
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.1.normal.js
index 46a20a2a43a..4070d13cdba 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.1.normal.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.1.normal.js
@@ -1,8 +1,8 @@
//// [assignmentCompatWithStringIndexer.ts]
// index signatures must be compatible in assignments
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -23,10 +23,9 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -37,10 +36,9 @@ var Generics;
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.2.minified.js
index a8f7f0fc666..0d63db828d0 100644
--- a/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.2.minified.js
+++ b/crates/swc/tests/tsc-references/assignmentCompatWithStringIndexer.2.minified.js
@@ -1,6 +1,6 @@
//// [assignmentCompatWithStringIndexer.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es5.1.normal.js
index 3f167a2f87a..57dd0096762 100644
--- a/crates/swc/tests/tsc-references/asyncImportedPromise_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es5.1.normal.js
@@ -9,17 +9,16 @@ Object.defineProperty(exports, "Task", {
return Task;
}
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
var _wrap_native_super = require("@swc/helpers/_/_wrap_native_super");
-var _create_super = require("@swc/helpers/_/_create_super");
var Task = /*#__PURE__*/ function(Promise1) {
"use strict";
_inherits._(Task, Promise1);
- var _super = _create_super._(Task);
function Task() {
_class_call_check._(this, Task);
- return _super.apply(this, arguments);
+ return _call_super._(this, Task, arguments);
}
return Task;
}(_wrap_native_super._(Promise));
diff --git a/crates/swc/tests/tsc-references/asyncImportedPromise_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncImportedPromise_es5.2.minified.js
index 4fd431946bb..4d013fcd7e0 100644
--- a/crates/swc/tests/tsc-references/asyncImportedPromise_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/asyncImportedPromise_es5.2.minified.js
@@ -7,14 +7,12 @@ Object.defineProperty(exports, "__esModule", {
return Task;
}
});
-var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _wrap_native_super = require("@swc/helpers/_/_wrap_native_super"), _create_super = require("@swc/helpers/_/_create_super"), Task = /*#__PURE__*/ function(Promise1) {
- _inherits._(Task, Promise1);
- var _super = _create_super._(Task);
+var _call_super = require("@swc/helpers/_/_call_super"), _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), Task = /*#__PURE__*/ function(Promise1) {
function Task() {
- return _class_call_check._(this, Task), _super.apply(this, arguments);
+ return _class_call_check._(this, Task), _call_super._(this, Task, arguments);
}
- return Task;
-}(_wrap_native_super._(Promise));
+ return _inherits._(Task, Promise1), Task;
+}(require("@swc/helpers/_/_wrap_native_super")._(Promise));
//// [test.ts]
Object.defineProperty(exports, "__esModule", {
value: !0
diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.1.normal.js
index 0ed173df124..fb0d54d682f 100644
--- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.1.normal.js
@@ -1,11 +1,11 @@
//// [asyncMethodWithSuper_es5.ts]
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _set } from "@swc/helpers/_/_set";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
var A = /*#__PURE__*/ function() {
"use strict";
@@ -20,10 +20,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
// async method with only call/get on 'super' does not require a binding
diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.2.minified.js
index 7b91c5540f6..eb239dfb384 100644
--- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es5.2.minified.js
@@ -1,9 +1,9 @@
//// [asyncMethodWithSuper_es5.ts]
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _set } from "@swc/helpers/_/_set";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/awaitClassExpression_es5.1.normal.js
index d2d98c9c0f7..1140d36fe40 100644
--- a/crates/swc/tests/tsc-references/awaitClassExpression_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/awaitClassExpression_es5.1.normal.js
@@ -1,8 +1,8 @@
//// [awaitClassExpression_es5.ts]
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
function func() {
return _func.apply(this, arguments);
@@ -16,10 +16,9 @@ function _func() {
_ = function(_superClass) {
"use strict";
_inherits(D, _superClass);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
};
diff --git a/crates/swc/tests/tsc-references/awaitClassExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/awaitClassExpression_es5.2.minified.js
index def3dc00a2e..603909d79de 100644
--- a/crates/swc/tests/tsc-references/awaitClassExpression_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/awaitClassExpression_es5.2.minified.js
@@ -1,6 +1,6 @@
//// [awaitClassExpression_es5.ts]
import "@swc/helpers/_/_async_to_generator";
+import "@swc/helpers/_/_call_super";
import "@swc/helpers/_/_class_call_check";
import "@swc/helpers/_/_inherits";
-import "@swc/helpers/_/_create_super";
import "@swc/helpers/_/_ts_generator";
diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.1.normal.js
index c314fa7bb7c..5f595fde11d 100644
--- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.1.normal.js
+++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.1.normal.js
@@ -1,9 +1,9 @@
//// [bestCommonTypeOfConditionalExpressions.ts]
// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist)
// no errors expected here
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var a;
var b;
var Base = function Base() {
@@ -13,20 +13,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.2.minified.js
index 71252c850ef..22b4f9c2de3 100644
--- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.2.minified.js
+++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions.2.minified.js
@@ -1,4 +1,4 @@
//// [bestCommonTypeOfConditionalExpressions.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js
index 3d69e93fcb5..455d25d58b4 100644
--- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js
+++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js
@@ -1,9 +1,9 @@
//// [bestCommonTypeOfConditionalExpressions2.ts]
// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist)
// these are errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -11,20 +11,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.2.minified.js
index 087d4ad9fe0..c58245344a0 100644
--- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.2.minified.js
+++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.2.minified.js
@@ -1,4 +1,4 @@
//// [bestCommonTypeOfConditionalExpressions2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.1.normal.js
index 495e5cb73f9..9cd62cb175d 100644
--- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.1.normal.js
+++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.1.normal.js
@@ -1,7 +1,7 @@
//// [bestCommonTypeOfTuple2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -17,10 +17,9 @@ var E = function E() {
var F = /*#__PURE__*/ function(C) {
"use strict";
_inherits(F, C);
- var _super = _create_super(F);
function F() {
_class_call_check(this, F);
- return _super.apply(this, arguments);
+ return _call_super(this, F, arguments);
}
return F;
}(C);
@@ -32,11 +31,10 @@ var C1 = function C1() {
var D1 = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(D1, C1);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, D1, arguments);
_this.i = "bar";
return _this;
}
diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.2.minified.js b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.2.minified.js
index c9cebe6925f..31367e6efea 100644
--- a/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.2.minified.js
+++ b/crates/swc/tests/tsc-references/bestCommonTypeOfTuple2.2.minified.js
@@ -1,6 +1,6 @@
//// [bestCommonTypeOfTuple2.ts]
var t1, t2, t3, t4, t5;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
t1[4], t2[4], t3[4], t4[2], t5[2];
diff --git a/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).1.normal.js b/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).1.normal.js
index 0cde5bc0545..dad66c52a69 100644
--- a/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).1.normal.js
@@ -1,10 +1,10 @@
//// [callChainWithSuper.ts]
// GH#34952
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -17,10 +17,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.method1 = function method1() {
diff --git a/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).2.minified.js b/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).2.minified.js
index f9b1219a645..182d75364a6 100644
--- a/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/callChainWithSuper(target=es5).2.minified.js
@@ -1,6 +1,6 @@
//// [callChainWithSuper.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.1.normal.js
index bc518f148ae..80c807a73d5 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.1.normal.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.1.normal.js
@@ -1,8 +1,8 @@
//// [callSignatureAssignabilityInInheritance2.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.2.minified.js
index 428fb527105..3c2300a63af 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.2.minified.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance2.2.minified.js
@@ -1,4 +1,4 @@
//// [callSignatureAssignabilityInInheritance2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.1.normal.js
index 0e835b1bf69..436445729ac 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.1.normal.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.1.normal.js
@@ -1,9 +1,9 @@
//// [callSignatureAssignabilityInInheritance3.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
// error cases
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Errors;
(function(Errors) {
var Base = function Base() {
@@ -13,30 +13,27 @@ var Errors;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.2.minified.js
index 2678c24f21b..a57e09b9bcf 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.2.minified.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance3.2.minified.js
@@ -1,6 +1,6 @@
//// [callSignatureAssignabilityInInheritance3.ts]
var Errors;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Errors || (Errors = {});
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.1.normal.js
index 608f35513ef..5292451dc3e 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.1.normal.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.1.normal.js
@@ -1,8 +1,8 @@
//// [callSignatureAssignabilityInInheritance4.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.2.minified.js
index 6f288a97081..ed382041e5a 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.2.minified.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance4.2.minified.js
@@ -1,4 +1,4 @@
//// [callSignatureAssignabilityInInheritance4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.1.normal.js
index 08c57d90b5e..7c6bd7a45ce 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.1.normal.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.1.normal.js
@@ -1,9 +1,9 @@
//// [callSignatureAssignabilityInInheritance5.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithCallSignatures2 just with an extra level of indirection in the inheritance chain
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -11,30 +11,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.2.minified.js
index 2338fc32482..cdbfbd27af2 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.2.minified.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance5.2.minified.js
@@ -1,4 +1,4 @@
//// [callSignatureAssignabilityInInheritance5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.1.normal.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.1.normal.js
index 993b5dd33d9..b11804a0b4f 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.1.normal.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.1.normal.js
@@ -2,9 +2,9 @@
// checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithCallSignatures4 but using class type parameters instead of generic signatures
// all are errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -12,30 +12,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.2.minified.js b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.2.minified.js
index 4ce14b64493..c7782a0f394 100644
--- a/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.2.minified.js
+++ b/crates/swc/tests/tsc-references/callSignatureAssignabilityInInheritance6.2.minified.js
@@ -1,4 +1,4 @@
//// [callSignatureAssignabilityInInheritance6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/callWithSpread.1.normal.js b/crates/swc/tests/tsc-references/callWithSpread.1.normal.js
index 216361ab09e..5aaa9559959 100644
--- a/crates/swc/tests/tsc-references/callWithSpread.1.normal.js
+++ b/crates/swc/tests/tsc-references/callWithSpread.1.normal.js
@@ -1,10 +1,10 @@
//// [callWithSpread.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _obj, _obj1, _obj2, _obj3, _foo_apply, _obj4, _foo_apply1, _obj5, _obj6, _obj7, _obj8, _foo_apply2, _obj9, _foo_apply3, _xa_, _xa_1, _xa_2;
function foo(x, y) {
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
@@ -128,12 +128,14 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.call(this, 1, 2);
- return _super.call.apply(_super, [
- this,
+ var _this;
+ _this = _call_super(this, D, [
+ 1,
+ 2
+ ]);
+ return _this = _call_super(this, D, [
1,
2
].concat(_to_consumable_array(a)));
diff --git a/crates/swc/tests/tsc-references/callWithSpread.2.minified.js b/crates/swc/tests/tsc-references/callWithSpread.2.minified.js
index 69d1fbfd92a..df9eadabfd2 100644
--- a/crates/swc/tests/tsc-references/callWithSpread.2.minified.js
+++ b/crates/swc/tests/tsc-references/callWithSpread.2.minified.js
@@ -1,11 +1,11 @@
//// [callWithSpread.ts]
var _foo_apply, _foo_apply1, _foo_apply2, _foo_apply3, _xa_, _xa_1, _xa_2, a, obj, xa;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function foo(x, y) {
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
}
diff --git a/crates/swc/tests/tsc-references/castingTuple.1.normal.js b/crates/swc/tests/tsc-references/castingTuple.1.normal.js
index fb1c78321ec..b117a27abf3 100644
--- a/crates/swc/tests/tsc-references/castingTuple.1.normal.js
+++ b/crates/swc/tests/tsc-references/castingTuple.1.normal.js
@@ -1,7 +1,7 @@
//// [castingTuple.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -18,20 +18,18 @@ var D = function D() {
var E = /*#__PURE__*/ function(A) {
"use strict";
_inherits(E, A);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
return E;
}(A);
var F = /*#__PURE__*/ function(A) {
"use strict";
_inherits(F, A);
- var _super = _create_super(F);
function F() {
_class_call_check(this, F);
- return _super.apply(this, arguments);
+ return _call_super(this, F, arguments);
}
return F;
}(A);
diff --git a/crates/swc/tests/tsc-references/castingTuple.2.minified.js b/crates/swc/tests/tsc-references/castingTuple.2.minified.js
index 784003d3fea..504ad2f01f5 100644
--- a/crates/swc/tests/tsc-references/castingTuple.2.minified.js
+++ b/crates/swc/tests/tsc-references/castingTuple.2.minified.js
@@ -1,7 +1,7 @@
//// [castingTuple.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var E1, E2, E11, E21, C = function C() {
_class_call_check(this, C);
}, D = function D() {
diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js
index 75f8a05e1cd..088120f993e 100644
--- a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js
+++ b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js
@@ -1,16 +1,15 @@
//// [checkJsxChildrenCanBeTupleType.tsx]
///
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import React from 'react';
var ResizablePanel = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(ResizablePanel, _React_Component);
- var _super = _create_super(ResizablePanel);
function ResizablePanel() {
_class_call_check(this, ResizablePanel);
- return _super.apply(this, arguments);
+ return _call_super(this, ResizablePanel, arguments);
}
return ResizablePanel;
}(React.Component);
diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js
index f30d84084c4..27f3b5d6c95 100644
--- a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js
+++ b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js
@@ -1,6 +1,6 @@
//// [checkJsxChildrenCanBeTupleType.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import React from 'react';
/*#__PURE__*/ React.Component;
diff --git a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.1.normal.js b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.1.normal.js
index 6341687335a..10e9e271821 100644
--- a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.1.normal.js
+++ b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.1.normal.js
@@ -1,14 +1,13 @@
//// [checkJsxIntersectionElementPropsType.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(Component1) {
"use strict";
_inherits(C, Component1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(Component);
diff --git a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.2.minified.js b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.2.minified.js
index acfdde8f99a..2212182f006 100644
--- a/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.2.minified.js
+++ b/crates/swc/tests/tsc-references/checkJsxIntersectionElementPropsType.2.minified.js
@@ -1,14 +1,12 @@
//// [checkJsxIntersectionElementPropsType.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
new /*#__PURE__*/ (function(Component1) {
- _inherits(C, Component1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, Component1), C;
}(Component))({
foobar: "example"
});
diff --git a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.1.normal.js b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.1.normal.js
index eb342efa640..31212e5b73c 100644
--- a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.1.normal.js
+++ b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.1.normal.js
@@ -1,18 +1,17 @@
//// [checkJsxSubtleSkipContextSensitiveBug.tsx]
///
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
import * as React from "react";
var AsyncLoader = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(AsyncLoader, _React_Component);
- var _super = _create_super(AsyncLoader);
function AsyncLoader() {
_class_call_check(this, AsyncLoader);
- return _super.apply(this, arguments);
+ return _call_super(this, AsyncLoader, arguments);
}
var _proto = AsyncLoader.prototype;
_proto.render = function render() {
diff --git a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.2.minified.js b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.2.minified.js
index 3fcdc50ec28..89a74a6f0b6 100644
--- a/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.2.minified.js
+++ b/crates/swc/tests/tsc-references/checkJsxSubtleSkipContextSensitiveBug.2.minified.js
@@ -1,8 +1,8 @@
//// [checkJsxSubtleSkipContextSensitiveBug.tsx]
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
import * as React from "react";
/*#__PURE__*/ React.Component;
diff --git a/crates/swc/tests/tsc-references/circularImportAlias.1.normal.js b/crates/swc/tests/tsc-references/circularImportAlias.1.normal.js
index 10f39de15ab..a11a9cbc391 100644
--- a/crates/swc/tests/tsc-references/circularImportAlias.1.normal.js
+++ b/crates/swc/tests/tsc-references/circularImportAlias.1.normal.js
@@ -1,18 +1,17 @@
//// [circularImportAlias.ts]
// expected no error
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B;
(function(B) {
B.a = A;
var D = /*#__PURE__*/ function(_B_a_C) {
"use strict";
_inherits(D, _B_a_C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(B.a.C);
diff --git a/crates/swc/tests/tsc-references/circularImportAlias.2.minified.js b/crates/swc/tests/tsc-references/circularImportAlias.2.minified.js
index b10bda52f88..9d2ef9b1b60 100644
--- a/crates/swc/tests/tsc-references/circularImportAlias.2.minified.js
+++ b/crates/swc/tests/tsc-references/circularImportAlias.2.minified.js
@@ -1,15 +1,13 @@
//// [circularImportAlias.ts]
var B, A, B1, D, A1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(B1 = B || (B = {})).a = A, D = /*#__PURE__*/ function(_B_a_C) {
- _inherits(D, _B_a_C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, _B_a_C), D;
}(B1.a.C), B1.D = D, (A1 = A || (A = {})).C = function C() {
_class_call_check(this, C);
}, A1.b = B, new B.a.C();
diff --git a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.1.normal.js b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.1.normal.js
index dc3e3fa3c15..3612551df99 100644
--- a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.1.normal.js
+++ b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.1.normal.js
@@ -1,7 +1,7 @@
//// [classAbstractConstructorAssignability.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -9,20 +9,18 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
diff --git a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.2.minified.js b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.2.minified.js
index 1cc859739ff..923a60cd1ca 100644
--- a/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.2.minified.js
+++ b/crates/swc/tests/tsc-references/classAbstractConstructorAssignability.2.minified.js
@@ -1,15 +1,13 @@
//// [classAbstractConstructorAssignability.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
_class_call_check(this, A);
}, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B;
+ return _inherits(B, A), B;
}(A);
new B, new A, new B;
diff --git a/crates/swc/tests/tsc-references/classAbstractFactoryFunction.1.normal.js b/crates/swc/tests/tsc-references/classAbstractFactoryFunction.1.normal.js
index a93bf68c94a..638d7235edc 100644
--- a/crates/swc/tests/tsc-references/classAbstractFactoryFunction.1.normal.js
+++ b/crates/swc/tests/tsc-references/classAbstractFactoryFunction.1.normal.js
@@ -1,7 +1,7 @@
//// [classAbstractFactoryFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -9,10 +9,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
diff --git a/crates/swc/tests/tsc-references/classAbstractFactoryFunction.2.minified.js b/crates/swc/tests/tsc-references/classAbstractFactoryFunction.2.minified.js
index dc6919376c0..91f61d4c779 100644
--- a/crates/swc/tests/tsc-references/classAbstractFactoryFunction.2.minified.js
+++ b/crates/swc/tests/tsc-references/classAbstractFactoryFunction.2.minified.js
@@ -1,15 +1,13 @@
//// [classAbstractFactoryFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
_class_call_check(this, A);
}, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B;
+ return _inherits(B, A), B;
}(A);
new A, new A, new B, new B;
diff --git a/crates/swc/tests/tsc-references/classAbstractInAModule.1.normal.js b/crates/swc/tests/tsc-references/classAbstractInAModule.1.normal.js
index 4a90206655b..c63e248ab1b 100644
--- a/crates/swc/tests/tsc-references/classAbstractInAModule.1.normal.js
+++ b/crates/swc/tests/tsc-references/classAbstractInAModule.1.normal.js
@@ -1,7 +1,7 @@
//// [classAbstractInAModule.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var M;
(function(M) {
var A = function A() {
@@ -12,10 +12,9 @@ var M;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
diff --git a/crates/swc/tests/tsc-references/classAbstractInAModule.2.minified.js b/crates/swc/tests/tsc-references/classAbstractInAModule.2.minified.js
index 5a01520d59e..08d41d2a972 100644
--- a/crates/swc/tests/tsc-references/classAbstractInAModule.2.minified.js
+++ b/crates/swc/tests/tsc-references/classAbstractInAModule.2.minified.js
@@ -1,15 +1,13 @@
//// [classAbstractInAModule.ts]
var M, M1, A, B;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
M1 = M || (M = {}), A = function A() {
_class_call_check(this, A);
}, M1.A = A, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B;
+ return _inherits(B, A), B;
}(A), M1.B = B, new M.A, new M.B;
diff --git a/crates/swc/tests/tsc-references/classAbstractInstantiations1.1.normal.js b/crates/swc/tests/tsc-references/classAbstractInstantiations1.1.normal.js
index 00ace31c9a4..8175fac0073 100644
--- a/crates/swc/tests/tsc-references/classAbstractInstantiations1.1.normal.js
+++ b/crates/swc/tests/tsc-references/classAbstractInstantiations1.1.normal.js
@@ -2,9 +2,9 @@
//
// Calling new with (non)abstract classes.
//
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -12,20 +12,18 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
diff --git a/crates/swc/tests/tsc-references/classAbstractInstantiations1.2.minified.js b/crates/swc/tests/tsc-references/classAbstractInstantiations1.2.minified.js
index 2c1935d093d..11d4125801d 100644
--- a/crates/swc/tests/tsc-references/classAbstractInstantiations1.2.minified.js
+++ b/crates/swc/tests/tsc-references/classAbstractInstantiations1.2.minified.js
@@ -1,22 +1,18 @@
//// [classAbstractInstantiations1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
_class_call_check(this, A);
}, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B;
+ return _inherits(B, A), B;
}(A), C = /*#__PURE__*/ function(B) {
- _inherits(C, B);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B), C;
}(B);
new A, new A(1), new B, new C, new B, new B, new B;
diff --git a/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js b/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js
index 108f97b208f..22a5eb11fb1 100644
--- a/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js
+++ b/crates/swc/tests/tsc-references/classAbstractSuperCalls.1.normal.js
@@ -1,9 +1,9 @@
//// [classAbstractSuperCalls.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -18,10 +18,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.bar = function bar() {
@@ -35,10 +34,9 @@ var B = /*#__PURE__*/ function(A) {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.foo = function foo() {
@@ -70,10 +68,9 @@ var AA = /*#__PURE__*/ function() {
var BB = /*#__PURE__*/ function(AA) {
"use strict";
_inherits(BB, AA);
- var _super = _create_super(BB);
function BB() {
_class_call_check(this, BB);
- return _super.apply(this, arguments);
+ return _call_super(this, BB, arguments);
}
return BB;
}(AA);
diff --git a/crates/swc/tests/tsc-references/classAbstractSuperCalls.2.minified.js b/crates/swc/tests/tsc-references/classAbstractSuperCalls.2.minified.js
index f3a1f3e7d55..670349306f5 100644
--- a/crates/swc/tests/tsc-references/classAbstractSuperCalls.2.minified.js
+++ b/crates/swc/tests/tsc-references/classAbstractSuperCalls.2.minified.js
@@ -1,6 +1,6 @@
//// [classAbstractSuperCalls.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.1.normal.js b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.1.normal.js
index d8da6393c18..05794898342 100644
--- a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.1.normal.js
+++ b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.1.normal.js
@@ -1,7 +1,7 @@
//// [classAbstractUsingAbstractMethod1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -9,10 +9,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.foo = function foo() {
@@ -23,10 +22,9 @@ var B = /*#__PURE__*/ function(A) {
var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C, A);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.2.minified.js b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.2.minified.js
index 262002f617f..26e2a21ff7b 100644
--- a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.2.minified.js
+++ b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethod1.2.minified.js
@@ -1,24 +1,20 @@
//// [classAbstractUsingAbstractMethod1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
_class_call_check(this, A);
}, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B.prototype.foo = function() {
+ return _inherits(B, A), B.prototype.foo = function() {
return 1;
}, B;
}(A), C = /*#__PURE__*/ function(A) {
- _inherits(C, A);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, A), C;
}(A), a = new B;
a.foo(), (a = new C).foo();
diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js
index a350ad2f801..f5a0e1e13ab 100644
--- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js
+++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js
@@ -2,11 +2,11 @@
/**
* @constructor
* @param {number} numberOxen
- */ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
+ */ import { _ as _call_super } from "@swc/helpers/_/_call_super";
+import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function Wagon(numberOxen) {
this.numberOxen = numberOxen;
}
@@ -24,11 +24,10 @@ Wagon.prototype.speed = function() {
var Sql = /*#__PURE__*/ function(Wagon) {
"use strict";
_inherits(Sql, Wagon);
- var _super = _create_super(Sql);
function Sql() {
_class_call_check(this, Sql);
var _this;
- _this = _super.call(this); // error: not enough arguments
+ _this = _call_super(this, Sql); // error: not enough arguments
_this.foonly = 12;
return _this;
}
@@ -55,19 +54,18 @@ db.numberOxen = db.foonly;
var Drakkhen = /*#__PURE__*/ function(Dragon1) {
"use strict";
_inherits(Drakkhen, Dragon1);
- var _super = _create_super(Drakkhen);
function Drakkhen() {
_class_call_check(this, Drakkhen);
- return _super.apply(this, arguments);
+ return _call_super(this, Drakkhen, arguments);
}
return Drakkhen;
}(Dragon);
//// [second.ts]
/**
* @constructor
- */ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
+ */ import { _ as _call_super } from "@swc/helpers/_/_call_super";
+import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function Dragon(numberEaten) {
this.numberEaten = numberEaten;
}
@@ -75,10 +73,9 @@ function Dragon(numberEaten) {
var Firedrake = /*#__PURE__*/ function(Dragon) {
"use strict";
_inherits(Firedrake, Dragon);
- var _super = _create_super(Firedrake);
function Firedrake() {
_class_call_check(this, Firedrake);
- return _super.call(this);
+ return _call_super(this, Firedrake);
}
return Firedrake;
}(Dragon);
@@ -86,12 +83,13 @@ var Firedrake = /*#__PURE__*/ function(Dragon) {
var Conestoga = /*#__PURE__*/ function(Wagon1) {
"use strict";
_inherits(Conestoga, Wagon1);
- var _super = _create_super(Conestoga);
function Conestoga(drunkOO) {
_class_call_check(this, Conestoga);
var _this;
// error: wrong type
- _this = _super.call(this, 'nope');
+ _this = _call_super(this, Conestoga, [
+ 'nope'
+ ]);
_this.drunkOO = drunkOO;
return _this;
}
@@ -108,19 +106,18 @@ c.numberOxen;
/**
* @template T
* @param {T} flavour
- */ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
+ */ import { _ as _call_super } from "@swc/helpers/_/_call_super";
+import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function Soup(flavour) {
this.flavour = flavour;
}
/** @extends {Soup<{ claim: "ignorant" | "malicious" }>} */ var Chowder = /*#__PURE__*/ function(Soup) {
"use strict";
_inherits(Chowder, Soup);
- var _super = _create_super(Chowder);
function Chowder() {
_class_call_check(this, Chowder);
- return _super.apply(this, arguments);
+ return _call_super(this, Chowder, arguments);
}
var _proto = Chowder.prototype;
_proto.log = function log() {
diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js
index b36105ce941..b8429897f5b 100644
--- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js
+++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js
@@ -1,9 +1,9 @@
//// [first.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function Wagon(numberOxen) {
this.numberOxen = numberOxen;
}
@@ -15,48 +15,44 @@ Wagon.circle = function(wagons) {
return this.numberOxen / this.weight();
};
var db = new /*#__PURE__*/ (function(Wagon) {
- _inherits(Sql, Wagon);
- var _super = _create_super(Sql);
function Sql() {
var _this;
- return _class_call_check(this, Sql), (_this = _super.call(this)).foonly = 12, _this;
+ return _class_call_check(this, Sql), (_this = _call_super(this, Sql)).foonly = 12, _this;
}
- return Sql.prototype.load = function(files, format) {
+ return _inherits(Sql, Wagon), Sql.prototype.load = function(files, format) {
if ("xmlolololol" === format) throw Error("please do not use XML. It was a joke.");
_get(_get_prototype_of(Sql.prototype), "speed", this).call(this), _get(_get_prototype_of(Sql.prototype), "weight", this).call(this);
}, Sql;
}(Wagon))();
db.numberOxen = db.foonly, /*#__PURE__*/ Dragon;
//// [second.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var c = new /*#__PURE__*/ (function(Wagon1) {
- _inherits(Conestoga, Wagon1);
- var _super = _create_super(Conestoga);
function Conestoga(drunkOO) {
var _this;
- return _class_call_check(this, Conestoga), (_this = _super.call(this, 'nope')).drunkOO = drunkOO, _this;
+ return _class_call_check(this, Conestoga), (_this = _call_super(this, Conestoga, [
+ 'nope'
+ ])).drunkOO = drunkOO, _this;
}
- return Conestoga.circle = function(others) {
+ return _inherits(Conestoga, Wagon1), Conestoga.circle = function(others) {
return others.length;
}, Conestoga;
}(Wagon))(!0);
c.drunkOO, c.numberOxen;
//// [generic.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function Soup(flavour) {
this.flavour = flavour;
}
var Chowder = /*#__PURE__*/ function(Soup) {
- _inherits(Chowder, Soup);
- var _super = _create_super(Chowder);
function Chowder() {
- return _class_call_check(this, Chowder), _super.apply(this, arguments);
+ return _class_call_check(this, Chowder), _call_super(this, Chowder, arguments);
}
- return Chowder.prototype.log = function() {
+ return _inherits(Chowder, Soup), Chowder.prototype.log = function() {
return this.flavour;
}, Chowder;
}(Soup);
diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js
index b9a603be442..a461c44f565 100644
--- a/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js
+++ b/crates/swc/tests/tsc-references/classConstructorAccessibility2.1.normal.js
@@ -1,7 +1,7 @@
//// [classConstructorAccessibility2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var BaseA = /*#__PURE__*/ function() {
"use strict";
function BaseA(x) {
@@ -44,11 +44,12 @@ var BaseC = /*#__PURE__*/ function() {
var DerivedA = /*#__PURE__*/ function(BaseA1) {
"use strict";
_inherits(DerivedA, BaseA1);
- var _super = _create_super(DerivedA);
function DerivedA(x) {
_class_call_check(this, DerivedA);
var _this;
- _this = _super.call(this, x);
+ _this = _call_super(this, DerivedA, [
+ x
+ ]);
_this.x = x;
return _this;
}
@@ -67,11 +68,12 @@ var DerivedA = /*#__PURE__*/ function(BaseA1) {
var DerivedB = /*#__PURE__*/ function(BaseB1) {
"use strict";
_inherits(DerivedB, BaseB1);
- var _super = _create_super(DerivedB);
function DerivedB(x) {
_class_call_check(this, DerivedB);
var _this;
- _this = _super.call(this, x);
+ _this = _call_super(this, DerivedB, [
+ x
+ ]);
_this.x = x;
return _this;
}
@@ -92,11 +94,12 @@ var DerivedB = /*#__PURE__*/ function(BaseB1) {
var DerivedC = /*#__PURE__*/ function(BaseC1) {
"use strict";
_inherits(DerivedC, BaseC1);
- var _super = _create_super(DerivedC);
function DerivedC(x) {
_class_call_check(this, DerivedC);
var _this;
- _this = _super.call(this, x);
+ _this = _call_super(this, DerivedC, [
+ x
+ ]);
_this.x = x;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility2.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility2.2.minified.js
index 8d7f3971b35..0111fde7a18 100644
--- a/crates/swc/tests/tsc-references/classConstructorAccessibility2.2.minified.js
+++ b/crates/swc/tests/tsc-references/classConstructorAccessibility2.2.minified.js
@@ -1,7 +1,7 @@
//// [classConstructorAccessibility2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var BaseA = /*#__PURE__*/ function() {
function BaseA(x) {
_class_call_check(this, BaseA), this.x = x;
@@ -26,12 +26,13 @@ var BaseA = /*#__PURE__*/ function() {
new BaseC(4);
}, BaseC;
}(), DerivedA = /*#__PURE__*/ function(BaseA1) {
- _inherits(DerivedA, BaseA1);
- var _super = _create_super(DerivedA);
function DerivedA(x) {
var _this;
- return _class_call_check(this, DerivedA), (_this = _super.call(this, x)).x = x, _this;
+ return _class_call_check(this, DerivedA), (_this = _call_super(this, DerivedA, [
+ x
+ ])).x = x, _this;
}
+ _inherits(DerivedA, BaseA1);
var _proto = DerivedA.prototype;
return _proto.createInstance = function() {
new DerivedA(5);
@@ -41,12 +42,13 @@ var BaseA = /*#__PURE__*/ function() {
new BaseA(7);
}, DerivedA;
}(BaseA), DerivedB = /*#__PURE__*/ function(BaseB1) {
- _inherits(DerivedB, BaseB1);
- var _super = _create_super(DerivedB);
function DerivedB(x) {
var _this;
- return _class_call_check(this, DerivedB), (_this = _super.call(this, x)).x = x, _this;
+ return _class_call_check(this, DerivedB), (_this = _call_super(this, DerivedB, [
+ x
+ ])).x = x, _this;
}
+ _inherits(DerivedB, BaseB1);
var _proto = DerivedB.prototype;
return _proto.createInstance = function() {
new DerivedB(7);
@@ -56,12 +58,13 @@ var BaseA = /*#__PURE__*/ function() {
new BaseB(9);
}, DerivedB;
}(BaseB), DerivedC = /*#__PURE__*/ function(BaseC1) {
- _inherits(DerivedC, BaseC1);
- var _super = _create_super(DerivedC);
function DerivedC(x) {
var _this;
- return _class_call_check(this, DerivedC), (_this = _super.call(this, x)).x = x, _this;
+ return _class_call_check(this, DerivedC), (_this = _call_super(this, DerivedC, [
+ x
+ ])).x = x, _this;
}
+ _inherits(DerivedC, BaseC1);
var _proto = DerivedC.prototype;
return _proto.createInstance = function() {
new DerivedC(9);
diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility4.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility4.1.normal.js
index 0ba92782a21..526551c157b 100644
--- a/crates/swc/tests/tsc-references/classConstructorAccessibility4.1.normal.js
+++ b/crates/swc/tests/tsc-references/classConstructorAccessibility4.1.normal.js
@@ -1,7 +1,7 @@
//// [classConstructorAccessibility4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -21,10 +21,9 @@ var A = /*#__PURE__*/ function() {
}();
var C = /*#__PURE__*/ function(A) {
_inherits(C, A);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
@@ -50,10 +49,9 @@ var D = /*#__PURE__*/ function() {
}();
var F = /*#__PURE__*/ function(D) {
_inherits(F, D);
- var _super = _create_super(F);
function F() {
_class_call_check(this, F);
- return _super.apply(this, arguments);
+ return _call_super(this, F, arguments);
}
return F;
}(D);
diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility4.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility4.2.minified.js
index 4030386f9ba..ac23b8b8910 100644
--- a/crates/swc/tests/tsc-references/classConstructorAccessibility4.2.minified.js
+++ b/crates/swc/tests/tsc-references/classConstructorAccessibility4.2.minified.js
@@ -1,4 +1,4 @@
//// [classConstructorAccessibility4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js b/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js
index dac40555874..b49a5d3863f 100644
--- a/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js
+++ b/crates/swc/tests/tsc-references/classConstructorAccessibility5.1.normal.js
@@ -1,7 +1,7 @@
//// [classConstructorAccessibility5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Derived, Base1);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
Derived.make = function make() {
new Base();
diff --git a/crates/swc/tests/tsc-references/classConstructorAccessibility5.2.minified.js b/crates/swc/tests/tsc-references/classConstructorAccessibility5.2.minified.js
index 71c04359d73..f44cf9b1977 100644
--- a/crates/swc/tests/tsc-references/classConstructorAccessibility5.2.minified.js
+++ b/crates/swc/tests/tsc-references/classConstructorAccessibility5.2.minified.js
@@ -1,4 +1,4 @@
//// [classConstructorAccessibility5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js
index a98ad4e9f8d..d9b53accdc1 100644
--- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js
+++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.1.normal.js
@@ -1,7 +1,7 @@
//// [classConstructorParametersAccessibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = function C1(x) {
"use strict";
_class_call_check(this, C1);
@@ -29,11 +29,12 @@ c3.p // protected, error
var Derived = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(Derived, C3);
- var _super = _create_super(Derived);
function Derived(p) {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this, p);
+ _this = _call_super(this, Derived, [
+ p
+ ]);
_this.p; // OK
return _this;
}
diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.2.minified.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.2.minified.js
index 15652b247e9..b2b958fe844 100644
--- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.2.minified.js
+++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility.2.minified.js
@@ -1,6 +1,6 @@
//// [classConstructorParametersAccessibility.ts]
var c1, c2;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
c1.x, c2.p, (void 0).p;
diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js
index d4cbfc9cb7f..75a4caccedd 100644
--- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js
+++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.1.normal.js
@@ -1,7 +1,7 @@
//// [classConstructorParametersAccessibility2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = function C1(x) {
"use strict";
_class_call_check(this, C1);
@@ -29,11 +29,12 @@ c3.p // protected, error
var Derived = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(Derived, C3);
- var _super = _create_super(Derived);
function Derived(p) {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this, p);
+ _this = _call_super(this, Derived, [
+ p
+ ]);
_this.p; // OK
return _this;
}
diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.2.minified.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.2.minified.js
index ffc1bf8e527..6057ae817db 100644
--- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.2.minified.js
+++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility2.2.minified.js
@@ -1,6 +1,6 @@
//// [classConstructorParametersAccessibility2.ts]
var c1, c2;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
c1.x, c2.p, (void 0).p;
diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.1.normal.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.1.normal.js
index 8aef88b6303..81096b52fcc 100644
--- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.1.normal.js
+++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.1.normal.js
@@ -1,7 +1,7 @@
//// [classConstructorParametersAccessibility3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(p) {
"use strict";
_class_call_check(this, Base);
@@ -10,11 +10,12 @@ var Base = function Base(p) {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(p) {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this, p);
+ _this = _call_super(this, Derived, [
+ p
+ ]);
_this.p = p;
_this.p; // OK
return _this;
diff --git a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.2.minified.js b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.2.minified.js
index 7914b3d24b0..24763d247fb 100644
--- a/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.2.minified.js
+++ b/crates/swc/tests/tsc-references/classConstructorParametersAccessibility3.2.minified.js
@@ -1,5 +1,5 @@
//// [classConstructorParametersAccessibility3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(void 0).p;
diff --git a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.1.normal.js b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.1.normal.js
index 26779a76749..506162cdc09 100644
--- a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.1.normal.js
+++ b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.1.normal.js
@@ -1,7 +1,7 @@
//// [classDoesNotDependOnBaseTypes.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var StringTreeCollectionBase = function StringTreeCollectionBase() {
"use strict";
_class_call_check(this, StringTreeCollectionBase);
@@ -9,10 +9,9 @@ var StringTreeCollectionBase = function StringTreeCollectionBase() {
var StringTreeCollection = /*#__PURE__*/ function(StringTreeCollectionBase) {
"use strict";
_inherits(StringTreeCollection, StringTreeCollectionBase);
- var _super = _create_super(StringTreeCollection);
function StringTreeCollection() {
_class_call_check(this, StringTreeCollection);
- return _super.apply(this, arguments);
+ return _call_super(this, StringTreeCollection, arguments);
}
return StringTreeCollection;
}(StringTreeCollectionBase);
diff --git a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.2.minified.js b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.2.minified.js
index 540e60cf4fc..84c8c4d964f 100644
--- a/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.2.minified.js
+++ b/crates/swc/tests/tsc-references/classDoesNotDependOnBaseTypes.2.minified.js
@@ -1,14 +1,12 @@
//// [classDoesNotDependOnBaseTypes.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x, StringTreeCollection = /*#__PURE__*/ function(StringTreeCollectionBase) {
- _inherits(StringTreeCollection, StringTreeCollectionBase);
- var _super = _create_super(StringTreeCollection);
function StringTreeCollection() {
- return _class_call_check(this, StringTreeCollection), _super.apply(this, arguments);
+ return _class_call_check(this, StringTreeCollection), _call_super(this, StringTreeCollection, arguments);
}
- return StringTreeCollection;
+ return _inherits(StringTreeCollection, StringTreeCollectionBase), StringTreeCollection;
}(function StringTreeCollectionBase() {
_class_call_check(this, StringTreeCollectionBase);
});
diff --git a/crates/swc/tests/tsc-references/classExpression2.1.normal.js b/crates/swc/tests/tsc-references/classExpression2.1.normal.js
index e87b9d62deb..fef225462fc 100644
--- a/crates/swc/tests/tsc-references/classExpression2.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExpression2.1.normal.js
@@ -1,7 +1,7 @@
//// [classExpression2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var D = function D() {
"use strict";
_class_call_check(this, D);
@@ -9,10 +9,9 @@ var D = function D() {
var v = /*#__PURE__*/ function(D) {
"use strict";
_inherits(C, D);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(D);
diff --git a/crates/swc/tests/tsc-references/classExpression2.2.minified.js b/crates/swc/tests/tsc-references/classExpression2.2.minified.js
index 584d3b09acf..f24fd62c8e9 100644
--- a/crates/swc/tests/tsc-references/classExpression2.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExpression2.2.minified.js
@@ -1,4 +1,4 @@
//// [classExpression2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classExpression3.1.normal.js b/crates/swc/tests/tsc-references/classExpression3.1.normal.js
index e3dabe341a0..7fd4fd14775 100644
--- a/crates/swc/tests/tsc-references/classExpression3.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExpression3.1.normal.js
@@ -1,15 +1,14 @@
//// [classExpression3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C, _superClass);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, C, arguments);
_this.c = 3;
return _this;
}
@@ -17,11 +16,10 @@ var C = /*#__PURE__*/ function(_superClass) {
}(/*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(_class, _superClass);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, _class, arguments);
_this.b = 2;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/classExpression3.2.minified.js b/crates/swc/tests/tsc-references/classExpression3.2.minified.js
index 2ba6111417d..d5857ec6ae8 100644
--- a/crates/swc/tests/tsc-references/classExpression3.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExpression3.2.minified.js
@@ -1,23 +1,19 @@
//// [classExpression3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var c = new /*#__PURE__*/ (function(_superClass) {
- _inherits(C, _superClass);
- var _super = _create_super(C);
function C() {
var _this;
- return _class_call_check(this, C), _this = _super.apply(this, arguments), _this.c = 3, _this;
+ return _class_call_check(this, C), _this = _call_super(this, C, arguments), _this.c = 3, _this;
}
- return C;
+ return _inherits(C, _superClass), C;
}(/*#__PURE__*/ function(_superClass) {
- _inherits(_class, _superClass);
- var _super = _create_super(_class);
function _class() {
var _this;
- return _class_call_check(this, _class), _this = _super.apply(this, arguments), _this.b = 2, _this;
+ return _class_call_check(this, _class), _this = _call_super(this, _class, arguments), _this.b = 2, _this;
}
- return _class;
+ return _inherits(_class, _superClass), _class;
}(function _class() {
_class_call_check(this, _class), this.a = 1;
})))();
diff --git a/crates/swc/tests/tsc-references/classExtendingBuiltinType.1.normal.js b/crates/swc/tests/tsc-references/classExtendingBuiltinType.1.normal.js
index f57e11bce7e..db7393b96ad 100644
--- a/crates/swc/tests/tsc-references/classExtendingBuiltinType.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendingBuiltinType.1.normal.js
@@ -1,105 +1,95 @@
//// [classExtendingBuiltinType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = /*#__PURE__*/ function(Object1) {
"use strict";
_inherits(C1, Object1);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
- return _super.apply(this, arguments);
+ return _call_super(this, C1, arguments);
}
return C1;
}(_wrap_native_super(Object));
var C2 = /*#__PURE__*/ function(Function1) {
"use strict";
_inherits(C2, Function1);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(_wrap_native_super(Function));
var C3 = /*#__PURE__*/ function(String1) {
"use strict";
_inherits(C3, String1);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
- return _super.apply(this, arguments);
+ return _call_super(this, C3, arguments);
}
return C3;
}(_wrap_native_super(String));
var C4 = /*#__PURE__*/ function(Boolean1) {
"use strict";
_inherits(C4, Boolean1);
- var _super = _create_super(C4);
function C4() {
_class_call_check(this, C4);
- return _super.apply(this, arguments);
+ return _call_super(this, C4, arguments);
}
return C4;
}(_wrap_native_super(Boolean));
var C5 = /*#__PURE__*/ function(Number1) {
"use strict";
_inherits(C5, Number1);
- var _super = _create_super(C5);
function C5() {
_class_call_check(this, C5);
- return _super.apply(this, arguments);
+ return _call_super(this, C5, arguments);
}
return C5;
}(_wrap_native_super(Number));
var C6 = /*#__PURE__*/ function(Date1) {
"use strict";
_inherits(C6, Date1);
- var _super = _create_super(C6);
function C6() {
_class_call_check(this, C6);
- return _super.apply(this, arguments);
+ return _call_super(this, C6, arguments);
}
return C6;
}(_wrap_native_super(Date));
var C7 = /*#__PURE__*/ function(RegExp1) {
"use strict";
_inherits(C7, RegExp1);
- var _super = _create_super(C7);
function C7() {
_class_call_check(this, C7);
- return _super.apply(this, arguments);
+ return _call_super(this, C7, arguments);
}
return C7;
}(_wrap_native_super(RegExp));
var C8 = /*#__PURE__*/ function(Error1) {
"use strict";
_inherits(C8, Error1);
- var _super = _create_super(C8);
function C8() {
_class_call_check(this, C8);
- return _super.apply(this, arguments);
+ return _call_super(this, C8, arguments);
}
return C8;
}(_wrap_native_super(Error));
var C9 = /*#__PURE__*/ function(Array1) {
"use strict";
_inherits(C9, Array1);
- var _super = _create_super(C9);
function C9() {
_class_call_check(this, C9);
- return _super.apply(this, arguments);
+ return _call_super(this, C9, arguments);
}
return C9;
}(_wrap_native_super(Array));
var C10 = /*#__PURE__*/ function(Array1) {
"use strict";
_inherits(C10, Array1);
- var _super = _create_super(C10);
function C10() {
_class_call_check(this, C10);
- return _super.apply(this, arguments);
+ return _call_super(this, C10, arguments);
}
return C10;
}(_wrap_native_super(Array));
diff --git a/crates/swc/tests/tsc-references/classExtendingBuiltinType.2.minified.js b/crates/swc/tests/tsc-references/classExtendingBuiltinType.2.minified.js
index 1ec2a9aee21..34087c3959e 100644
--- a/crates/swc/tests/tsc-references/classExtendingBuiltinType.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendingBuiltinType.2.minified.js
@@ -1,6 +1,6 @@
//// [classExtendingBuiltinType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ _wrap_native_super(Object), /*#__PURE__*/ _wrap_native_super(Function), /*#__PURE__*/ _wrap_native_super(String), /*#__PURE__*/ _wrap_native_super(Boolean), /*#__PURE__*/ _wrap_native_super(Number), /*#__PURE__*/ _wrap_native_super(Date), /*#__PURE__*/ _wrap_native_super(RegExp), /*#__PURE__*/ _wrap_native_super(Error), /*#__PURE__*/ _wrap_native_super(Array), /*#__PURE__*/ _wrap_native_super(Array);
diff --git a/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js b/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js
index 29d274a729d..a1fa6b482f9 100644
--- a/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js
@@ -1,7 +1,7 @@
//// [classExtendingClass.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -15,10 +15,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
@@ -40,10 +39,9 @@ var C2 = /*#__PURE__*/ function() {
var D2 = /*#__PURE__*/ function(C2) {
"use strict";
_inherits(D2, C2);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(C2);
diff --git a/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js b/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js
index 7f27c6e9b56..985a6769df3 100644
--- a/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js
@@ -1,14 +1,12 @@
//// [classExtendingClass.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var d, d2, D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(/*#__PURE__*/ function() {
function C() {
_class_call_check(this, C);
@@ -17,12 +15,10 @@ var d, d2, D = /*#__PURE__*/ function(C) {
}());
d.foo, d.bar, d.thing(), D.other();
var D2 = /*#__PURE__*/ function(C2) {
- _inherits(D2, C2);
- var _super = _create_super(D2);
function D2() {
- return _class_call_check(this, D2), _super.apply(this, arguments);
+ return _class_call_check(this, D2), _call_super(this, D2, arguments);
}
- return D2;
+ return _inherits(D2, C2), D2;
}(/*#__PURE__*/ function() {
function C2() {
_class_call_check(this, C2);
diff --git a/crates/swc/tests/tsc-references/classExtendingClassLikeType.1.normal.js b/crates/swc/tests/tsc-references/classExtendingClassLikeType.1.normal.js
index d55e9c23851..891bd8e0af5 100644
--- a/crates/swc/tests/tsc-references/classExtendingClassLikeType.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendingClassLikeType.1.normal.js
@@ -1,26 +1,27 @@
//// [classExtendingClassLikeType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
// Error, no Base constructor function
var D0 = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(D0, Base1);
- var _super = _create_super(D0);
function D0() {
_class_call_check(this, D0);
- return _super.apply(this, arguments);
+ return _call_super(this, D0, arguments);
}
return D0;
}(Base);
var D1 = /*#__PURE__*/ function(_getBase) {
"use strict";
_inherits(D1, _getBase);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
var _this;
- _this = _super.call(this, "abc", "def");
+ _this = _call_super(this, D1, [
+ "abc",
+ "def"
+ ]);
_this.x = "x";
_this.y = "y";
return _this;
@@ -30,12 +31,16 @@ var D1 = /*#__PURE__*/ function(_getBase) {
var D2 = /*#__PURE__*/ function(_getBase) {
"use strict";
_inherits(D2, _getBase);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
var _this;
- _this = _super.call(this, 10);
- _this = _super.call(this, 10, 20);
+ _this = _call_super(this, D2, [
+ 10
+ ]);
+ _this = _call_super(this, D2, [
+ 10,
+ 20
+ ]);
_this.x = 1;
_this.y = 2;
return _this;
@@ -45,11 +50,13 @@ var D2 = /*#__PURE__*/ function(_getBase) {
var D3 = /*#__PURE__*/ function(_getBase) {
"use strict";
_inherits(D3, _getBase);
- var _super = _create_super(D3);
function D3() {
_class_call_check(this, D3);
var _this;
- _this = _super.call(this, "abc", 42);
+ _this = _call_super(this, D3, [
+ "abc",
+ 42
+ ]);
_this.x = "x";
_this.y = 2;
return _this;
@@ -60,10 +67,9 @@ var D3 = /*#__PURE__*/ function(_getBase) {
var D4 = /*#__PURE__*/ function(_getBase) {
"use strict";
_inherits(D4, _getBase);
- var _super = _create_super(D4);
function D4() {
_class_call_check(this, D4);
- return _super.apply(this, arguments);
+ return _call_super(this, D4, arguments);
}
return D4;
}(getBase());
@@ -71,10 +77,9 @@ var D4 = /*#__PURE__*/ function(_getBase) {
var D5 = /*#__PURE__*/ function(_getBadBase) {
"use strict";
_inherits(D5, _getBadBase);
- var _super = _create_super(D5);
function D5() {
_class_call_check(this, D5);
- return _super.apply(this, arguments);
+ return _call_super(this, D5, arguments);
}
return D5;
}(getBadBase());
diff --git a/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js b/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js
index ef233992349..c500326fa13 100644
--- a/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js
@@ -1,5 +1,5 @@
//// [classExtendingClassLikeType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ Base, /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBadBase();
diff --git a/crates/swc/tests/tsc-references/classExtendingNonConstructor.1.normal.js b/crates/swc/tests/tsc-references/classExtendingNonConstructor.1.normal.js
index 513421a46c9..973410a9ffa 100644
--- a/crates/swc/tests/tsc-references/classExtendingNonConstructor.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendingNonConstructor.1.normal.js
@@ -1,7 +1,7 @@
//// [classExtendingNonConstructor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x;
function foo() {
this.x = 1;
@@ -9,70 +9,63 @@ function foo() {
var C1 = /*#__PURE__*/ function(undefined1) {
"use strict";
_inherits(C1, undefined1);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
- return _super.apply(this, arguments);
+ return _call_super(this, C1, arguments);
}
return C1;
}(undefined);
var C2 = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C2, _superClass);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(true);
var C3 = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C3, _superClass);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
- return _super.apply(this, arguments);
+ return _call_super(this, C3, arguments);
}
return C3;
}(false);
var C4 = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C4, _superClass);
- var _super = _create_super(C4);
function C4() {
_class_call_check(this, C4);
- return _super.apply(this, arguments);
+ return _call_super(this, C4, arguments);
}
return C4;
}(42);
var C5 = /*#__PURE__*/ function(_hello) {
"use strict";
_inherits(C5, _hello);
- var _super = _create_super(C5);
function C5() {
_class_call_check(this, C5);
- return _super.apply(this, arguments);
+ return _call_super(this, C5, arguments);
}
return C5;
}("hello");
var C6 = /*#__PURE__*/ function(x) {
"use strict";
_inherits(C6, x);
- var _super = _create_super(C6);
function C6() {
_class_call_check(this, C6);
- return _super.apply(this, arguments);
+ return _call_super(this, C6, arguments);
}
return C6;
}(x);
var C7 = /*#__PURE__*/ function(foo) {
"use strict";
_inherits(C7, foo);
- var _super = _create_super(C7);
function C7() {
_class_call_check(this, C7);
- return _super.apply(this, arguments);
+ return _call_super(this, C7, arguments);
}
return C7;
}(foo);
diff --git a/crates/swc/tests/tsc-references/classExtendingNonConstructor.2.minified.js b/crates/swc/tests/tsc-references/classExtendingNonConstructor.2.minified.js
index b55c42dc8ec..b3b4767b1d7 100644
--- a/crates/swc/tests/tsc-references/classExtendingNonConstructor.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendingNonConstructor.2.minified.js
@@ -1,4 +1,4 @@
//// [classExtendingNonConstructor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classExtendingNull.1.normal.js b/crates/swc/tests/tsc-references/classExtendingNull.1.normal.js
index 9586a001053..5d30239ac46 100644
--- a/crates/swc/tests/tsc-references/classExtendingNull.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendingNull.1.normal.js
@@ -1,35 +1,32 @@
//// [classExtendingNull.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C1, _superClass);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
- return _super.apply(this, arguments);
+ return _call_super(this, C1, arguments);
}
return C1;
}(null);
var C2 = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C2, _superClass);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(null);
var C3 = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C3, _superClass);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, C3, arguments);
_this.x = 1;
return _this;
}
@@ -38,11 +35,10 @@ var C3 = /*#__PURE__*/ function(_superClass) {
var C4 = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(C4, _superClass);
- var _super = _create_super(C4);
function C4() {
_class_call_check(this, C4);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, C4, arguments);
_this.x = 1;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/classExtendingNull.2.minified.js b/crates/swc/tests/tsc-references/classExtendingNull.2.minified.js
index 2a5edf65560..4098395951a 100644
--- a/crates/swc/tests/tsc-references/classExtendingNull.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendingNull.2.minified.js
@@ -1,4 +1,4 @@
//// [classExtendingNull.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classExtendsItself.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItself.1.normal.js
index 171fd7027f4..6eb1b93ad2f 100644
--- a/crates/swc/tests/tsc-references/classExtendsItself.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendsItself.1.normal.js
@@ -1,14 +1,13 @@
//// [classExtendsItself.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _$C = /*#__PURE__*/ function(C) {
"use strict";
_inherits(C1, C);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
- return _super.apply(this, arguments);
+ return _call_super(this, C1, arguments);
}
return C1;
} // error
@@ -16,10 +15,9 @@ var _$C = /*#__PURE__*/ function(C) {
var _$D = /*#__PURE__*/ function(D) {
"use strict";
_inherits(D1, D);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
} // error
@@ -27,10 +25,9 @@ var _$D = /*#__PURE__*/ function(D) {
var _$E = /*#__PURE__*/ function(E) {
"use strict";
_inherits(E1, E);
- var _super = _create_super(E1);
function E1() {
_class_call_check(this, E1);
- return _super.apply(this, arguments);
+ return _call_super(this, E1, arguments);
}
return E1;
} // error
diff --git a/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js
index ed11ca6ca16..7373ffbf08f 100644
--- a/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js
@@ -1,5 +1,5 @@
//// [classExtendsItself.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ C1, /*#__PURE__*/ D1, /*#__PURE__*/ E1;
diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.1.normal.js
index 3d1c02c7914..5b7dd1c3019 100644
--- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.1.normal.js
@@ -1,14 +1,13 @@
//// [classExtendsItselfIndirectly.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(E) {
"use strict";
_inherits(C, E);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
} // error
@@ -16,30 +15,27 @@ var C = /*#__PURE__*/ function(E) {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
return E;
}(D);
var C2 = /*#__PURE__*/ function(E2) {
"use strict";
_inherits(C2, E2);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
} // error
@@ -47,20 +43,18 @@ var C2 = /*#__PURE__*/ function(E2) {
var D2 = /*#__PURE__*/ function(C2) {
"use strict";
_inherits(D2, C2);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(C2);
var E2 = /*#__PURE__*/ function(D2) {
"use strict";
_inherits(E2, D2);
- var _super = _create_super(E2);
function E2() {
_class_call_check(this, E2);
- return _super.apply(this, arguments);
+ return _call_super(this, E2, arguments);
}
return E2;
}(D2);
diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.2.minified.js
index c90694038b5..79d1bb0b754 100644
--- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly.2.minified.js
@@ -1,47 +1,35 @@
//// [classExtendsItselfIndirectly.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var E = /*#__PURE__*/ function(D) {
- _inherits(E, D);
- var _super = _create_super(E);
function E() {
- return _class_call_check(this, E), _super.apply(this, arguments);
+ return _class_call_check(this, E), _call_super(this, E, arguments);
}
- return E;
+ return _inherits(E, D), E;
}(/*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(/*#__PURE__*/ function(E) {
- _inherits(C, E);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, E), C;
}(E))), E2 = /*#__PURE__*/ function(D2) {
- _inherits(E2, D2);
- var _super = _create_super(E2);
function E2() {
- return _class_call_check(this, E2), _super.apply(this, arguments);
+ return _class_call_check(this, E2), _call_super(this, E2, arguments);
}
- return E2;
+ return _inherits(E2, D2), E2;
}(/*#__PURE__*/ function(C2) {
- _inherits(D2, C2);
- var _super = _create_super(D2);
function D2() {
- return _class_call_check(this, D2), _super.apply(this, arguments);
+ return _class_call_check(this, D2), _call_super(this, D2, arguments);
}
- return D2;
+ return _inherits(D2, C2), D2;
}(/*#__PURE__*/ function(E2) {
- _inherits(C2, E2);
- var _super = _create_super(C2);
function C2() {
- return _class_call_check(this, C2), _super.apply(this, arguments);
+ return _class_call_check(this, C2), _call_super(this, C2, arguments);
}
- return C2;
+ return _inherits(C2, E2), C2;
}(E2)));
diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.1.normal.js
index 8943d322eaa..4c0dca86c83 100644
--- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.1.normal.js
@@ -1,14 +1,13 @@
//// [classExtendsItselfIndirectly2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(_N_E) {
"use strict";
_inherits(C, _N_E);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
} // error
@@ -18,10 +17,9 @@ var M;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
@@ -32,10 +30,9 @@ var N;
var E = /*#__PURE__*/ function(_M_D) {
"use strict";
_inherits(E, _M_D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
return E;
}(M.D);
@@ -46,10 +43,9 @@ var O;
var C2 = /*#__PURE__*/ function(_Q_E2) {
"use strict";
_inherits(C2, _Q_E2);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
} // error
@@ -59,10 +55,9 @@ var O;
var D2 = /*#__PURE__*/ function(C2) {
"use strict";
_inherits(D2, C2);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(C2);
@@ -73,10 +68,9 @@ var O;
var E2 = /*#__PURE__*/ function(_P_D2) {
"use strict";
_inherits(E2, _P_D2);
- var _super = _create_super(E2);
function E2() {
_class_call_check(this, E2);
- return _super.apply(this, arguments);
+ return _call_super(this, E2, arguments);
}
return E2;
}(P.D2);
diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js
index 4d8a9a9d82d..4da613ce9aa 100644
--- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js
@@ -1,48 +1,36 @@
//// [classExtendsItselfIndirectly2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var M, D, N, E, P, Q, C2, P1, D2, Q1, E2, M1, N1, O, C = /*#__PURE__*/ function(_N_E) {
- _inherits(C, _N_E);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, _N_E), C;
}(N1.E);
M = M1 || (M1 = {}), D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C), M.D = D, N = N1 || (N1 = {}), E = /*#__PURE__*/ function(_M_D) {
- _inherits(E, _M_D);
- var _super = _create_super(E);
function E() {
- return _class_call_check(this, E), _super.apply(this, arguments);
+ return _class_call_check(this, E), _call_super(this, E, arguments);
}
- return E;
+ return _inherits(E, _M_D), E;
}(M1.D), N.E = E, O || (O = {}), C2 = /*#__PURE__*/ function(_Q_E2) {
- _inherits(C2, _Q_E2);
- var _super = _create_super(C2);
function C2() {
- return _class_call_check(this, C2), _super.apply(this, arguments);
+ return _class_call_check(this, C2), _call_super(this, C2, arguments);
}
- return C2;
+ return _inherits(C2, _Q_E2), C2;
}(Q.E2), P1 = P || (P = {}), D2 = /*#__PURE__*/ function(C2) {
- _inherits(D2, C2);
- var _super = _create_super(D2);
function D2() {
- return _class_call_check(this, D2), _super.apply(this, arguments);
+ return _class_call_check(this, D2), _call_super(this, D2, arguments);
}
- return D2;
+ return _inherits(D2, C2), D2;
}(C2), P1.D2 = D2, Q1 = Q || (Q = {}), E2 = /*#__PURE__*/ function(_P_D2) {
- _inherits(E2, _P_D2);
- var _super = _create_super(E2);
function E2() {
- return _class_call_check(this, E2), _super.apply(this, arguments);
+ return _class_call_check(this, E2), _call_super(this, E2, arguments);
}
- return E2;
+ return _inherits(E2, _P_D2), E2;
}(P.D2), Q1.E2 = E2;
diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.1.normal.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.1.normal.js
index b868c773507..cc3a9677479 100644
--- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.1.normal.js
@@ -1,86 +1,80 @@
//// [classExtendsItselfIndirectly_file1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(E1) {
"use strict";
_inherits(C, E1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
} // error
(E);
//// [classExtendsItselfIndirectly_file2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var D = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(D, C1);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
//// [classExtendsItselfIndirectly_file3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var E = /*#__PURE__*/ function(D1) {
"use strict";
_inherits(E, D1);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
return E;
}(D);
//// [classExtendsItselfIndirectly_file4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C2 = /*#__PURE__*/ function(E21) {
"use strict";
_inherits(C2, E21);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
} // error
(E2);
//// [classExtendsItselfIndirectly_file5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var D2 = /*#__PURE__*/ function(C21) {
"use strict";
_inherits(D2, C21);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(C2);
//// [classExtendsItselfIndirectly_file6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var E2 = /*#__PURE__*/ function(D21) {
"use strict";
_inherits(E2, D21);
- var _super = _create_super(E2);
function E2() {
_class_call_check(this, E2);
- return _super.apply(this, arguments);
+ return _call_super(this, E2, arguments);
}
return E2;
}(D2);
diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js
index e5abd36304b..1d7b0b91fae 100644
--- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js
@@ -1,30 +1,30 @@
//// [classExtendsItselfIndirectly_file1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ E;
//// [classExtendsItselfIndirectly_file2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ C;
//// [classExtendsItselfIndirectly_file3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ D;
//// [classExtendsItselfIndirectly_file4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ E2;
//// [classExtendsItselfIndirectly_file5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ C2;
//// [classExtendsItselfIndirectly_file6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ D2;
diff --git a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.1.normal.js b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.1.normal.js
index 523051168fb..278a853deac 100644
--- a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.1.normal.js
@@ -1,7 +1,7 @@
//// [classExtendsShadowedConstructorFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -12,10 +12,9 @@ var M;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.2.minified.js b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.2.minified.js
index 4a58207d812..2d3f3b2f413 100644
--- a/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendsShadowedConstructorFunction.2.minified.js
@@ -1,6 +1,6 @@
//// [classExtendsShadowedConstructorFunction.ts]
var M;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
M || (M = {});
diff --git a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.1.normal.js b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.1.normal.js
index e39c73a78f4..2015fd45c8b 100644
--- a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.1.normal.js
+++ b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.1.normal.js
@@ -1,16 +1,15 @@
//// [classExtendsValidConstructorFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function foo() {}
var x = new foo(); // can be used as a constructor function
var C = /*#__PURE__*/ function(foo) {
"use strict";
_inherits(C, foo);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
} // error, cannot extend it though
diff --git a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.2.minified.js b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.2.minified.js
index 43f28b1e9ac..97be59078f2 100644
--- a/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.2.minified.js
+++ b/crates/swc/tests/tsc-references/classExtendsValidConstructorFunction.2.minified.js
@@ -1,4 +1,4 @@
//// [classExtendsValidConstructorFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.1.normal.js b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.1.normal.js
index 9ec42123faa..8ebce4a2481 100644
--- a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.1.normal.js
+++ b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.1.normal.js
@@ -1,7 +1,7 @@
//// [classIsSubtypeOfBaseType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,20 +9,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.2.minified.js b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.2.minified.js
index 74a7bf89a73..b6006cef3b3 100644
--- a/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.2.minified.js
+++ b/crates/swc/tests/tsc-references/classIsSubtypeOfBaseType.2.minified.js
@@ -1,4 +1,4 @@
//// [classIsSubtypeOfBaseType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).1.normal.js b/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).1.normal.js
index c8b61bcd791..9074b64f264 100644
--- a/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).1.normal.js
@@ -1,9 +1,9 @@
//// [classStaticBlock5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
"use strict";
_class_call_check(this, B);
@@ -13,10 +13,9 @@ B.b = 2;
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
diff --git a/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).2.minified.js b/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).2.minified.js
index 0fc532419fe..2de362e4526 100644
--- a/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/classStaticBlock5(target=es5).2.minified.js
@@ -1,19 +1,17 @@
//// [classStaticBlock5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
_class_call_check(this, B);
};
B.a = 1, B.b = 2;
var C = /*#__PURE__*/ function(B) {
- _inherits(C, B);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B), C;
}(B);
C.b = 3, C.c = _get(_get_prototype_of(C), "a", C), C.b, _get(_get_prototype_of(C), "b", C), _get(_get_prototype_of(C), "a", C);
diff --git a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.1.normal.js b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.1.normal.js
index 28a7514cc10..638de34c67f 100644
--- a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.1.normal.js
+++ b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.1.normal.js
@@ -1,7 +1,7 @@
//// [classWithBaseClassButNoConstructor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x) {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base(x) {
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(Base);
@@ -26,10 +25,9 @@ var Base2 = function Base2(x) {
var D = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D, Base2);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(Base2);
@@ -40,10 +38,9 @@ var d2 = new D(1); // ok
var D2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D2, Base2);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(Base2);
@@ -53,10 +50,9 @@ var d4 = new D(1); // ok
var D3 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D3, Base2);
- var _super = _create_super(D3);
function D3() {
_class_call_check(this, D3);
- return _super.apply(this, arguments);
+ return _call_super(this, D3, arguments);
}
return D3;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.2.minified.js b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.2.minified.js
index 863bf5a5ac3..7faa4deb7f0 100644
--- a/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.2.minified.js
+++ b/crates/swc/tests/tsc-references/classWithBaseClassButNoConstructor.2.minified.js
@@ -1,25 +1,21 @@
//// [classWithBaseClassButNoConstructor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(Base) {
- _inherits(C, Base);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, Base), C;
}(function Base(x) {
_class_call_check(this, Base);
});
new C(), new C(1);
var D = /*#__PURE__*/ function(Base2) {
- _inherits(D, Base2);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, Base2), D;
}(function Base2(x) {
_class_call_check(this, Base2);
});
diff --git a/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js b/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js
index 112eee77881..fe026c67f62 100644
--- a/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js
+++ b/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js
@@ -1,7 +1,7 @@
//// [classWithConstructors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var NonGeneric;
(function(NonGeneric) {
var C = function C(x) {
@@ -20,10 +20,9 @@ var NonGeneric;
var D = /*#__PURE__*/ function(C2) {
"use strict";
_inherits(D, C2);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C2);
@@ -49,10 +48,9 @@ var Generics;
var D = /*#__PURE__*/ function(C2) {
"use strict";
_inherits(D, C2);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C2);
diff --git a/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js b/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js
index 7ad2ddaf99b..654cb7ca865 100644
--- a/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js
+++ b/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js
@@ -1,28 +1,24 @@
//// [classWithConstructors.ts]
var NonGeneric, Generics, C, C2, D, C1, C21, D1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
NonGeneric || (NonGeneric = {}), new (C = function C(x) {
_class_call_check(this, C);
})(), new C(''), new (C2 = function C2(x) {
_class_call_check(this, C2);
})(), new C2(''), new C2(1), new (D = /*#__PURE__*/ function(C2) {
- _inherits(D, C2);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C2), D;
}(C2))(), new D(1), new D(''), Generics || (Generics = {}), new (C1 = function C(x) {
_class_call_check(this, C);
})(), new C1(''), new (C21 = function C2(x) {
_class_call_check(this, C2);
})(), new C21(''), new C21(1, 2), new (D1 = /*#__PURE__*/ function(C2) {
- _inherits(D, C2);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C2), D;
}(C21))(), new D1(1), new D1('');
diff --git a/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js b/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js
index a1f4e491980..040a000fb89 100644
--- a/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js
+++ b/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js
@@ -1,8 +1,8 @@
//// [classWithProtectedProperty.ts]
// accessing any protected outside the class is an error
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -28,10 +28,9 @@ C.g = function() {
var D = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(D, C1);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.method = function method() {
diff --git a/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js b/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js
index 5c9def0f20a..f10561124c2 100644
--- a/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js
+++ b/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js
@@ -1,7 +1,7 @@
//// [classWithProtectedProperty.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ (function() {
function C() {
_class_call_check(this, C), this.a = '', this.b = '', this.d = function() {
diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).1.normal.js
index 14a55ed2cb8..8742cf1cdf4 100644
--- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).1.normal.js
@@ -1,8 +1,8 @@
//// [classWithStaticFieldInParameterBindingPattern.2.ts]
// https://github.com/microsoft/TypeScript/issues/36295
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _class, _class1;
var C = function C() {
"use strict";
@@ -12,10 +12,9 @@ var C = function C() {
var tmp = param[/*#__PURE__*/ (_class = function(C) {
"use strict";
_inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(C), _class.x = 1, _class).x], b = tmp === void 0 ? "" : tmp;
@@ -26,10 +25,9 @@ var x = "";
var tmp = param[/*#__PURE__*/ (_class1 = function(C) {
"use strict";
_inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(C), _class1.x = 1, _class1).x], b = tmp === void 0 ? "" : tmp, d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : x;
diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).2.minified.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).2.minified.js
index 280353bd83f..9a87c6ba43e 100644
--- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterBindingPattern.2(target=es5).2.minified.js
@@ -1,24 +1,20 @@
//// [classWithStaticFieldInParameterBindingPattern.2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _class, _class1, C = function C() {
_class_call_check(this, C);
};
(void 0)[/*#__PURE__*/ ((_class = function(C) {
- _inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, C), _class;
}(C)).x = 1, _class).x], function(param) {
param[/*#__PURE__*/ ((_class1 = function(C) {
- _inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, C), _class;
}(C)).x = 1, _class1).x], arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
}();
diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).1.normal.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).1.normal.js
index 3daf48e5b91..205ee2361d8 100644
--- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).1.normal.js
@@ -1,8 +1,8 @@
//// [classWithStaticFieldInParameterInitializer.2.ts]
// https://github.com/microsoft/TypeScript/issues/36295
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _class, _class1;
var C = function C() {
"use strict";
@@ -12,10 +12,9 @@ var C = function C() {
var b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : (_class = /*#__PURE__*/ function(C) {
"use strict";
_inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(C), _class.x = 1, _class);
@@ -26,10 +25,9 @@ var x = "";
var b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : (_class1 = /*#__PURE__*/ function(C) {
"use strict";
_inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(C), _class1.x = 1, _class1), d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : x;
diff --git a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).2.minified.js b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).2.minified.js
index 5a901d5e947..50e585849a7 100644
--- a/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/classWithStaticFieldInParameterInitializer.2(target=es5).2.minified.js
@@ -1,26 +1,22 @@
//// [classWithStaticFieldInParameterInitializer.2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
};
!function() {
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : /*#__PURE__*/ function(C) {
- _inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, C), _class;
}(C).x = 1;
}(), function() {
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : /*#__PURE__*/ function(C) {
- _inherits(_class, C);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, C), _class;
}(C).x = 1, arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
}();
diff --git a/crates/swc/tests/tsc-references/classWithStaticMembers.1.normal.js b/crates/swc/tests/tsc-references/classWithStaticMembers.1.normal.js
index 6f1639e6bed..09f13c6fc31 100644
--- a/crates/swc/tests/tsc-references/classWithStaticMembers.1.normal.js
+++ b/crates/swc/tests/tsc-references/classWithStaticMembers.1.normal.js
@@ -1,8 +1,8 @@
//// [classWithStaticMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C(a, b) {
@@ -30,10 +30,9 @@ var r3 = r.foo;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/classWithStaticMembers.2.minified.js b/crates/swc/tests/tsc-references/classWithStaticMembers.2.minified.js
index 78884810ff1..ab30bc327bd 100644
--- a/crates/swc/tests/tsc-references/classWithStaticMembers.2.minified.js
+++ b/crates/swc/tests/tsc-references/classWithStaticMembers.2.minified.js
@@ -1,8 +1,8 @@
//// [classWithStaticMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
function C(a, b) {
_class_call_check(this, C), this.a = a, this.b = b;
@@ -21,11 +21,9 @@ var C = /*#__PURE__*/ function() {
}(), r = C.fn();
r.x, r.foo;
var r = /*#__PURE__*/ (function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
})(C).fn();
r.x, r.foo;
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.1.normal.js
index c49efc29d4c..f95909b762b 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithIdenticalObjects.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A1 = /*#__PURE__*/ function() {
"use strict";
function A1() {
@@ -38,20 +38,18 @@ var Base = /*#__PURE__*/ function() {
var A2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(A2, Base);
- var _super = _create_super(A2);
function A2() {
_class_call_check(this, A2);
- return _super.apply(this, arguments);
+ return _call_super(this, A2, arguments);
}
return A2;
}(Base);
var B2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(B2, Base);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.2.minified.js
index d517612ff7e..d22e4ca53a8 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalObjects.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithIdenticalObjects.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.1.normal.js
index 18d166f12df..f916889af67 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.2.minified.js
index 597c19241c9..e1cef424816 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.1.normal.js
index 7dc18fec44d..942012c0c72 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.2.minified.js
index 85a92367819..b0340c94093 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.1.normal.js
index 88bda3f702b..d8b73277788 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.2.minified.js
index 9fdb284a463..edbb968f463 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.1.normal.js
index 7f872eb7b20..ccdf3a0e1e6 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.2.minified.js
index d6dca88d27c..465e3e9d390 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.1.normal.js
index 035ee6b3f0f..c0df98f9558 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.2.minified.js
index 088db1c0d69..16ba481591e 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.1.normal.js
index fec5c05fa2b..35dabcee75d 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithSubtypeObjectOnCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.2.minified.js
index 56f1d902928..fbd6d20ba0b 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnCallSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithSubtypeObjectOnCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.1.normal.js
index 0a2116f70d9..aebf9866529 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.2.minified.js
index a4e5bfec012..c64716dedb8 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnConstructorSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.1.normal.js
index 6661ed7244c..bda8aee26f4 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithSubtypeObjectOnIndexSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.2.minified.js
index dacd4c10756..3d5849608af 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnIndexSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithSubtypeObjectOnIndexSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.1.normal.js
index 783c11ff950..b9844eff6b9 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.2.minified.js
index 00a927eb42f..83175ac2ffb 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.1.normal.js
index 92336a3292f..382fea92d91 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.2.minified.js
index c3542ca1215..442db71da78 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.1.normal.js
index a470b3fc4ad..7e51c13f056 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.1.normal.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.1.normal.js
@@ -1,7 +1,7 @@
//// [comparisonOperatorWithSubtypeObjectOnProperty.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -31,10 +30,9 @@ var A2 = function A2() {
var B2 = /*#__PURE__*/ function(A2) {
"use strict";
_inherits(B2, A2);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A2);
diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.2.minified.js
index 3d50780442d..3f0131a9927 100644
--- a/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.2.minified.js
+++ b/crates/swc/tests/tsc-references/comparisonOperatorWithSubtypeObjectOnProperty.2.minified.js
@@ -1,4 +1,4 @@
//// [comparisonOperatorWithSubtypeObjectOnProperty.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.1.normal.js
index cc975deb436..7a460ceaa49 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.1.normal.js
@@ -1,7 +1,7 @@
//// [computedPropertyNames24_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -17,10 +17,9 @@ var _super_bar = super.bar();
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto[_super_bar] = function() {};
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.2.minified.js
index ca074dcf267..41fee4a945f 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames24_ES5.2.minified.js
@@ -1,5 +1,5 @@
//// [computedPropertyNames24_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
super.bar();
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.1.normal.js
index 2f500346e69..f3e71f71af7 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.1.normal.js
@@ -1,10 +1,10 @@
//// [computedPropertyNames25_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -19,10 +19,9 @@ var Base = /*#__PURE__*/ function() {
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.foo = function foo() {
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.2.minified.js
index 3b212e455b3..dd7a7b774c7 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames25_ES5.2.minified.js
@@ -1,7 +1,7 @@
//// [computedPropertyNames25_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.1.normal.js
index b338bfa711a..ed6660d80c5 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.1.normal.js
@@ -1,8 +1,8 @@
//// [computedPropertyNames26_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -18,10 +18,9 @@ var _ = _define_property({}, super.bar(), 1)[0];
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto[_] = function() {};
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.2.minified.js
index 73fb3dd219c..a96ace67285 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames26_ES5.2.minified.js
@@ -1,6 +1,6 @@
//// [computedPropertyNames26_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
_define_property({}, super.bar(), 1)[0];
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.1.normal.js
index 903eeb6b729..11d82ad780b 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.1.normal.js
@@ -1,7 +1,7 @@
//// [computedPropertyNames27_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var _tmp = (super(), "prop");
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto[_tmp] = function() {};
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.2.minified.js
index 98860a0b8b6..75a4de9f7d1 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames27_ES5.2.minified.js
@@ -1,5 +1,5 @@
//// [computedPropertyNames27_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
super();
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.1.normal.js
index a07b7d39621..3b20d731404 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.1.normal.js
@@ -1,8 +1,8 @@
//// [computedPropertyNames28_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,12 +10,11 @@ var Base = function Base() {
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
var _this;
- _this = _super.call(this);
- var obj = _define_property({}, (_this = _super.call(this), "prop"), function() {});
+ _this = _call_super(this, C);
+ var obj = _define_property({}, (_this = _call_super(this, C), "prop"), function() {});
return _this;
}
return C;
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.2.minified.js
index 967cad42c6b..0d05dd51011 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames28_ES5.2.minified.js
@@ -1,5 +1,5 @@
//// [computedPropertyNames28_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.1.normal.js
index f57ada16776..c503f1e1869 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.1.normal.js
@@ -1,8 +1,8 @@
//// [computedPropertyNames30_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,17 +10,16 @@ var Base = function Base() {
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
var _this = this;
_class_call_check(this, C);
var _this1;
- _this1 = _super.call(this);
+ _this1 = _call_super(this, C);
(function() {
var obj = // Ideally, we would capture this. But the reference is
// illegal, and not capturing this is consistent with
//treatment of other similar violations.
- _define_property({}, (_this1 = _super.call(_this), "prop"), function() {});
+ _define_property({}, (_this1 = _call_super(_this, C), "prop"), function() {});
});
return _this1;
}
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.2.minified.js
index 45e015be7e0..7a969864f05 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames30_ES5.2.minified.js
@@ -1,5 +1,5 @@
//// [computedPropertyNames30_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.1.normal.js
index 79916b4a127..16b2ca4a08a 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.1.normal.js
@@ -1,10 +1,10 @@
//// [computedPropertyNames31_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -19,10 +19,9 @@ var Base = /*#__PURE__*/ function() {
var C = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(C, Base);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.foo = function foo() {
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.2.minified.js
index ed450ecb113..9b1139aee38 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames31_ES5.2.minified.js
@@ -1,7 +1,7 @@
//// [computedPropertyNames31_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.1.normal.js
index 2321df209d7..84644cc98b4 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.1.normal.js
@@ -1,8 +1,8 @@
//// [computedPropertyNames43_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
@@ -18,10 +18,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
_create_class(D, [
{
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.2.minified.js
index 1570fe1e082..fa196db83c3 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames43_ES5.2.minified.js
@@ -1,5 +1,5 @@
//// [computedPropertyNames43_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.1.normal.js
index cb046c2fe15..7fb0940de73 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.1.normal.js
@@ -1,8 +1,8 @@
//// [computedPropertyNames44_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
@@ -29,10 +29,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
_create_class(D, [
{
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.2.minified.js
index 8a434d37877..3f94c16bf13 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames44_ES5.2.minified.js
@@ -1,5 +1,5 @@
//// [computedPropertyNames44_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.1.normal.js
index ba6886cdacd..ba1c88c04a9 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.1.normal.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.1.normal.js
@@ -1,8 +1,8 @@
//// [computedPropertyNames45_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
@@ -29,10 +29,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
_create_class(D, [
{
diff --git a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.2.minified.js
index 8154843e93a..9eb845b8fba 100644
--- a/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.2.minified.js
+++ b/crates/swc/tests/tsc-references/computedPropertyNames45_ES5.2.minified.js
@@ -1,5 +1,5 @@
//// [computedPropertyNames45_ES5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js
index ee5b2ac24ff..2e17ed9d15a 100644
--- a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js
+++ b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js
@@ -1,8 +1,8 @@
//// [conditionalOperatorWithIdenticalBCT.ts]
//Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var X = function X() {
"use strict";
_class_call_check(this, X);
@@ -10,20 +10,18 @@ var X = function X() {
var A = /*#__PURE__*/ function(X) {
"use strict";
_inherits(A, X);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
- return _super.apply(this, arguments);
+ return _call_super(this, A, arguments);
}
return A;
}(X);
var B = /*#__PURE__*/ function(X) {
"use strict";
_inherits(B, X);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(X);
diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.2.minified.js b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.2.minified.js
index 2b79f04dd0b..a8faaf8c446 100644
--- a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.2.minified.js
+++ b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.2.minified.js
@@ -1,4 +1,4 @@
//// [conditionalOperatorWithIdenticalBCT.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.1.normal.js
index 21eb719d39b..ca17cf55996 100644
--- a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.1.normal.js
+++ b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.1.normal.js
@@ -1,8 +1,8 @@
//// [conditionalOperatorWithoutIdenticalBCT.ts]
//Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var X = function X() {
"use strict";
_class_call_check(this, X);
@@ -10,20 +10,18 @@ var X = function X() {
var A = /*#__PURE__*/ function(X) {
"use strict";
_inherits(A, X);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
- return _super.apply(this, arguments);
+ return _call_super(this, A, arguments);
}
return A;
}(X);
var B = /*#__PURE__*/ function(X) {
"use strict";
_inherits(B, X);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(X);
diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.2.minified.js b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.2.minified.js
index 5320d702624..2bf4726ef28 100644
--- a/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.2.minified.js
+++ b/crates/swc/tests/tsc-references/conditionalOperatorWithoutIdenticalBCT.2.minified.js
@@ -1,4 +1,4 @@
//// [conditionalOperatorWithoutIdenticalBCT.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.1.normal.js
index 0c7ff2247cb..820cbc6b4bf 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.1.normal.js
@@ -1,8 +1,8 @@
//// [constructSignatureAssignabilityInInheritance2.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.2.minified.js
index 5b0f52b133c..5ac042b23b3 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance2.2.minified.js
@@ -1,4 +1,4 @@
//// [constructSignatureAssignabilityInInheritance2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.1.normal.js
index a8e180a5257..d45db0e6aad 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.1.normal.js
@@ -1,9 +1,9 @@
//// [constructSignatureAssignabilityInInheritance3.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
// error cases
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Errors;
(function(Errors) {
var Base = function Base() {
@@ -13,30 +13,27 @@ var Errors;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.2.minified.js
index 6d607befadf..9fc25ff7174 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance3.2.minified.js
@@ -1,6 +1,6 @@
//// [constructSignatureAssignabilityInInheritance3.ts]
var Errors;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Errors || (Errors = {});
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.1.normal.js
index 9b76da67bbc..213e2b882cd 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.1.normal.js
@@ -1,8 +1,8 @@
//// [constructSignatureAssignabilityInInheritance4.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.2.minified.js
index af959f3770a..6e45383e653 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance4.2.minified.js
@@ -1,4 +1,4 @@
//// [constructSignatureAssignabilityInInheritance4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.1.normal.js
index 5f912e53402..10eb75d0844 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.1.normal.js
@@ -1,9 +1,9 @@
//// [constructSignatureAssignabilityInInheritance5.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -11,30 +11,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.2.minified.js
index 49322abbdd7..9002d17ad7f 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance5.2.minified.js
@@ -1,4 +1,4 @@
//// [constructSignatureAssignabilityInInheritance5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.1.normal.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.1.normal.js
index ddca2534392..0390cea6609 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.1.normal.js
@@ -2,9 +2,9 @@
// checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures
// all are errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -12,30 +12,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.2.minified.js b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.2.minified.js
index 378d40625c8..f5580e26620 100644
--- a/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructSignatureAssignabilityInInheritance6.2.minified.js
@@ -1,4 +1,4 @@
//// [constructSignatureAssignabilityInInheritance6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.1.normal.js
index 3cf690c2b95..3cf047969bd 100644
--- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.1.normal.js
@@ -1,7 +1,7 @@
//// [constructorFunctionTypeIsAssignableToBaseType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,20 +9,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.2.minified.js
index 83538f3a7c9..cba6b820d3d 100644
--- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType.2.minified.js
@@ -1,4 +1,4 @@
//// [constructorFunctionTypeIsAssignableToBaseType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.1.normal.js
index a362463b14e..3b46f9c7cb8 100644
--- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.1.normal.js
@@ -1,9 +1,9 @@
//// [constructorFunctionTypeIsAssignableToBaseType2.ts]
// the constructor function itself does not need to be a subtype of the base type constructor function
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x) {
"use strict";
_class_call_check(this, Base);
@@ -11,21 +11,25 @@ var Base = function Base(x) {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(x) {
_class_call_check(this, Derived);
- return _super.call(this, x);
+ return _call_super(this, Derived, [
+ x
+ ]);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2(x) {
_class_call_check(this, Derived2);
- var _this = _super.call(this, x);
+ var _this;
+ _this = _call_super(this, Derived2, [
+ x
+ ]);
return _possible_constructor_return(_this, 1);
+ return _this;
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.2.minified.js
index 8c262d9b6e4..126fe291709 100644
--- a/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructorFunctionTypeIsAssignableToBaseType2.2.minified.js
@@ -1,5 +1,5 @@
//// [constructorFunctionTypeIsAssignableToBaseType2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.1.normal.js b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.1.normal.js
index 1b7c601a5df..1746f0255a8 100644
--- a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.1.normal.js
+++ b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.1.normal.js
@@ -1,7 +1,7 @@
//// [constructorHasPrototypeProperty.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var NonGeneric;
(function(NonGeneric) {
var C = function C() {
@@ -11,10 +11,9 @@ var NonGeneric;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
@@ -32,10 +31,9 @@ var Generic;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.2.minified.js b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.2.minified.js
index 05fc922478f..0e4fb42b48c 100644
--- a/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.2.minified.js
+++ b/crates/swc/tests/tsc-references/constructorHasPrototypeProperty.2.minified.js
@@ -1,24 +1,20 @@
//// [constructorHasPrototypeProperty.ts]
var NonGeneric, Generic, C, D, C1, D1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
NonGeneric || (NonGeneric = {}), D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C = function C() {
_class_call_check(this, C);
}), C.prototype.foo, D.prototype.bar, Generic || (Generic = {}), D1 = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C1 = function C() {
_class_call_check(this, C);
}), C1.prototype.foo, D1.prototype.baz;
diff --git a/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.1.normal.js
index 66dab14c73c..8257d3fc6fc 100644
--- a/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.1.normal.js
+++ b/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.1.normal.js
@@ -1,9 +1,9 @@
//// [controlFlowSuperPropertyAccess.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
"use strict";
_class_call_check(this, B);
@@ -11,10 +11,9 @@ var B = function B() {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.body = function body() {
diff --git a/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.2.minified.js
index e4d7cebf543..b53c14173a0 100644
--- a/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.2.minified.js
+++ b/crates/swc/tests/tsc-references/controlFlowSuperPropertyAccess.2.minified.js
@@ -1,6 +1,6 @@
//// [controlFlowSuperPropertyAccess.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.1.normal.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.1.normal.js
index 289ef7816d0..c2b2b299aec 100644
--- a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.1.normal.js
+++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.1.normal.js
@@ -17,10 +17,10 @@ _export(exports, {
return D;
}
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
var _instanceof = require("@swc/helpers/_/_instanceof");
-var _create_super = require("@swc/helpers/_/_create_super");
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -35,10 +35,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits._(D, C);
- var _super = _create_super._(D);
function D() {
_class_call_check._(this, D);
- return _super.apply(this, arguments);
+ return _call_super._(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.2.minified.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.2.minified.js
index 9ad5424d7d3..4289aed4346 100644
--- a/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.2.minified.js
+++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicates01.2.minified.js
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", {
return D;
}
});
-var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _instanceof = require("@swc/helpers/_/_instanceof"), _create_super = require("@swc/helpers/_/_create_super"), C = /*#__PURE__*/ function() {
+var _call_super = require("@swc/helpers/_/_call_super"), _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _instanceof = require("@swc/helpers/_/_instanceof"), C = /*#__PURE__*/ function() {
function C() {
_class_call_check._(this, C);
}
@@ -22,10 +22,8 @@ var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits =
return _instanceof._(this, D);
}, C;
}(), D = /*#__PURE__*/ function(C) {
- _inherits._(D, C);
- var _super = _create_super._(D);
function D() {
- return _class_call_check._(this, D), _super.apply(this, arguments);
+ return _class_call_check._(this, D), _call_super._(this, D, arguments);
}
- return D;
+ return _inherits._(D, C), D;
}(C);
diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.1.normal.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.1.normal.js
index b19ba21e53f..40045a702a9 100644
--- a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.1.normal.js
+++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.1.normal.js
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "C", {
return C;
}
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
var _instanceof = require("@swc/helpers/_/_instanceof");
-var _create_super = require("@swc/helpers/_/_create_super");
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -27,10 +27,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits._(D, C);
- var _super = _create_super._(D);
function D() {
_class_call_check._(this, D);
- return _super.apply(this, arguments);
+ return _call_super._(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.2.minified.js b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.2.minified.js
index 53a9c3d4c70..07922bc82b3 100644
--- a/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.2.minified.js
+++ b/crates/swc/tests/tsc-references/declarationEmitThisPredicatesWithPrivateName01.2.minified.js
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
return C;
}
});
-var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _instanceof = require("@swc/helpers/_/_instanceof"), _create_super = require("@swc/helpers/_/_create_super"), C = /*#__PURE__*/ function() {
+var _call_super = require("@swc/helpers/_/_call_super"), _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _instanceof = require("@swc/helpers/_/_instanceof"), C = /*#__PURE__*/ function() {
function C() {
_class_call_check._(this, C);
}
@@ -15,10 +15,8 @@ var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits =
return _instanceof._(this, D);
}, C;
}(), D = /*#__PURE__*/ function(C) {
- _inherits._(D, C);
- var _super = _create_super._(D);
function D() {
- return _class_call_check._(this, D), _super.apply(this, arguments);
+ return _class_call_check._(this, D), _call_super._(this, D, arguments);
}
- return D;
+ return _inherits._(D, C), D;
}(C);
diff --git a/crates/swc/tests/tsc-references/decoratorOnClass9.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass9.1.normal.js
index d83ffc8e332..e936d9e62fd 100644
--- a/crates/swc/tests/tsc-references/decoratorOnClass9.1.normal.js
+++ b/crates/swc/tests/tsc-references/decoratorOnClass9.1.normal.js
@@ -1,7 +1,7 @@
//// [decoratorOnClass9.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var A = function A() {
"use strict";
@@ -11,10 +11,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.m = function m() {
diff --git a/crates/swc/tests/tsc-references/decoratorOnClass9.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass9.2.minified.js
index f2fb7d02135..fd517ea73c9 100644
--- a/crates/swc/tests/tsc-references/decoratorOnClass9.2.minified.js
+++ b/crates/swc/tests/tsc-references/decoratorOnClass9.2.minified.js
@@ -1,15 +1,13 @@
//// [decoratorOnClass9.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B.prototype.m = function() {
+ return _inherits(B, A), B.prototype.m = function() {
return B.x;
}, B;
}(function A() {
diff --git a/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.1.normal.js
index 53aedc6a311..db7bfcae194 100644
--- a/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.1.normal.js
+++ b/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.1.normal.js
@@ -3,9 +3,9 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var _ts_decorate = require("@swc/helpers/_/_ts_decorate");
var _ts_metadata = require("@swc/helpers/_/_ts_metadata");
var A = function A() {
@@ -29,10 +29,9 @@ B = _ts_decorate._([
var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits._(C, A);
- var _super = _create_super._(C);
function C() {
_class_call_check._(this, C);
- return _super.apply(this, arguments);
+ return _call_super._(this, C, arguments);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.2.minified.js
index d19bcb7cd30..d9946080bbf 100644
--- a/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.2.minified.js
+++ b/crates/swc/tests/tsc-references/decoratorOnClassConstructor4.2.minified.js
@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", {
value: !0
});
-var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _create_super = require("@swc/helpers/_/_create_super"), _ts_decorate = require("@swc/helpers/_/_ts_decorate"), _ts_metadata = require("@swc/helpers/_/_ts_metadata"), A = function A() {
+var _call_super = require("@swc/helpers/_/_call_super"), _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _ts_decorate = require("@swc/helpers/_/_ts_decorate"), _ts_metadata = require("@swc/helpers/_/_ts_metadata"), A = function A() {
_class_call_check._(this, A);
};
A = _ts_decorate._([
@@ -19,12 +19,10 @@ B = _ts_decorate._([
])
], B);
var C = /*#__PURE__*/ function(A) {
- _inherits._(C, A);
- var _super = _create_super._(C);
function C() {
- return _class_call_check._(this, C), _super.apply(this, arguments);
+ return _class_call_check._(this, C), _call_super._(this, C, arguments);
}
- return C;
+ return _inherits._(C, A), C;
}(A);
_ts_decorate._([
dec
diff --git a/crates/swc/tests/tsc-references/decoratorOnClassMethod12.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClassMethod12.1.normal.js
index 2644714bf67..d095e8aa5a0 100644
--- a/crates/swc/tests/tsc-references/decoratorOnClassMethod12.1.normal.js
+++ b/crates/swc/tests/tsc-references/decoratorOnClassMethod12.1.normal.js
@@ -1,7 +1,7 @@
//// [decoratorOnClassMethod12.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var M;
(function(M) {
@@ -17,10 +17,9 @@ var M;
var C = /*#__PURE__*/ function(S) {
"use strict";
_inherits(C, S);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.method = function method() {};
diff --git a/crates/swc/tests/tsc-references/decoratorOnClassMethod12.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClassMethod12.2.minified.js
index 0c7bab8b4a5..98cc28efcee 100644
--- a/crates/swc/tests/tsc-references/decoratorOnClassMethod12.2.minified.js
+++ b/crates/swc/tests/tsc-references/decoratorOnClassMethod12.2.minified.js
@@ -1,16 +1,14 @@
//// [decoratorOnClassMethod12.ts]
var M, C;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
M || (M = {}), C = /*#__PURE__*/ function(S) {
- _inherits(C, S);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C.prototype.method = function() {}, C;
+ return _inherits(C, S), C.prototype.method = function() {}, C;
}(/*#__PURE__*/ function() {
function S() {
_class_call_check(this, S);
diff --git a/crates/swc/tests/tsc-references/defineProperty(target=es5).1.normal.js b/crates/swc/tests/tsc-references/defineProperty(target=es5).1.normal.js
index f73a9a0d7c5..b97100d7e34 100644
--- a/crates/swc/tests/tsc-references/defineProperty(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/defineProperty(target=es5).1.normal.js
@@ -1,10 +1,9 @@
//// [defineProperty.ts]
-import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x = "p";
var _x = x;
var _x1 = _x;
@@ -41,14 +40,13 @@ var B = function B() {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C(ka) {
_class_call_check(this, C);
var _this;
- _this = _super.call(this);
- _define_property(_assert_this_initialized(_this), "ka", void 0);
- _define_property(_assert_this_initialized(_this), "z", void 0);
- _define_property(_assert_this_initialized(_this), "ki", void 0);
+ _this = _call_super(this, C);
+ _define_property(_this, "ka", void 0);
+ _define_property(_this, "z", void 0);
+ _define_property(_this, "ki", void 0);
_this.ka = ka;
_this.z = _this.ka;
_this.ki = _this.ka;
diff --git a/crates/swc/tests/tsc-references/defineProperty(target=es5).2.minified.js b/crates/swc/tests/tsc-references/defineProperty(target=es5).2.minified.js
index b5ab34726ce..e0538e287aa 100644
--- a/crates/swc/tests/tsc-references/defineProperty(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/defineProperty(target=es5).2.minified.js
@@ -1,7 +1,6 @@
//// [defineProperty.ts]
-import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.1.normal.js b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.1.normal.js
index 1f97615200b..8fbb83302db 100644
--- a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.1.normal.js
@@ -1,9 +1,9 @@
//// [derivedClassConstructorWithoutSuperCall.ts]
// derived class constructors must contain a super call
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -11,11 +11,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- var _this;
- return _possible_constructor_return(_this);
+ return _possible_constructor_return(void 0);
}
return Derived;
}(Base);
@@ -26,13 +24,12 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
var _this = this;
_class_call_check(this, Derived2);
var _this1;
var r2 = function() {
- return _this1 = _super.call(_this);
+ return _this1 = _call_super(_this, Derived2);
}; // error for misplaced super call (nested function)
return _possible_constructor_return(_this1);
}
@@ -41,27 +38,24 @@ var Derived2 = /*#__PURE__*/ function(Base2) {
var Derived3 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived3, Base2);
- var _super = _create_super(Derived3);
function Derived3() {
_class_call_check(this, Derived3);
- var _this;
var r = function r() {
super();
} // error
;
- return _possible_constructor_return(_this);
+ return _possible_constructor_return(void 0);
}
return Derived3;
}(Base2);
var Derived4 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived4, Base2);
- var _super = _create_super(Derived4);
function Derived4() {
_class_call_check(this, Derived4);
var _this;
- var r = _this = _super.call(this); // ok
- return _possible_constructor_return(_this);
+ var r = _this = _call_super(this, Derived4); // ok
+ return _this;
}
return Derived4;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.2.minified.js b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.2.minified.js
index 5ccb4ad4b64..07cdd7bda98 100644
--- a/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassConstructorWithoutSuperCall.2.minified.js
@@ -1,5 +1,5 @@
//// [derivedClassConstructorWithoutSuperCall.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.1.normal.js b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.1.normal.js
index 3e97094f434..83ad092eb37 100644
--- a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassFunctionOverridesBaseClassAccessor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -23,10 +23,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.x = function x() {
diff --git a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.2.minified.js b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.2.minified.js
index d462f60e94a..de9969d2faa 100644
--- a/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassFunctionOverridesBaseClassAccessor.2.minified.js
@@ -1,5 +1,5 @@
//// [derivedClassFunctionOverridesBaseClassAccessor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js
index 75b59031f24..02d2d6b776c 100644
--- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassIncludesInheritedMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base(x) {
@@ -33,10 +33,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -56,10 +55,9 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js
index a559dd30e5f..f3d4e72fcf9 100644
--- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js
@@ -1,15 +1,13 @@
//// [derivedClassIncludesInheritedMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var d2, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(/*#__PURE__*/ function() {
function Base(x) {
_class_call_check(this, Base);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.1.normal.js
index e15f0eec826..60ccf96765d 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.1.normal.js
@@ -1,7 +1,7 @@
//// [derivedClassOverridesIndexersWithAssignmentCompatibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -25,10 +24,9 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.2.minified.js
index 2d041b48d1f..1dc3fa574f2 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesIndexersWithAssignmentCompatibility.2.minified.js
@@ -1,4 +1,4 @@
//// [derivedClassOverridesIndexersWithAssignmentCompatibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.1.normal.js
index ac4eed205a5..34ee52efc48 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.1.normal.js
@@ -1,7 +1,7 @@
//// [derivedClassOverridesPrivates.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -23,10 +22,9 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.2.minified.js
index 4064e60bea3..d0d214b639c 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesPrivates.2.minified.js
@@ -1,4 +1,4 @@
//// [derivedClassOverridesPrivates.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.1.normal.js
index a92ab674f27..13da74fdab2 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassOverridesProtectedMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x;
var y;
var Base = /*#__PURE__*/ function() {
@@ -35,10 +35,11 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(a) {
_class_call_check(this, Derived);
- return _super.call(this, x);
+ return _call_super(this, Derived, [
+ x
+ ]);
}
var _proto = Derived.prototype;
_proto.b = function b(a) {};
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.2.minified.js
index ec1005b0faa..07d0f6b0c74 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers.2.minified.js
@@ -1,5 +1,5 @@
//// [derivedClassOverridesProtectedMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js
index 0e863079ecb..97ffc630a44 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassOverridesProtectedMembers2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x;
var y;
var Base = /*#__PURE__*/ function() {
@@ -36,10 +36,11 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(a) {
_class_call_check(this, Derived);
- return _super.call(this, a);
+ return _call_super(this, Derived, [
+ a
+ ]);
}
var _proto = Derived.prototype;
_proto.b = function b(a) {};
@@ -81,10 +82,9 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js
index 5f177ef6b09..ecb5281bb04 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js
@@ -1,15 +1,15 @@
//// [derivedClassOverridesProtectedMembers2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x, y, d2, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(a) {
- return _class_call_check(this, Derived), _super.call(this, a);
+ return _class_call_check(this, Derived), _call_super(this, Derived, [
+ a
+ ]);
}
- return Derived.prototype.b = function(a) {}, Derived.s = function(a) {}, _create_class(Derived, [
+ return _inherits(Derived, Base), Derived.prototype.b = function(a) {}, Derived.s = function(a) {}, _create_class(Derived, [
{
key: "c",
get: function() {
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.1.normal.js
index c993019f177..5c02ec35425 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassOverridesProtectedMembers3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x;
var y;
var Base = /*#__PURE__*/ function() {
@@ -37,20 +37,22 @@ var Base = /*#__PURE__*/ function() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1(a) {
_class_call_check(this, Derived1);
- return _super.call(this, a);
+ return _call_super(this, Derived1, [
+ a
+ ]);
}
return Derived1;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2(a) {
_class_call_check(this, Derived2);
- return _super.call(this, a);
+ return _call_super(this, Derived2, [
+ a
+ ]);
}
var _proto = Derived2.prototype;
_proto.b = function b(a) {};
@@ -59,10 +61,11 @@ var Derived2 = /*#__PURE__*/ function(Base) {
var Derived3 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived3, Base);
- var _super = _create_super(Derived3);
function Derived3(a) {
_class_call_check(this, Derived3);
- return _super.call(this, a);
+ return _call_super(this, Derived3, [
+ a
+ ]);
}
_create_class(Derived3, [
{
@@ -77,10 +80,11 @@ var Derived3 = /*#__PURE__*/ function(Base) {
var Derived4 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived4, Base);
- var _super = _create_super(Derived4);
function Derived4(a) {
_class_call_check(this, Derived4);
- return _super.call(this, a);
+ return _call_super(this, Derived4, [
+ a
+ ]);
}
_create_class(Derived4, [
{
@@ -93,30 +97,33 @@ var Derived4 = /*#__PURE__*/ function(Base) {
var Derived5 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived5, Base);
- var _super = _create_super(Derived5);
function Derived5(a) {
_class_call_check(this, Derived5);
- return _super.call(this, a);
+ return _call_super(this, Derived5, [
+ a
+ ]);
}
return Derived5;
}(Base);
var Derived6 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived6, Base);
- var _super = _create_super(Derived6);
function Derived6(a) {
_class_call_check(this, Derived6);
- return _super.call(this, a);
+ return _call_super(this, Derived6, [
+ a
+ ]);
}
return Derived6;
}(Base);
var Derived7 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived7, Base);
- var _super = _create_super(Derived7);
function Derived7(a) {
_class_call_check(this, Derived7);
- return _super.call(this, a);
+ return _call_super(this, Derived7, [
+ a
+ ]);
}
Derived7.s = function s(a) {};
return Derived7;
@@ -124,10 +131,11 @@ var Derived7 = /*#__PURE__*/ function(Base) {
var Derived8 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived8, Base);
- var _super = _create_super(Derived8);
function Derived8(a) {
_class_call_check(this, Derived8);
- return _super.call(this, a);
+ return _call_super(this, Derived8, [
+ a
+ ]);
}
_create_class(Derived8, null, [
{
@@ -142,10 +150,11 @@ var Derived8 = /*#__PURE__*/ function(Base) {
var Derived9 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived9, Base);
- var _super = _create_super(Derived9);
function Derived9(a) {
_class_call_check(this, Derived9);
- return _super.call(this, a);
+ return _call_super(this, Derived9, [
+ a
+ ]);
}
_create_class(Derived9, null, [
{
@@ -158,10 +167,11 @@ var Derived9 = /*#__PURE__*/ function(Base) {
var Derived10 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived10, Base);
- var _super = _create_super(Derived10);
function Derived10(a) {
_class_call_check(this, Derived10);
- return _super.call(this, a);
+ return _call_super(this, Derived10, [
+ a
+ ]);
}
return Derived10;
}(Base);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.2.minified.js
index 66326bc100d..3229d7d02b8 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers3.2.minified.js
@@ -1,5 +1,5 @@
//// [derivedClassOverridesProtectedMembers3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.1.normal.js
index ee9beec42af..18e665dfc3b 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.1.normal.js
@@ -1,7 +1,7 @@
//// [derivedClassOverridesProtectedMembers4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x;
var y;
var Base = function Base() {
@@ -11,20 +11,18 @@ var Base = function Base() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
return Derived1;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived1) {
"use strict";
_inherits(Derived2, Derived1);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived1);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.2.minified.js
index 92e58588bbf..73207edba8a 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers4.2.minified.js
@@ -1,4 +1,4 @@
//// [derivedClassOverridesProtectedMembers4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js
index d7eb2f28926..b85dab74831 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassOverridesPublicMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x;
var y;
var Base = /*#__PURE__*/ function() {
@@ -35,10 +35,11 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(a) {
_class_call_check(this, Derived);
- return _super.call(this, x);
+ return _call_super(this, Derived, [
+ x
+ ]);
}
var _proto = Derived.prototype;
_proto.b = function b(a) {};
@@ -80,10 +81,9 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js
index af745b5ed80..f762ecfc373 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js
@@ -1,15 +1,15 @@
//// [derivedClassOverridesPublicMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x, y, d2, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(a) {
- return _class_call_check(this, Derived), _super.call(this, x);
+ return _class_call_check(this, Derived), _call_super(this, Derived, [
+ x
+ ]);
}
- return Derived.prototype.b = function(a) {}, Derived.s = function(a) {}, _create_class(Derived, [
+ return _inherits(Derived, Base), Derived.prototype.b = function(a) {}, Derived.s = function(a) {}, _create_class(Derived, [
{
key: "c",
get: function() {
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.1.normal.js
index 0b08f48fd25..d5caa998e39 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.1.normal.js
@@ -1,7 +1,7 @@
//// [derivedClassOverridesWithoutSubtype.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -23,10 +22,9 @@ var Base2 = function Base2() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.2.minified.js
index 7e1a81d00c6..8bb0fd118c7 100644
--- a/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassOverridesWithoutSubtype.2.minified.js
@@ -1,4 +1,4 @@
//// [derivedClassOverridesWithoutSubtype.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js
index 599cfee5793..8e55bb23786 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassTransitivity.ts]
// subclassing is not transitive when you can remove required parameters and add optional parameters
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -15,10 +15,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo() {} // ok to drop parameters
@@ -28,10 +27,9 @@ var D = /*#__PURE__*/ function(C) {
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo = function foo(x) {} // ok to add optional parameters
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js
index 80f113aaeae..1864203ca0e 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js
@@ -1,6 +1,6 @@
//// [derivedClassTransitivity.ts]
var e;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
e.foo(1), e.foo('');
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js
index 42b801a7718..d4693e18548 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassTransitivity2.ts]
// subclassing is not transitive when you can remove required parameters and add optional parameters
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -15,10 +15,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo(x) {} // ok to drop parameters
@@ -28,10 +27,9 @@ var D = /*#__PURE__*/ function(C) {
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo = function foo(x, y) {} // ok to add optional parameters
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js
index 175ef9ed634..69a463e1299 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js
@@ -1,6 +1,6 @@
//// [derivedClassTransitivity2.ts]
var e;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
e.foo(1, 1), e.foo(1, '');
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js
index 579fced3d28..db167d03a26 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassTransitivity3.ts]
// subclassing is not transitive when you can remove required parameters and add optional parameters
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -15,10 +15,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo(x) {} // ok to drop parameters
@@ -28,10 +27,9 @@ var D = /*#__PURE__*/ function(C) {
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo = function foo(x, y) {} // ok to add optional parameters
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js
index 4af47ef26eb..17e7df9eaf0 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js
@@ -1,6 +1,6 @@
//// [derivedClassTransitivity3.ts]
var e;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
e.foo('', ''), e.foo('', 1);
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js
index d681d25fc90..4ee2fff0a9d 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassTransitivity4.ts]
// subclassing is not transitive when you can remove required parameters and add optional parameters on protected members
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -15,10 +15,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo() {} // ok to drop parameters
@@ -28,10 +27,9 @@ var D = /*#__PURE__*/ function(C) {
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo = function foo(x) {} // ok to add optional parameters
diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js
index 4343b216b7c..14dccee7279 100644
--- a/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js
@@ -1,6 +1,6 @@
//// [derivedClassTransitivity4.ts]
var e;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
e.foo(1), e.foo('');
diff --git a/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js
index f7441522a6d..aa00dce7e3b 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassWithAny.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -35,10 +35,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo() {
@@ -68,10 +67,9 @@ var D = /*#__PURE__*/ function(C) {
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo = function foo() {
diff --git a/crates/swc/tests/tsc-references/derivedClassWithAny.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithAny.2.minified.js
index 2683c58de45..d7fb94d1461 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithAny.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithAny.2.minified.js
@@ -1,7 +1,7 @@
//// [derivedClassWithAny.ts]
var e;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
e.foo();
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js
index 89b982ea913..70df57939e5 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassWithPrivateInstanceShadowingProtectedInstance.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -27,10 +27,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.fn = function fn() {
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.2.minified.js
index 4892b3605db..ef4167d5b2e 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.2.minified.js
@@ -1,5 +1,5 @@
//// [derivedClassWithPrivateInstanceShadowingProtectedInstance.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js
index 7698ebcd928..b730bb72913 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassWithPrivateInstanceShadowingPublicInstance.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -27,10 +27,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.fn = function fn() {
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js
index a5ef21f5c60..7004e15d34e 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js
@@ -1,8 +1,8 @@
//// [derivedClassWithPrivateInstanceShadowingPublicInstance.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
function Base() {
_class_call_check(this, Base);
@@ -19,12 +19,10 @@ var Base = /*#__PURE__*/ function() {
}
]), Base;
}(), Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived.prototype.fn = function() {
+ return _inherits(Derived, Base), Derived.prototype.fn = function() {
return '';
}, _create_class(Derived, [
{
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js
index 6271729963e..3883bde12f9 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassWithPrivateStaticShadowingProtectedStatic.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -26,10 +26,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
Derived.fn = function fn() {
return '';
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.2.minified.js
index 724413beea9..29aca1b9766 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.2.minified.js
@@ -1,5 +1,5 @@
//// [derivedClassWithPrivateStaticShadowingProtectedStatic.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js
index 694ce2ffbf1..8b1ee0bff41 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassWithPrivateStaticShadowingPublicStatic.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -27,10 +27,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
Derived.fn = function fn() {
return '';
diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js
index 25ca78d0d63..6097dc9fbe6 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js
@@ -1,8 +1,8 @@
//// [derivedClassWithPrivateStaticShadowingPublicStatic.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
function Base() {
_class_call_check(this, Base);
@@ -19,12 +19,10 @@ var Base = /*#__PURE__*/ function() {
}
]), Base;
}(), Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived.fn = function() {
+ return _inherits(Derived, Base), Derived.fn = function() {
return '';
}, _create_class(Derived, null, [
{
diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js
index e1e9d7d49c0..05145e26c6f 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js
@@ -1,7 +1,7 @@
//// [derivedClassWithoutExplicitConstructor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x) {
"use strict";
_class_call_check(this, Base);
@@ -11,11 +11,10 @@ var Base = function Base(x) {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Derived, arguments);
_this.x = 1;
_this.y = 'hello';
return _this;
@@ -32,11 +31,10 @@ var Base2 = function Base2(x) {
var D = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D, Base2);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, D, arguments);
_this.x = 2;
_this.y = null;
return _this;
diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js
index c1b84757f53..8f763f555a5 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js
@@ -1,27 +1,23 @@
//// [derivedClassWithoutExplicitConstructor.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
var _this;
- return _class_call_check(this, Derived), _this = _super.apply(this, arguments), _this.x = 1, _this.y = 'hello', _this;
+ return _class_call_check(this, Derived), _this = _call_super(this, Derived, arguments), _this.x = 1, _this.y = 'hello', _this;
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(function Base(x) {
_class_call_check(this, Base), this.a = 1, this.a = x;
});
new Derived(), new Derived(1);
var D = /*#__PURE__*/ function(Base2) {
- _inherits(D, Base2);
- var _super = _create_super(D);
function D() {
var _this;
- return _class_call_check(this, D), _this = _super.apply(this, arguments), _this.x = 2, _this.y = null, _this;
+ return _class_call_check(this, D), _this = _call_super(this, D, arguments), _this.x = 2, _this.y = null, _this;
}
- return D;
+ return _inherits(D, Base2), D;
}(function Base2(x) {
_class_call_check(this, Base2), this.a = x;
});
diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js
index ecafb82d744..70045337351 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js
@@ -1,7 +1,7 @@
//// [derivedClassWithoutExplicitConstructor2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x) {
"use strict";
_class_call_check(this, Base);
@@ -11,11 +11,10 @@ var Base = function Base(x) {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Derived, arguments);
_this.x = 1;
_this.y = 'hello';
return _this;
@@ -34,11 +33,10 @@ var Base2 = function Base2(x) {
var D = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D, Base2);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, D, arguments);
_this.x = 2;
_this.y = null;
return _this;
diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js
index be6d3de6bc8..b38179ef0f5 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js
@@ -1,27 +1,23 @@
//// [derivedClassWithoutExplicitConstructor2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
var _this;
- return _class_call_check(this, Derived), _this = _super.apply(this, arguments), _this.x = 1, _this.y = 'hello', _this;
+ return _class_call_check(this, Derived), _this = _call_super(this, Derived, arguments), _this.x = 1, _this.y = 'hello', _this;
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(function Base(x) {
_class_call_check(this, Base), this.a = 1, this.a = x;
});
new Derived(), new Derived(1), new Derived(1, 2), new Derived(1, 2, 3);
var D = /*#__PURE__*/ function(Base2) {
- _inherits(D, Base2);
- var _super = _create_super(D);
function D() {
var _this;
- return _class_call_check(this, D), _this = _super.apply(this, arguments), _this.x = 2, _this.y = null, _this;
+ return _class_call_check(this, D), _this = _call_super(this, D, arguments), _this.x = 2, _this.y = null, _this;
}
- return D;
+ return _inherits(D, Base2), D;
}(function Base2(x) {
_class_call_check(this, Base2), this.a = x;
});
diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js
index 5d43fb42fbc..0d4d46ef38d 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedClassWithoutExplicitConstructor3.ts]
// automatic constructors with a class hieararchy of depth > 2
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x) {
"use strict";
_class_call_check(this, Base);
@@ -12,11 +12,12 @@ var Base = function Base(x) {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(y, z) {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this, 2);
+ _this = _call_super(this, Derived, [
+ 2
+ ]);
_this.b = '';
_this.b = y;
return _this;
@@ -26,11 +27,10 @@ var Derived = /*#__PURE__*/ function(Base) {
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Derived2, arguments);
_this.x = 1;
_this.y = 'hello';
return _this;
@@ -48,11 +48,12 @@ var Base2 = function Base2(x) {
var D = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D, Base);
- var _super = _create_super(D);
function D(y, z) {
_class_call_check(this, D);
var _this;
- _this = _super.call(this, 2);
+ _this = _call_super(this, D, [
+ 2
+ ]);
_this.b = null;
_this.b = y;
return _this;
@@ -62,11 +63,10 @@ var D = /*#__PURE__*/ function(Base) {
var D2 = /*#__PURE__*/ function(D) {
"use strict";
_inherits(D2, D);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, D2, arguments);
_this.x = 2;
_this.y = null;
return _this;
diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js
index c0dcd7616c6..b5a90eb7c52 100644
--- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js
@@ -1,42 +1,38 @@
//// [derivedClassWithoutExplicitConstructor3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x) {
_class_call_check(this, Base), this.a = 1, this.a = x;
}, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(y, z) {
var _this;
- return _class_call_check(this, Derived), (_this = _super.call(this, 2)).b = '', _this.b = y, _this;
+ return _class_call_check(this, Derived), (_this = _call_super(this, Derived, [
+ 2
+ ])).b = '', _this.b = y, _this;
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(Base), Derived2 = /*#__PURE__*/ function(Derived) {
- _inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
var _this;
- return _class_call_check(this, Derived2), _this = _super.apply(this, arguments), _this.x = 1, _this.y = 'hello', _this;
+ return _class_call_check(this, Derived2), _this = _call_super(this, Derived2, arguments), _this.x = 1, _this.y = 'hello', _this;
}
- return Derived2;
+ return _inherits(Derived2, Derived), Derived2;
}(Derived);
new Derived(), new Derived2(1), new Derived('', '');
var D2 = /*#__PURE__*/ function(D) {
- _inherits(D2, D);
- var _super = _create_super(D2);
function D2() {
var _this;
- return _class_call_check(this, D2), _this = _super.apply(this, arguments), _this.x = 2, _this.y = null, _this;
+ return _class_call_check(this, D2), _this = _call_super(this, D2, arguments), _this.x = 2, _this.y = null, _this;
}
- return D2;
+ return _inherits(D2, D), D2;
}(/*#__PURE__*/ function(Base) {
- _inherits(D, Base);
- var _super = _create_super(D);
function D(y, z) {
var _this;
- return _class_call_check(this, D), (_this = _super.call(this, 2)).b = null, _this.b = y, _this;
+ return _class_call_check(this, D), (_this = _call_super(this, D, [
+ 2
+ ])).b = null, _this.b = y, _this;
}
- return D;
+ return _inherits(D, Base), D;
}(Base));
new D2(), new D2(new Date()), new D2(new Date(), new Date());
diff --git a/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js b/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js
index 509aafd46bd..29bfc8ac5ae 100644
--- a/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js
@@ -1,8 +1,8 @@
//// [derivedGenericClassWithAny.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -25,10 +25,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo() {
@@ -58,10 +57,9 @@ var D = /*#__PURE__*/ function(C) {
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo = function foo() {
diff --git a/crates/swc/tests/tsc-references/derivedGenericClassWithAny.2.minified.js b/crates/swc/tests/tsc-references/derivedGenericClassWithAny.2.minified.js
index 719b182dc79..06dba5ab74e 100644
--- a/crates/swc/tests/tsc-references/derivedGenericClassWithAny.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedGenericClassWithAny.2.minified.js
@@ -1,7 +1,7 @@
//// [derivedGenericClassWithAny.ts]
var e;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
e.foo();
diff --git a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.1.normal.js
index 296c1d08f47..ebbab1cf69e 100644
--- a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.1.normal.js
@@ -1,9 +1,9 @@
//// [derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -18,10 +18,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.foo = function foo(x) {
diff --git a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.2.minified.js
index 37708e8a919..9c76a6a98f0 100644
--- a/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.2.minified.js
@@ -1,6 +1,6 @@
//// [derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.1.normal.js b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.1.normal.js
index 706095240c9..6ca5608d108 100644
--- a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.1.normal.js
+++ b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.1.normal.js
@@ -1,7 +1,7 @@
//// [derivedTypeDoesNotRequireExtendsClause.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -13,10 +13,9 @@ var Derived = function Derived() {
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.2.minified.js b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.2.minified.js
index fae98c16d15..1962306a5c9 100644
--- a/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.2.minified.js
+++ b/crates/swc/tests/tsc-references/derivedTypeDoesNotRequireExtendsClause.2.minified.js
@@ -1,4 +1,4 @@
//// [derivedTypeDoesNotRequireExtendsClause.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.1.normal.js
index d5ee0ccebaf..7254975d30e 100644
--- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.1.normal.js
+++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.1.normal.js
@@ -1,8 +1,8 @@
//// [destructuringParameterDeclaration5.ts]
// Parameter Declaration with generic
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Class = function Class() {
"use strict";
_class_call_check(this, Class);
@@ -10,10 +10,9 @@ var Class = function Class() {
var SubClass = /*#__PURE__*/ function(Class) {
"use strict";
_inherits(SubClass, Class);
- var _super = _create_super(SubClass);
function SubClass() {
_class_call_check(this, SubClass);
- return _super.call(this);
+ return _call_super(this, SubClass);
}
return SubClass;
}(Class);
@@ -24,10 +23,9 @@ var D = function D() {
var SubD = /*#__PURE__*/ function(D) {
"use strict";
_inherits(SubD, D);
- var _super = _create_super(SubD);
function SubD() {
_class_call_check(this, SubD);
- return _super.call(this);
+ return _call_super(this, SubD);
}
return SubD;
}(D);
diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.2.minified.js
index a80ff7ba8df..e7230a4201c 100644
--- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.2.minified.js
+++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration5.2.minified.js
@@ -1,23 +1,19 @@
//// [destructuringParameterDeclaration5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Class = function Class() {
_class_call_check(this, Class);
}, SubClass = /*#__PURE__*/ function(Class) {
- _inherits(SubClass, Class);
- var _super = _create_super(SubClass);
function SubClass() {
- return _class_call_check(this, SubClass), _super.call(this);
+ return _class_call_check(this, SubClass), _call_super(this, SubClass);
}
- return SubClass;
+ return _inherits(SubClass, Class), SubClass;
}(Class), SubD = /*#__PURE__*/ function(D) {
- _inherits(SubD, D);
- var _super = _create_super(SubD);
function SubD() {
- return _class_call_check(this, SubD), _super.call(this);
+ return _class_call_check(this, SubD), _call_super(this, SubD);
}
- return SubD;
+ return _inherits(SubD, D), SubD;
}(function D() {
_class_call_check(this, D);
});
diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.1.normal.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.1.normal.js
index 5a032533196..2972e11edbc 100644
--- a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.1.normal.js
+++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.1.normal.js
@@ -1,7 +1,7 @@
//// [emitClassDeclarationWithPropertyAccessInHeritageClause1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
"use strict";
_class_call_check(this, B);
@@ -14,10 +14,9 @@ function foo() {
var C = /*#__PURE__*/ function(_foo_B) {
"use strict";
_inherits(C, _foo_B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(foo().B);
diff --git a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.2.minified.js b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.2.minified.js
index 5d0a7b92883..1d2e7a3661f 100644
--- a/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.2.minified.js
+++ b/crates/swc/tests/tsc-references/emitClassDeclarationWithPropertyAccessInHeritageClause1.2.minified.js
@@ -1,4 +1,4 @@
//// [emitClassDeclarationWithPropertyAccessInHeritageClause1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.1.normal.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.1.normal.js
index 9185319c91b..e3e52b7f6f9 100644
--- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.1.normal.js
@@ -246,12 +246,12 @@ var C8 = /*#__PURE__*/ function() {
return C8;
}();
//// [C9.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_async_generator } from "@swc/helpers/_/_wrap_async_generator";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
var B9 = /*#__PURE__*/ function() {
"use strict";
@@ -265,10 +265,9 @@ var B9 = /*#__PURE__*/ function() {
var C9 = /*#__PURE__*/ function(B9) {
"use strict";
_inherits(C9, B9);
- var _super = _create_super(C9);
function C9() {
_class_call_check(this, C9);
- return _super.apply(this, arguments);
+ return _call_super(this, C9, arguments);
}
var _proto = C9.prototype;
_proto.f = function f() {
diff --git a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.2.minified.js b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.2.minified.js
index 64fcc534b9d..899442218ad 100644
--- a/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/emitter.asyncGenerators.classMethods.es5.2.minified.js
@@ -40,10 +40,10 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _wrap_async_generator } from "@swc/helpers/_/_wrap_async_generator";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
//// [C9.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_async_generator } from "@swc/helpers/_/_wrap_async_generator";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js
index eba9b1254ce..3092573067d 100644
--- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js
+++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js
@@ -3,13 +3,13 @@
//super property access in instance member function of class with no base type
//super property access in instance member accessor(get and set) of class with no base type
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _set } from "@swc/helpers/_/_set";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var NoBase = /*#__PURE__*/ function() {
"use strict";
function NoBase() {
@@ -66,10 +66,10 @@ SomeBase.publicStaticMember = 0;
var SomeDerived1 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived1, SomeBase);
- var _super = _create_super(SomeDerived1);
function SomeDerived1() {
_class_call_check(this, SomeDerived1);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, SomeDerived1);
_set((_assert_this_initialized(_this), _get_prototype_of(SomeDerived1.prototype)), "publicMember", 1, _this, true);
return _this;
}
@@ -107,10 +107,10 @@ var SomeDerived1 = /*#__PURE__*/ function(SomeBase) {
var SomeDerived2 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived2, SomeBase);
- var _super = _create_super(SomeDerived2);
function SomeDerived2() {
_class_call_check(this, SomeDerived2);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, SomeDerived2);
_set((_assert_this_initialized(_this), _get_prototype_of(SomeDerived2.prototype)), "privateMember", 1, _this, true);
return _this;
}
@@ -139,10 +139,9 @@ var SomeDerived2 = /*#__PURE__*/ function(SomeBase) {
var SomeDerived3 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived3, SomeBase);
- var _super = _create_super(SomeDerived3);
function SomeDerived3() {
_class_call_check(this, SomeDerived3);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived3, arguments);
}
SomeDerived3.fn = function fn() {
_set(_get_prototype_of(SomeDerived3), "publicStaticMember", 3, this, true);
diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js
index 9649e273125..dddcc9d5be9 100644
--- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js
+++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js
@@ -1,12 +1,12 @@
//// [errorSuperPropertyAccess.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _set } from "@swc/helpers/_/_set";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var SomeBase = /*#__PURE__*/ function() {
function SomeBase() {
_class_call_check(this, SomeBase), this.privateMember = 0, this.publicMember = 0;
diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule.1.normal.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule.1.normal.js
index 4714feffd6a..0a31d833605 100644
--- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule.1.normal.js
+++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule.1.normal.js
@@ -11,18 +11,17 @@ module.exports = x;
Object.defineProperty(exports, "__esModule", {
value: true
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var foo1 = require("./foo1");
var x = foo1;
var y = /*#__PURE__*/ function(x) {
"use strict";
_inherits._(y, x);
- var _super = _create_super._(y);
function y() {
_class_call_check._(this, y);
- return _super.apply(this, arguments);
+ return _call_super._(this, y, arguments);
}
return y;
}(x);
diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule.2.minified.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule.2.minified.js
index a0650fb3445..b5fa82db94f 100644
--- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule.2.minified.js
+++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule.2.minified.js
@@ -6,4 +6,4 @@ module.exports = function x() {
//// [foo2.ts]
Object.defineProperty(exports, "__esModule", {
value: !0
-}), require("@swc/helpers/_/_class_call_check"), require("@swc/helpers/_/_inherits"), require("@swc/helpers/_/_create_super"), require("./foo1");
+}), require("@swc/helpers/_/_call_super"), require("@swc/helpers/_/_class_call_check"), require("@swc/helpers/_/_inherits"), require("./foo1");
diff --git a/crates/swc/tests/tsc-references/extendsTag1.1.normal.js b/crates/swc/tests/tsc-references/extendsTag1.1.normal.js
index 72d5a61640c..715db9d752a 100644
--- a/crates/swc/tests/tsc-references/extendsTag1.1.normal.js
+++ b/crates/swc/tests/tsc-references/extendsTag1.1.normal.js
@@ -2,17 +2,16 @@
/**
* @template T
* @extends {Set} Should prefer this Set, not the Set in the heritage clause
- */ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
+ */ import { _ as _call_super } from "@swc/helpers/_/_call_super";
+import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var My = /*#__PURE__*/ function(Set1) {
"use strict";
_inherits(My, Set1);
- var _super = _create_super(My);
function My() {
_class_call_check(this, My);
- return _super.apply(this, arguments);
+ return _call_super(this, My, arguments);
}
return My;
}(_wrap_native_super(Set));
diff --git a/crates/swc/tests/tsc-references/extendsTag1.2.minified.js b/crates/swc/tests/tsc-references/extendsTag1.2.minified.js
index 438c4bb1504..49e9ebb1c88 100644
--- a/crates/swc/tests/tsc-references/extendsTag1.2.minified.js
+++ b/crates/swc/tests/tsc-references/extendsTag1.2.minified.js
@@ -1,6 +1,6 @@
//// [bug25101.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ _wrap_native_super(Set);
diff --git a/crates/swc/tests/tsc-references/extendsTag5.1.normal.js b/crates/swc/tests/tsc-references/extendsTag5.1.normal.js
index 8d6c95fe0d0..1e4c6efc955 100644
--- a/crates/swc/tests/tsc-references/extendsTag5.1.normal.js
+++ b/crates/swc/tests/tsc-references/extendsTag5.1.normal.js
@@ -6,9 +6,9 @@
* }} Foo
*/ /**
* @template {Foo} T
-*/ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
+*/ import { _ as _call_super } from "@swc/helpers/_/_call_super";
+import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A(a) {
"use strict";
_class_call_check(this, A);
@@ -22,10 +22,9 @@ var A = function A(a) {
*/ var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -37,10 +36,9 @@ var A = function A(a) {
*/ var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C, A);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
@@ -49,10 +47,9 @@ var A = function A(a) {
*/ var D = /*#__PURE__*/ function(A) {
"use strict";
_inherits(D, A);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(A);
@@ -61,10 +58,9 @@ var A = function A(a) {
*/ var E = /*#__PURE__*/ function(A) {
"use strict";
_inherits(E, A);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
return E;
}(A);
diff --git a/crates/swc/tests/tsc-references/extendsTag5.2.minified.js b/crates/swc/tests/tsc-references/extendsTag5.2.minified.js
index 7fcacbda854..f165bea3ebb 100644
--- a/crates/swc/tests/tsc-references/extendsTag5.2.minified.js
+++ b/crates/swc/tests/tsc-references/extendsTag5.2.minified.js
@@ -1,4 +1,4 @@
//// [/a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/fluentClasses.1.normal.js b/crates/swc/tests/tsc-references/fluentClasses.1.normal.js
index 9520a12667e..fd74924be25 100644
--- a/crates/swc/tests/tsc-references/fluentClasses.1.normal.js
+++ b/crates/swc/tests/tsc-references/fluentClasses.1.normal.js
@@ -1,7 +1,7 @@
//// [fluentClasses.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -16,10 +16,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.bar = function bar() {
@@ -30,10 +29,9 @@ var B = /*#__PURE__*/ function(A) {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.baz = function baz() {
diff --git a/crates/swc/tests/tsc-references/fluentClasses.2.minified.js b/crates/swc/tests/tsc-references/fluentClasses.2.minified.js
index 7cf9efac342..0884aafea47 100644
--- a/crates/swc/tests/tsc-references/fluentClasses.2.minified.js
+++ b/crates/swc/tests/tsc-references/fluentClasses.2.minified.js
@@ -1,6 +1,6 @@
//// [fluentClasses.ts]
var c;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
c.foo().bar().baz();
diff --git a/crates/swc/tests/tsc-references/for-inStatements.1.normal.js b/crates/swc/tests/tsc-references/for-inStatements.1.normal.js
index c7617817dc5..9dedc051b68 100644
--- a/crates/swc/tests/tsc-references/for-inStatements.1.normal.js
+++ b/crates/swc/tests/tsc-references/for-inStatements.1.normal.js
@@ -1,9 +1,9 @@
//// [for-inStatements.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var aString;
for(aString in {}){}
var anAny;
@@ -57,10 +57,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.boz = function boz() {
diff --git a/crates/swc/tests/tsc-references/for-inStatements.2.minified.js b/crates/swc/tests/tsc-references/for-inStatements.2.minified.js
index 52082d1fd23..8696c45c76a 100644
--- a/crates/swc/tests/tsc-references/for-inStatements.2.minified.js
+++ b/crates/swc/tests/tsc-references/for-inStatements.2.minified.js
@@ -1,10 +1,10 @@
//// [for-inStatements.ts]
var aString, anAny, c, d, e, i, M, Color, Color1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
for(aString in {});
for(anAny in {});
for(var x in {});
diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js
index 2b658830d73..487ac6812c3 100644
--- a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js
+++ b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js
@@ -1,7 +1,7 @@
//// [forStatementsMultipleInvalidDecl.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -9,10 +9,9 @@ var C = function C() {
var C2 = /*#__PURE__*/ function(C) {
"use strict";
_inherits(C2, C);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(C);
diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.2.minified.js b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.2.minified.js
index 49956f4917a..8977be722a7 100644
--- a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.2.minified.js
+++ b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.2.minified.js
@@ -1,16 +1,14 @@
//// [forStatementsMultipleInvalidDecl.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var M, M1, a, b, arr, m, C = function C() {
_class_call_check(this, C);
}, C2 = /*#__PURE__*/ function(C) {
- _inherits(C2, C);
- var _super = _create_super(C2);
function C2() {
- return _class_call_check(this, C2), _super.apply(this, arguments);
+ return _class_call_check(this, C2), _call_super(this, C2, arguments);
}
- return C2;
+ return _inherits(C2, C), C2;
}(C), D = function D() {
_class_call_check(this, D);
};
diff --git a/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js b/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js
index 28311a67de3..433693246a5 100644
--- a/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js
+++ b/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js
@@ -1,8 +1,8 @@
//// [functionImplementationErrors.ts]
// FunctionExpression with no return type annotation with multiple return statements with unrelated types
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var f1 = function f1() {
return '';
return 3;
@@ -56,20 +56,18 @@ var AnotherClass = function AnotherClass() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
return Derived1;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/functionImplementationErrors.2.minified.js b/crates/swc/tests/tsc-references/functionImplementationErrors.2.minified.js
index 92110161cf9..dea0ea5d25f 100644
--- a/crates/swc/tests/tsc-references/functionImplementationErrors.2.minified.js
+++ b/crates/swc/tests/tsc-references/functionImplementationErrors.2.minified.js
@@ -1,4 +1,4 @@
//// [functionImplementationErrors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/functionImplementations.1.normal.js b/crates/swc/tests/tsc-references/functionImplementations.1.normal.js
index 9762e53413f..822ba8ee8f1 100644
--- a/crates/swc/tests/tsc-references/functionImplementations.1.normal.js
+++ b/crates/swc/tests/tsc-references/functionImplementations.1.normal.js
@@ -1,8 +1,8 @@
//// [functionImplementations.ts]
// FunctionExpression with no return type annotation and no return statement returns void
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var v = function() {}();
// FunctionExpression f with no return type annotation and directly references f in its body returns any
var a = function f() {
@@ -74,10 +74,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -131,10 +130,9 @@ function f6() {
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/functionImplementations.2.minified.js b/crates/swc/tests/tsc-references/functionImplementations.2.minified.js
index d10176f38b4..56fb0d02fe3 100644
--- a/crates/swc/tests/tsc-references/functionImplementations.2.minified.js
+++ b/crates/swc/tests/tsc-references/functionImplementations.2.minified.js
@@ -1,7 +1,7 @@
//// [functionImplementations.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function rec2() {
return rec2();
}
diff --git a/crates/swc/tests/tsc-references/generatedContextualTyping.1.normal.js b/crates/swc/tests/tsc-references/generatedContextualTyping.1.normal.js
index 7195d4d1056..bf0fbb30098 100644
--- a/crates/swc/tests/tsc-references/generatedContextualTyping.1.normal.js
+++ b/crates/swc/tests/tsc-references/generatedContextualTyping.1.normal.js
@@ -1,7 +1,7 @@
//// [generatedContextualTyping.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,20 +9,18 @@ var Base = function Base() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
return Derived1;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/generatedContextualTyping.2.minified.js b/crates/swc/tests/tsc-references/generatedContextualTyping.2.minified.js
index f27865fb58f..a8d99476ebb 100644
--- a/crates/swc/tests/tsc-references/generatedContextualTyping.2.minified.js
+++ b/crates/swc/tests/tsc-references/generatedContextualTyping.2.minified.js
@@ -1,23 +1,19 @@
//// [generatedContextualTyping.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var x181, x182, x183, x184, x185, x186, x187, x188, x189, x190, x191, x192, x193, x194, x195, x196, x197, x198, x199, x200, x201, x202, x203, x204, Base = function Base() {
_class_call_check(this, Base);
}, Derived1 = /*#__PURE__*/ function(Base) {
- _inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
- return _class_call_check(this, Derived1), _super.apply(this, arguments);
+ return _class_call_check(this, Derived1), _call_super(this, Derived1, arguments);
}
- return Derived1;
+ return _inherits(Derived1, Base), Derived1;
}(Base), Derived2 = /*#__PURE__*/ function(Base) {
- _inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2;
+ return _inherits(Derived2, Base), Derived2;
}(Base);
new Base();
var d1 = new Derived1(), d2 = new Derived2();
diff --git a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.1.normal.js
index 5c0737e6be0..47967bb5ae1 100644
--- a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.1.normal.js
+++ b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.1.normal.js
@@ -1,8 +1,8 @@
//// [genericCallWithConstraintsTypeArgumentInference.ts]
// Basic type inference with generic calls and constraints, no errors expected
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,20 +10,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
diff --git a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.2.minified.js
index 8363103e471..e285c87ce6d 100644
--- a/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.2.minified.js
+++ b/crates/swc/tests/tsc-references/genericCallWithConstraintsTypeArgumentInference.2.minified.js
@@ -1,7 +1,7 @@
//// [genericCallWithConstraintsTypeArgumentInference.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var b, d1, d2, i, c = new /*#__PURE__*/ (function() {
function C(t, u) {
_class_call_check(this, C), this.t = t, this.u = u;
diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.1.normal.js
index 8009cc2f783..d0ba76a008c 100644
--- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.1.normal.js
+++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.1.normal.js
@@ -1,7 +1,7 @@
//// [genericCallWithObjectTypeArgs2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,20 +9,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.2.minified.js
index 4319b63c067..bc503c50e69 100644
--- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.2.minified.js
+++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgs2.2.minified.js
@@ -1,23 +1,19 @@
//// [genericCallWithObjectTypeArgs2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var a, a1, i, Base = function Base() {
_class_call_check(this, Base);
}, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(Base), Derived2 = /*#__PURE__*/ function(Base) {
- _inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2;
+ return _inherits(Derived2, Base), Derived2;
}(Base);
function f2(a) {
return function(x) {
diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.1.normal.js
index 187d339c9ca..4c8eb9026f5 100644
--- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.1.normal.js
+++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.1.normal.js
@@ -1,9 +1,9 @@
//// [genericCallWithObjectTypeArgsAndConstraints2.ts]
// Generic call with constraints infering type parameter from object member properties
// No errors expected
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -11,10 +11,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.2.minified.js
index 7cc8fe504d9..d3234523b55 100644
--- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.2.minified.js
+++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints2.2.minified.js
@@ -1,15 +1,13 @@
//// [genericCallWithObjectTypeArgsAndConstraints2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
_class_call_check(this, Base);
}, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(Base);
new Base(), new Derived(), new Derived(), new Derived(), new Base(), new Derived(), (null)(null);
diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.1.normal.js
index 6c3d7b234f2..60b7457924c 100644
--- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.1.normal.js
+++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.1.normal.js
@@ -1,8 +1,8 @@
//// [genericCallWithObjectTypeArgsAndConstraints3.ts]
// Generic call with constraints infering type parameter from object member properties
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,20 +10,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.2.minified.js
index e6df866ccae..06d07eaad95 100644
--- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.2.minified.js
+++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints3.2.minified.js
@@ -1,23 +1,19 @@
//// [genericCallWithObjectTypeArgsAndConstraints3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var y, y1, Base = function Base() {
_class_call_check(this, Base);
}, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(Base), Derived2 = /*#__PURE__*/ function(Base) {
- _inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2;
+ return _inherits(Derived2, Base), Derived2;
}(Base);
new Derived(), new Derived2(), new Derived(), new Derived2(), new Derived(), new Derived2(), y = function(x) {
return x;
diff --git a/crates/swc/tests/tsc-references/genericClassExpressionInFunction.1.normal.js b/crates/swc/tests/tsc-references/genericClassExpressionInFunction.1.normal.js
index e5bd039aac3..433e7d1c3fc 100644
--- a/crates/swc/tests/tsc-references/genericClassExpressionInFunction.1.normal.js
+++ b/crates/swc/tests/tsc-references/genericClassExpressionInFunction.1.normal.js
@@ -1,7 +1,7 @@
//// [genericClassExpressionInFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -11,10 +11,9 @@ function B1() {
return /*#__PURE__*/ function(A) {
"use strict";
_inherits(_class, A);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(A);
@@ -24,10 +23,9 @@ var B2 = function B2() {
_class_call_check(this, B2);
this.anon = /*#__PURE__*/ function(A) {
_inherits(_class, A);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(A);
@@ -36,10 +34,9 @@ function B3() {
return /*#__PURE__*/ function(A) {
"use strict";
_inherits(Inner, A);
- var _super = _create_super(Inner);
function Inner() {
_class_call_check(this, Inner);
- return _super.apply(this, arguments);
+ return _call_super(this, Inner, arguments);
}
return Inner;
}(A);
@@ -48,20 +45,18 @@ function B3() {
var K = /*#__PURE__*/ function(_B1) {
"use strict";
_inherits(K, _B1);
- var _super = _create_super(K);
function K() {
_class_call_check(this, K);
- return _super.apply(this, arguments);
+ return _call_super(this, K, arguments);
}
return K;
}(B1());
var C = /*#__PURE__*/ function(_anon) {
"use strict";
_inherits(C, _anon);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(new B2().anon);
@@ -69,10 +64,9 @@ var b3Number = B3();
var S = /*#__PURE__*/ function(b3Number) {
"use strict";
_inherits(S, b3Number);
- var _super = _create_super(S);
function S() {
_class_call_check(this, S);
- return _super.apply(this, arguments);
+ return _call_super(this, S, arguments);
}
return S;
}(b3Number);
diff --git a/crates/swc/tests/tsc-references/genericClassExpressionInFunction.2.minified.js b/crates/swc/tests/tsc-references/genericClassExpressionInFunction.2.minified.js
index 673eab3a2c4..829cf89cdbb 100644
--- a/crates/swc/tests/tsc-references/genericClassExpressionInFunction.2.minified.js
+++ b/crates/swc/tests/tsc-references/genericClassExpressionInFunction.2.minified.js
@@ -1,52 +1,40 @@
//// [genericClassExpressionInFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
_class_call_check(this, A);
}, K = /*#__PURE__*/ function(_B1) {
- _inherits(K, _B1);
- var _super = _create_super(K);
function K() {
- return _class_call_check(this, K), _super.apply(this, arguments);
+ return _class_call_check(this, K), _call_super(this, K, arguments);
}
- return K;
+ return _inherits(K, _B1), K;
}(/*#__PURE__*/ function(A) {
- _inherits(_class, A);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, A), _class;
}(A)), C = /*#__PURE__*/ function(_anon) {
- _inherits(C, _anon);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, _anon), C;
}(new function B2() {
_class_call_check(this, B2), this.anon = /*#__PURE__*/ function(A) {
- _inherits(_class, A);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, A), _class;
}(A);
}().anon), S = /*#__PURE__*/ function(b3Number) {
- _inherits(S, b3Number);
- var _super = _create_super(S);
function S() {
- return _class_call_check(this, S), _super.apply(this, arguments);
+ return _class_call_check(this, S), _call_super(this, S, arguments);
}
- return S;
+ return _inherits(S, b3Number), S;
}(/*#__PURE__*/ function(A) {
- _inherits(Inner, A);
- var _super = _create_super(Inner);
function Inner() {
- return _class_call_check(this, Inner), _super.apply(this, arguments);
+ return _class_call_check(this, Inner), _call_super(this, Inner, arguments);
}
- return Inner;
+ return _inherits(Inner, A), Inner;
}(A)), c = new C(), k = new K(), s = new S();
c.genericVar = 12, k.genericVar = 12, s.genericVar = 12;
diff --git a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js
index 0792c151cd6..edefd284c94 100644
--- a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js
+++ b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js
@@ -1,8 +1,8 @@
//// [heterogeneousArrayLiterals.ts]
// type of an array is the best common type of its elements (plus its contextual type if it exists)
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var a = [
1,
''
@@ -110,20 +110,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.2.minified.js b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.2.minified.js
index 1af4051c1b1..57fd0178d0f 100644
--- a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.2.minified.js
+++ b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.2.minified.js
@@ -1,14 +1,12 @@
//// [heterogeneousArrayLiterals.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var WithContextualType, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(function Base() {
_class_call_check(this, Base);
});
diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js b/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js
index 62e0faad62f..9efbff590a5 100644
--- a/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js
+++ b/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js
@@ -1,7 +1,7 @@
//// [ifDoWhileStatements.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -9,10 +9,9 @@ var C = function C() {
var C2 = /*#__PURE__*/ function(C) {
"use strict";
_inherits(C2, C);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(C);
diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js b/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js
index d504ad3ffa4..7f1a907d46a 100644
--- a/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js
+++ b/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js
@@ -1,7 +1,7 @@
//// [ifDoWhileStatements.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var M, N, M1, N1, C = function C() {
_class_call_check(this, C);
}, D = function D() {
diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.1.normal.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.1.normal.js
index e6372c25b8b..6a0fbdeef86 100644
--- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.1.normal.js
+++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.1.normal.js
@@ -1,7 +1,7 @@
//// [implementingAnInterfaceExtendingClassWithPrivates2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
@@ -9,30 +9,27 @@ var Foo = function Foo() {
var Bar = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar, arguments);
}
return Bar;
}(Foo);
var Bar2 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar2, Foo);
- var _super = _create_super(Bar2);
function Bar2() {
_class_call_check(this, Bar2);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar2, arguments);
}
return Bar2;
}(Foo);
var Bar3 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar3, Foo);
- var _super = _create_super(Bar3);
function Bar3() {
_class_call_check(this, Bar3);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar3, arguments);
}
return Bar3;
}(Foo);
@@ -46,40 +43,36 @@ var M;
var Baz = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Baz, Foo);
- var _super = _create_super(Baz);
function Baz() {
_class_call_check(this, Baz);
- return _super.apply(this, arguments);
+ return _call_super(this, Baz, arguments);
}
return Baz;
}(Foo);
var Bar = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar, arguments);
}
return Bar;
}(Foo);
var Bar2 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar2, Foo);
- var _super = _create_super(Bar2);
function Bar2() {
_class_call_check(this, Bar2);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar2, arguments);
}
return Bar2;
}(Foo);
var Bar3 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar3, Foo);
- var _super = _create_super(Bar3);
function Bar3() {
_class_call_check(this, Bar3);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar3, arguments);
}
return Bar3;
}(Foo);
@@ -94,20 +87,18 @@ var M2;
var Baz = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Baz, Foo);
- var _super = _create_super(Baz);
function Baz() {
_class_call_check(this, Baz);
- return _super.apply(this, arguments);
+ return _call_super(this, Baz, arguments);
}
return Baz;
}(Foo);
var Bar = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar, arguments);
}
return Bar;
}(Foo);
@@ -118,20 +109,18 @@ var M2;
var Bar2 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar2, Foo);
- var _super = _create_super(Bar2);
function Bar2() {
_class_call_check(this, Bar2);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar2, arguments);
}
return Bar2;
}(Foo);
var Bar3 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar3, Foo);
- var _super = _create_super(Bar3);
function Bar3() {
_class_call_check(this, Bar3);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar3, arguments);
}
return Bar3;
}(Foo);
diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.2.minified.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.2.minified.js
index 3e0bd8a07bd..ad8e5419f70 100644
--- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.2.minified.js
+++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithPrivates2.2.minified.js
@@ -1,6 +1,6 @@
//// [implementingAnInterfaceExtendingClassWithPrivates2.ts]
var M, M2, b;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
M || (M = {}), M2 || (M2 = {}), b.z, b.x, b.y;
diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.1.normal.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.1.normal.js
index 3c81db67ae2..0a604995faf 100644
--- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.1.normal.js
+++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.1.normal.js
@@ -1,7 +1,7 @@
//// [implementingAnInterfaceExtendingClassWithProtecteds.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
@@ -25,40 +25,36 @@ var Bar4 = function Bar4() {
var Bar5 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar5, Foo);
- var _super = _create_super(Bar5);
function Bar5() {
_class_call_check(this, Bar5);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar5, arguments);
}
return Bar5;
}(Foo);
var Bar6 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar6, Foo);
- var _super = _create_super(Bar6);
function Bar6() {
_class_call_check(this, Bar6);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar6, arguments);
}
return Bar6;
}(Foo);
var Bar7 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar7, Foo);
- var _super = _create_super(Bar7);
function Bar7() {
_class_call_check(this, Bar7);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar7, arguments);
}
return Bar7;
}(Foo);
var Bar8 = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar8, Foo);
- var _super = _create_super(Bar8);
function Bar8() {
_class_call_check(this, Bar8);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar8, arguments);
}
return Bar8;
}(Foo);
diff --git a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.2.minified.js b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.2.minified.js
index a884b04bfe1..2100946ab23 100644
--- a/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.2.minified.js
+++ b/crates/swc/tests/tsc-references/implementingAnInterfaceExtendingClassWithProtecteds.2.minified.js
@@ -1,4 +1,4 @@
//// [implementingAnInterfaceExtendingClassWithProtecteds.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.1.normal.js
index 8fbb0c8f6a8..06065fe0808 100644
--- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.1.normal.js
+++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.1.normal.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.m = function m() {
diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.2.minified.js
index f6f1ffc9131..7035550baa7 100644
--- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.2.minified.js
+++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments3.2.minified.js
@@ -1,4 +1,4 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.1.normal.js
index df49775fed3..d5e781ea4a1 100644
--- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.1.normal.js
+++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.1.normal.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -16,10 +16,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.m = function m() {
diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.2.minified.js
index f6f1ffc9131..7035550baa7 100644
--- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.2.minified.js
+++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments4.2.minified.js
@@ -1,4 +1,4 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.1.normal.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.1.normal.js
index 12678edc384..23cea91dbda 100644
--- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.1.normal.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -16,11 +16,10 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, Derived);
// should be OK, and p should have type number from this assignment
_this.p = 1;
return _this;
diff --git a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.2.minified.js b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.2.minified.js
index f6f1ffc9131..7035550baa7 100644
--- a/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inferringClassMembersFromAssignments5.2.minified.js
@@ -1,4 +1,4 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js
index f3798561b92..7c8cfc82918 100644
--- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js
+++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js
@@ -1,8 +1,8 @@
//// [instancePropertiesInheritedIntoClassType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var NonGeneric;
(function(NonGeneric) {
var C = /*#__PURE__*/ function() {
@@ -30,10 +30,9 @@ var NonGeneric;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
@@ -71,10 +70,9 @@ var Generic;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js
index beb5ba077f9..763be03f1f5 100644
--- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js
+++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js
@@ -1,16 +1,14 @@
//// [instancePropertiesInheritedIntoClassType.ts]
var NonGeneric, Generic, d, r, d1, r1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
NonGeneric || (NonGeneric = {}), (r = (d = new /*#__PURE__*/ (function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(/*#__PURE__*/ function() {
function C(a, b) {
_class_call_check(this, C), this.a = a, this.b = b;
@@ -27,12 +25,10 @@ NonGeneric || (NonGeneric = {}), (r = (d = new /*#__PURE__*/ (function(C) {
}
]), C;
}()))(1, 2)).fn()).x, r.y, r.y = 4, d.y(), Generic || (Generic = {}), (r1 = (d1 = new /*#__PURE__*/ (function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(/*#__PURE__*/ function() {
function C(a, b) {
_class_call_check(this, C), this.a = a, this.b = b;
diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.1.normal.js
index 187326acd7a..add52a6ec4d 100644
--- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.1.normal.js
+++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.1.normal.js
@@ -1,114 +1,103 @@
//// [interfaceExtendsObjectIntersection.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C1, _Constructor);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
- return _super.apply(this, arguments);
+ return _call_super(this, C1, arguments);
}
return C1;
}(Constructor());
var C2 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C2, _Constructor);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(Constructor());
var C3 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C3, _Constructor);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
- return _super.apply(this, arguments);
+ return _call_super(this, C3, arguments);
}
return C3;
}(Constructor());
var C4 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C4, _Constructor);
- var _super = _create_super(C4);
function C4() {
_class_call_check(this, C4);
- return _super.apply(this, arguments);
+ return _call_super(this, C4, arguments);
}
return C4;
}(Constructor());
var C5 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C5, _Constructor);
- var _super = _create_super(C5);
function C5() {
_class_call_check(this, C5);
- return _super.apply(this, arguments);
+ return _call_super(this, C5, arguments);
}
return C5;
}(Constructor());
var C6 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C6, _Constructor);
- var _super = _create_super(C6);
function C6() {
_class_call_check(this, C6);
- return _super.apply(this, arguments);
+ return _call_super(this, C6, arguments);
}
return C6;
}(Constructor());
var C7 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C7, _Constructor);
- var _super = _create_super(C7);
function C7() {
_class_call_check(this, C7);
- return _super.apply(this, arguments);
+ return _call_super(this, C7, arguments);
}
return C7;
}(Constructor());
var C20 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C20, _Constructor);
- var _super = _create_super(C20);
function C20() {
_class_call_check(this, C20);
- return _super.apply(this, arguments);
+ return _call_super(this, C20, arguments);
}
return C20;
}(Constructor());
var C21 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C21, _Constructor);
- var _super = _create_super(C21);
function C21() {
_class_call_check(this, C21);
- return _super.apply(this, arguments);
+ return _call_super(this, C21, arguments);
}
return C21;
}(Constructor());
var C22 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C22, _Constructor);
- var _super = _create_super(C22);
function C22() {
_class_call_check(this, C22);
- return _super.apply(this, arguments);
+ return _call_super(this, C22, arguments);
}
return C22;
}(Constructor());
var C23 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C23, _Constructor);
- var _super = _create_super(C23);
function C23() {
_class_call_check(this, C23);
- return _super.apply(this, arguments);
+ return _call_super(this, C23, arguments);
}
return C23;
}(Constructor());
diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.2.minified.js
index 2e698bb06d7..4b46cf0f518 100644
--- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.2.minified.js
+++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersection.2.minified.js
@@ -1,5 +1,5 @@
//// [interfaceExtendsObjectIntersection.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor();
diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.1.normal.js
index 95f733f6861..9f43af8e42f 100644
--- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.1.normal.js
+++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.1.normal.js
@@ -1,54 +1,49 @@
//// [interfaceExtendsObjectIntersectionErrors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C1, _Constructor);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
- return _super.apply(this, arguments);
+ return _call_super(this, C1, arguments);
}
return C1;
}(Constructor());
var C2 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C2, _Constructor);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(Constructor());
var C3 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C3, _Constructor);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
- return _super.apply(this, arguments);
+ return _call_super(this, C3, arguments);
}
return C3;
}(Constructor());
var C4 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C4, _Constructor);
- var _super = _create_super(C4);
function C4() {
_class_call_check(this, C4);
- return _super.apply(this, arguments);
+ return _call_super(this, C4, arguments);
}
return C4;
}(Constructor());
var C5 = /*#__PURE__*/ function(_Constructor) {
"use strict";
_inherits(C5, _Constructor);
- var _super = _create_super(C5);
function C5() {
_class_call_check(this, C5);
- return _super.apply(this, arguments);
+ return _call_super(this, C5, arguments);
}
return C5;
}(Constructor());
diff --git a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.2.minified.js
index d4aa2a62fb1..9de19aa3295 100644
--- a/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.2.minified.js
+++ b/crates/swc/tests/tsc-references/interfaceExtendsObjectIntersectionErrors.2.minified.js
@@ -1,5 +1,5 @@
//// [interfaceExtendsObjectIntersectionErrors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor(), /*#__PURE__*/ Constructor();
diff --git a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js
index b08b3654fe1..2947240ed1c 100644
--- a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js
+++ b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js
@@ -1,7 +1,7 @@
//// [invalidMultipleVariableDeclarations.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -9,10 +9,9 @@ var C = function C() {
var C2 = /*#__PURE__*/ function(C) {
"use strict";
_inherits(C2, C);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(C);
diff --git a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.2.minified.js b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.2.minified.js
index c82e8ed473c..3aeecd2ab24 100644
--- a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.2.minified.js
+++ b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.2.minified.js
@@ -1,16 +1,14 @@
//// [invalidMultipleVariableDeclarations.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var M, M1, C = function C() {
_class_call_check(this, C);
}, C2 = /*#__PURE__*/ function(C) {
- _inherits(C2, C);
- var _super = _create_super(C2);
function C2() {
- return _class_call_check(this, C2), _super.apply(this, arguments);
+ return _class_call_check(this, C2), _call_super(this, C2, arguments);
}
- return C2;
+ return _inherits(C2, C), C2;
}(C), D = function D() {
_class_call_check(this, D);
};
diff --git a/crates/swc/tests/tsc-references/invalidReturnStatements.1.normal.js b/crates/swc/tests/tsc-references/invalidReturnStatements.1.normal.js
index 11b9fd74d66..5e3e49cee3a 100644
--- a/crates/swc/tests/tsc-references/invalidReturnStatements.1.normal.js
+++ b/crates/swc/tests/tsc-references/invalidReturnStatements.1.normal.js
@@ -1,8 +1,8 @@
//// [invalidReturnStatements.ts]
// all the following should be error
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function fn1() {}
function fn2() {}
function fn3() {}
@@ -20,10 +20,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/invalidReturnStatements.2.minified.js b/crates/swc/tests/tsc-references/invalidReturnStatements.2.minified.js
index 0a4cb2d90b7..60d815a5cab 100644
--- a/crates/swc/tests/tsc-references/invalidReturnStatements.2.minified.js
+++ b/crates/swc/tests/tsc-references/invalidReturnStatements.2.minified.js
@@ -1,4 +1,4 @@
//// [invalidReturnStatements.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.1.normal.js
index 50a911dfcd7..692082eb8c7 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.1.normal.js
@@ -6,9 +6,9 @@ var Bar = function Bar() {
};
module.exports = Bar;
//// [cls.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Bar = require("./bar");
var Strings = {
a: "A",
@@ -17,10 +17,9 @@ var Strings = {
var Foo = /*#__PURE__*/ function(Bar) {
"use strict";
_inherits(Foo, Bar);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- return _super.apply(this, arguments);
+ return _call_super(this, Foo, arguments);
}
return Foo;
}(Bar);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.2.minified.js
index b54218d96ad..ee659c6071a 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility.2.minified.js
@@ -4,16 +4,14 @@ module.exports = function Bar() {
_class_call_check(this, Bar);
};
//// [cls.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = /*#__PURE__*/ function(Bar) {
- _inherits(Foo, Bar);
- var _super = _create_super(Foo);
function Foo() {
- return _class_call_check(this, Foo), _super.apply(this, arguments);
+ return _class_call_check(this, Foo), _call_super(this, Foo, arguments);
}
- return Foo;
+ return _inherits(Foo, Bar), Foo;
}(require("./bar"));
module.exports = Foo, module.exports.Strings = {
a: "A",
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.1.normal.js
index dec845a1d7b..8643c057214 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.1.normal.js
@@ -1,7 +1,7 @@
//// [Foo.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,26 +10,24 @@ Base.foo = "";
export var Foo = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Foo, Base);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- return _super.apply(this, arguments);
+ return _call_super(this, Foo, arguments);
}
return Foo;
}(Base);
Foo.foo = "foo";
//// [Bar.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { Foo } from "./Foo.js";
var Bar = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar, arguments);
}
return Bar;
}(Foo);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.2.minified.js
index a94a45d432b..93e4bfcc274 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassStatic2.2.minified.js
@@ -1,30 +1,26 @@
//// [Foo.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
_class_call_check(this, Base);
};
Base.foo = "";
export var Foo = /*#__PURE__*/ function(Base) {
- _inherits(Foo, Base);
- var _super = _create_super(Foo);
function Foo() {
- return _class_call_check(this, Foo), _super.apply(this, arguments);
+ return _class_call_check(this, Foo), _call_super(this, Foo, arguments);
}
- return Foo;
+ return _inherits(Foo, Base), Foo;
}(Base);
Foo.foo = "foo";
//// [Bar.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { Foo } from "./Foo.js";
/*#__PURE__*/ (function(Foo) {
- _inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
- return _class_call_check(this, Bar), _super.apply(this, arguments);
+ return _class_call_check(this, Bar), _call_super(this, Bar, arguments);
}
- return Bar;
+ return _inherits(Bar, Foo), Bar;
})(Foo).foo = "foo";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClasses.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClasses.1.normal.js
index e1c5f76d98b..54a209165fb 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClasses.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClasses.1.normal.js
@@ -1,9 +1,10 @@
//// [index.js]
+import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -141,21 +142,19 @@ export var K = /*#__PURE__*/ function() {
export var L = /*#__PURE__*/ function(K) {
"use strict";
_inherits(L, K);
- var _super = _create_super(L);
function L() {
_class_call_check(this, L);
- return _super.apply(this, arguments);
+ return _call_super(this, L, arguments);
}
return L;
}(K);
export var M = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(M, _superClass);
- var _super = _create_super(M);
function M() {
_class_call_check(this, M);
var _this;
- _this.prop = 12;
+ _assert_this_initialized(_this).prop = 12;
return _possible_constructor_return(_this);
}
return M;
@@ -165,11 +164,10 @@ export var M = /*#__PURE__*/ function(_superClass) {
*/ export var N = /*#__PURE__*/ function(L) {
"use strict";
_inherits(N, L);
- var _super = _create_super(N);
function N(param) {
_class_call_check(this, N);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, N);
_this.another = param;
return _this;
}
@@ -181,11 +179,12 @@ export var M = /*#__PURE__*/ function(_superClass) {
*/ export var O = /*#__PURE__*/ function(N) {
"use strict";
_inherits(O, N);
- var _super = _create_super(O);
function O(param) {
_class_call_check(this, O);
var _this;
- _this = _super.call(this, param);
+ _this = _call_super(this, O, [
+ param
+ ]);
_this.another2 = param;
return _this;
}
@@ -195,10 +194,9 @@ var x = /** @type {*} */ null;
export var VariableBase = /*#__PURE__*/ function(x) {
"use strict";
_inherits(VariableBase, x);
- var _super = _create_super(VariableBase);
function VariableBase() {
_class_call_check(this, VariableBase);
- return _super.apply(this, arguments);
+ return _call_super(this, VariableBase, arguments);
}
return VariableBase;
}(x);
@@ -213,10 +211,9 @@ export var HasStatics = /*#__PURE__*/ function() {
export var ExtendsStatics = /*#__PURE__*/ function(HasStatics) {
"use strict";
_inherits(ExtendsStatics, HasStatics);
- var _super = _create_super(ExtendsStatics);
function ExtendsStatics() {
_class_call_check(this, ExtendsStatics);
- return _super.apply(this, arguments);
+ return _call_super(this, ExtendsStatics, arguments);
}
ExtendsStatics.also = function also() {};
return ExtendsStatics;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClasses.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClasses.2.minified.js
index 55fef190996..7d20b5adbec 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClasses.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClasses.2.minified.js
@@ -1,9 +1,10 @@
//// [index.js]
+import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var A = function A() {
_class_call_check(this, A);
};
@@ -92,45 +93,39 @@ export var K = /*#__PURE__*/ function() {
}, K;
}();
export var L = /*#__PURE__*/ function(K) {
- _inherits(L, K);
- var _super = _create_super(L);
function L() {
- return _class_call_check(this, L), _super.apply(this, arguments);
+ return _class_call_check(this, L), _call_super(this, L, arguments);
}
- return L;
+ return _inherits(L, K), L;
}(K);
export var M = /*#__PURE__*/ function(_superClass) {
function M() {
var _this;
- return _class_call_check(this, M), _this.prop = 12, _possible_constructor_return(_this);
+ return _class_call_check(this, M), _assert_this_initialized(_this).prop = 12, _possible_constructor_return(_this);
}
- return _inherits(M, null), _create_super(M), M;
+ return _inherits(M, null), M;
}(0);
export var N = /*#__PURE__*/ function(L) {
- _inherits(N, L);
- var _super = _create_super(N);
function N(param) {
var _this;
- return _class_call_check(this, N), (_this = _super.call(this)).another = param, _this;
+ return _class_call_check(this, N), (_this = _call_super(this, N)).another = param, _this;
}
- return N;
+ return _inherits(N, L), N;
}(L);
export var O = /*#__PURE__*/ function(N) {
- _inherits(O, N);
- var _super = _create_super(O);
function O(param) {
var _this;
- return _class_call_check(this, O), (_this = _super.call(this, param)).another2 = param, _this;
+ return _class_call_check(this, O), (_this = _call_super(this, O, [
+ param
+ ])).another2 = param, _this;
}
- return O;
+ return _inherits(O, N), O;
}(N);
export var VariableBase = /*#__PURE__*/ function(x) {
- _inherits(VariableBase, x);
- var _super = _create_super(VariableBase);
function VariableBase() {
- return _class_call_check(this, VariableBase), _super.apply(this, arguments);
+ return _class_call_check(this, VariableBase), _call_super(this, VariableBase, arguments);
}
- return VariableBase;
+ return _inherits(VariableBase, x), VariableBase;
}(null);
export var HasStatics = /*#__PURE__*/ function() {
function HasStatics() {
@@ -139,11 +134,9 @@ export var HasStatics = /*#__PURE__*/ function() {
return HasStatics.staticMethod = function() {}, HasStatics;
}();
export var ExtendsStatics = /*#__PURE__*/ function(HasStatics) {
- _inherits(ExtendsStatics, HasStatics);
- var _super = _create_super(ExtendsStatics);
function ExtendsStatics() {
- return _class_call_check(this, ExtendsStatics), _super.apply(this, arguments);
+ return _class_call_check(this, ExtendsStatics), _call_super(this, ExtendsStatics, arguments);
}
- return ExtendsStatics.also = function() {}, ExtendsStatics;
+ return _inherits(ExtendsStatics, HasStatics), ExtendsStatics.also = function() {}, ExtendsStatics;
}(HasStatics);
export { G, HH as H, I as II, J as JJ };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.1.normal.js
index c4a895cb614..d5387505a86 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.1.normal.js
@@ -1,9 +1,9 @@
//// [index.js]
// Pretty much all of this should be an error, (since index signatures and generics are forbidden in js),
// but we should be able to synthesize declarations from the symbols regardless
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var M = function M() {
"use strict";
_class_call_check(this, M);
@@ -11,10 +11,9 @@ export var M = function M() {
export var N = /*#__PURE__*/ function(M) {
"use strict";
_inherits(N, M);
- var _super = _create_super(N);
function N() {
_class_call_check(this, N);
- return _super.apply(this, arguments);
+ return _call_super(this, N, arguments);
}
return N;
}(M);
@@ -25,40 +24,36 @@ export var O = function O() {
export var P = /*#__PURE__*/ function(O) {
"use strict";
_inherits(P, O);
- var _super = _create_super(P);
function P() {
_class_call_check(this, P);
- return _super.apply(this, arguments);
+ return _call_super(this, P, arguments);
}
return P;
}(O);
export var Q = /*#__PURE__*/ function(O) {
"use strict";
_inherits(Q, O);
- var _super = _create_super(Q);
function Q() {
_class_call_check(this, Q);
- return _super.apply(this, arguments);
+ return _call_super(this, Q, arguments);
}
return Q;
}(O);
export var R = /*#__PURE__*/ function(O) {
"use strict";
_inherits(R, O);
- var _super = _create_super(R);
function R() {
_class_call_check(this, R);
- return _super.apply(this, arguments);
+ return _call_super(this, R, arguments);
}
return R;
}(O);
export var S = /*#__PURE__*/ function(O) {
"use strict";
_inherits(S, O);
- var _super = _create_super(S);
function S() {
_class_call_check(this, S);
- return _super.apply(this, arguments);
+ return _call_super(this, S, arguments);
}
return S;
}(O);
@@ -69,40 +64,36 @@ export var T = function T() {
export var U = /*#__PURE__*/ function(T) {
"use strict";
_inherits(U, T);
- var _super = _create_super(U);
function U() {
_class_call_check(this, U);
- return _super.apply(this, arguments);
+ return _call_super(this, U, arguments);
}
return U;
}(T);
export var V = /*#__PURE__*/ function(T) {
"use strict";
_inherits(V, T);
- var _super = _create_super(V);
function V() {
_class_call_check(this, V);
- return _super.apply(this, arguments);
+ return _call_super(this, V, arguments);
}
return V;
}(T);
export var W = /*#__PURE__*/ function(T) {
"use strict";
_inherits(W, T);
- var _super = _create_super(W);
function W() {
_class_call_check(this, W);
- return _super.apply(this, arguments);
+ return _call_super(this, W, arguments);
}
return W;
}(T);
export var X = /*#__PURE__*/ function(T) {
"use strict";
_inherits(X, T);
- var _super = _create_super(X);
function X() {
_class_call_check(this, X);
- return _super.apply(this, arguments);
+ return _call_super(this, X, arguments);
}
return X;
}(T);
@@ -113,40 +104,36 @@ export var Y = function Y() {
export var Z = /*#__PURE__*/ function(Y) {
"use strict";
_inherits(Z, Y);
- var _super = _create_super(Z);
function Z() {
_class_call_check(this, Z);
- return _super.apply(this, arguments);
+ return _call_super(this, Z, arguments);
}
return Z;
}(Y);
export var AA = /*#__PURE__*/ function(Y) {
"use strict";
_inherits(AA, Y);
- var _super = _create_super(AA);
function AA() {
_class_call_check(this, AA);
- return _super.apply(this, arguments);
+ return _call_super(this, AA, arguments);
}
return AA;
}(Y);
export var BB = /*#__PURE__*/ function(Y) {
"use strict";
_inherits(BB, Y);
- var _super = _create_super(BB);
function BB() {
_class_call_check(this, BB);
- return _super.apply(this, arguments);
+ return _call_super(this, BB, arguments);
}
return BB;
}(Y);
export var CC = /*#__PURE__*/ function(Y) {
"use strict";
_inherits(CC, Y);
- var _super = _create_super(CC);
function CC() {
_class_call_check(this, CC);
- return _super.apply(this, arguments);
+ return _call_super(this, CC, arguments);
}
return CC;
}(Y);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.2.minified.js
index 53bb8a2a2ae..d98e124bc10 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassesErr.2.minified.js
@@ -1,120 +1,94 @@
//// [index.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var M = function M() {
_class_call_check(this, M);
};
export var N = /*#__PURE__*/ function(M) {
- _inherits(N, M);
- var _super = _create_super(N);
function N() {
- return _class_call_check(this, N), _super.apply(this, arguments);
+ return _class_call_check(this, N), _call_super(this, N, arguments);
}
- return N;
+ return _inherits(N, M), N;
}(M);
export var O = function O() {
_class_call_check(this, O);
};
export var P = /*#__PURE__*/ function(O) {
- _inherits(P, O);
- var _super = _create_super(P);
function P() {
- return _class_call_check(this, P), _super.apply(this, arguments);
+ return _class_call_check(this, P), _call_super(this, P, arguments);
}
- return P;
+ return _inherits(P, O), P;
}(O);
export var Q = /*#__PURE__*/ function(O) {
- _inherits(Q, O);
- var _super = _create_super(Q);
function Q() {
- return _class_call_check(this, Q), _super.apply(this, arguments);
+ return _class_call_check(this, Q), _call_super(this, Q, arguments);
}
- return Q;
+ return _inherits(Q, O), Q;
}(O);
export var R = /*#__PURE__*/ function(O) {
- _inherits(R, O);
- var _super = _create_super(R);
function R() {
- return _class_call_check(this, R), _super.apply(this, arguments);
+ return _class_call_check(this, R), _call_super(this, R, arguments);
}
- return R;
+ return _inherits(R, O), R;
}(O);
export var S = /*#__PURE__*/ function(O) {
- _inherits(S, O);
- var _super = _create_super(S);
function S() {
- return _class_call_check(this, S), _super.apply(this, arguments);
+ return _class_call_check(this, S), _call_super(this, S, arguments);
}
- return S;
+ return _inherits(S, O), S;
}(O);
export var T = function T() {
_class_call_check(this, T);
};
export var U = /*#__PURE__*/ function(T) {
- _inherits(U, T);
- var _super = _create_super(U);
function U() {
- return _class_call_check(this, U), _super.apply(this, arguments);
+ return _class_call_check(this, U), _call_super(this, U, arguments);
}
- return U;
+ return _inherits(U, T), U;
}(T);
export var V = /*#__PURE__*/ function(T) {
- _inherits(V, T);
- var _super = _create_super(V);
function V() {
- return _class_call_check(this, V), _super.apply(this, arguments);
+ return _class_call_check(this, V), _call_super(this, V, arguments);
}
- return V;
+ return _inherits(V, T), V;
}(T);
export var W = /*#__PURE__*/ function(T) {
- _inherits(W, T);
- var _super = _create_super(W);
function W() {
- return _class_call_check(this, W), _super.apply(this, arguments);
+ return _class_call_check(this, W), _call_super(this, W, arguments);
}
- return W;
+ return _inherits(W, T), W;
}(T);
export var X = /*#__PURE__*/ function(T) {
- _inherits(X, T);
- var _super = _create_super(X);
function X() {
- return _class_call_check(this, X), _super.apply(this, arguments);
+ return _class_call_check(this, X), _call_super(this, X, arguments);
}
- return X;
+ return _inherits(X, T), X;
}(T);
export var Y = function Y() {
_class_call_check(this, Y);
};
export var Z = /*#__PURE__*/ function(Y) {
- _inherits(Z, Y);
- var _super = _create_super(Z);
function Z() {
- return _class_call_check(this, Z), _super.apply(this, arguments);
+ return _class_call_check(this, Z), _call_super(this, Z, arguments);
}
- return Z;
+ return _inherits(Z, Y), Z;
}(Y);
export var AA = /*#__PURE__*/ function(Y) {
- _inherits(AA, Y);
- var _super = _create_super(AA);
function AA() {
- return _class_call_check(this, AA), _super.apply(this, arguments);
+ return _class_call_check(this, AA), _call_super(this, AA, arguments);
}
- return AA;
+ return _inherits(AA, Y), AA;
}(Y);
export var BB = /*#__PURE__*/ function(Y) {
- _inherits(BB, Y);
- var _super = _create_super(BB);
function BB() {
- return _class_call_check(this, BB), _super.apply(this, arguments);
+ return _class_call_check(this, BB), _call_super(this, BB, arguments);
}
- return BB;
+ return _inherits(BB, Y), BB;
}(Y);
export var CC = /*#__PURE__*/ function(Y) {
- _inherits(CC, Y);
- var _super = _create_super(CC);
function CC() {
- return _class_call_check(this, CC), _super.apply(this, arguments);
+ return _class_call_check(this, CC), _call_super(this, CC, arguments);
}
- return CC;
+ return _inherits(CC, Y), CC;
}(Y);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault.1.normal.js
index c8c4e75ce37..2161171c4cd 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefault.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault.1.normal.js
@@ -17,18 +17,17 @@ export { Foo as default };
export var X = Foo;
export { Foo as Bar };
//// [index4.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import Fab from "./index3";
var Bar = /*#__PURE__*/ function(Fab) {
"use strict";
_inherits(Bar, Fab);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Bar, arguments);
_this.x = /** @type {Bar} */ null;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault.2.minified.js
index 5cd468f9fa3..7f2a8c64ad4 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefault.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault.2.minified.js
@@ -14,18 +14,16 @@ var Foo = function Foo() {
export var X = Foo;
export { Foo as default, Foo as Bar };
//// [index4.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import Fab from "./index3";
var Bar = /*#__PURE__*/ function(Fab) {
- _inherits(Bar, Fab);
- var _super = _create_super(Bar);
function Bar() {
var _this;
- return _class_call_check(this, Bar), _this = _super.apply(this, arguments), _this.x = null, _this;
+ return _class_call_check(this, Bar), _this = _call_super(this, Bar, arguments), _this.x = null, _this;
}
- return Bar;
+ return _inherits(Bar, Fab), Bar;
}(Fab);
export default Bar;
//// [index5.js]
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.1.normal.js
index 2b1e8b805a3..2f55ba6b319 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.1.normal.js
@@ -1,15 +1,16 @@
//// [utils/errors.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var FancyError = /*#__PURE__*/ function(Error1) {
"use strict";
_inherits(FancyError, Error1);
- var _super = _create_super(FancyError);
function FancyError(status) {
_class_call_check(this, FancyError);
- return _super.call(this, "error with status ".concat(status));
+ return _call_super(this, FancyError, [
+ "error with status ".concat(status)
+ ]);
}
return FancyError;
}(_wrap_native_super(Error));
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.2.minified.js
index 216d6a6be85..a4caed1577e 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportedClassAliases.2.minified.js
@@ -1,15 +1,15 @@
//// [utils/errors.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var FancyError = /*#__PURE__*/ function(Error1) {
- _inherits(FancyError, Error1);
- var _super = _create_super(FancyError);
function FancyError(status) {
- return _class_call_check(this, FancyError), _super.call(this, "error with status ".concat(status));
+ return _class_call_check(this, FancyError), _call_super(this, FancyError, [
+ "error with status ".concat(status)
+ ]);
}
- return FancyError;
+ return _inherits(FancyError, Error1), FancyError;
}(_wrap_native_super(Error));
module.exports = {
FancyError: FancyError
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js
index 23a326ffec1..d41c68eaffb 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js
@@ -1,7 +1,7 @@
//// [index.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var Super = function Super(firstArg, secondArg) {
"use strict";
_class_call_check(this, Super);
@@ -9,10 +9,12 @@ export var Super = function Super(firstArg, secondArg) {
export var Sub = /*#__PURE__*/ function(Super) {
"use strict";
_inherits(Sub, Super);
- var _super = _create_super(Sub);
function Sub() {
_class_call_check(this, Sub);
- return _super.call(this, 'first', 'second');
+ return _call_super(this, Sub, [
+ 'first',
+ 'second'
+ ]);
}
return Sub;
}(Super);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js
index 7f783bbbd13..213bd710551 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js
@@ -1,15 +1,16 @@
//// [index.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var Super = function Super(firstArg, secondArg) {
_class_call_check(this, Super);
};
export var Sub = /*#__PURE__*/ function(Super) {
- _inherits(Sub, Super);
- var _super = _create_super(Sub);
function Sub() {
- return _class_call_check(this, Sub), _super.call(this, 'first', 'second');
+ return _class_call_check(this, Sub), _call_super(this, Sub, [
+ 'first',
+ 'second'
+ ]);
}
- return Sub;
+ return _inherits(Sub, Super), Sub;
}(Super);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.1.normal.js
index 43c09117400..a22dca0545a 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.1.normal.js
@@ -1,7 +1,7 @@
//// [index.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -16,10 +16,9 @@ export var A = /*#__PURE__*/ function() {
var Base = /*#__PURE__*/ function(A) {
"use strict";
_inherits(Base, A);
- var _super = _create_super(Base);
function Base() {
_class_call_check(this, Base);
- return _super.apply(this, arguments);
+ return _call_super(this, Base, arguments);
}
var _proto = Base.prototype;
// This method is required to reproduce #35932
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.2.minified.js
index 9935e6df486..42a0adcd471 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsThisTypes.2.minified.js
@@ -1,7 +1,7 @@
//// [index.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var A = /*#__PURE__*/ function() {
function A() {
_class_call_check(this, A);
@@ -11,11 +11,9 @@ export var A = /*#__PURE__*/ function() {
}, A;
}();
var Base = /*#__PURE__*/ function(A) {
- _inherits(Base, A);
- var _super = _create_super(Base);
function Base() {
- return _class_call_check(this, Base), _super.apply(this, arguments);
+ return _class_call_check(this, Base), _call_super(this, Base, arguments);
}
- return Base.prototype.verify = function() {}, Base;
+ return _inherits(Base, A), Base.prototype.verify = function() {}, Base;
}(A);
export { Base as default };
diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js
index 81754e43853..4cf3451ee77 100644
--- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js
+++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js
@@ -1,7 +1,7 @@
//// [keyofAndIndexedAccess.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Shape = function Shape() {
"use strict";
_class_call_check(this, Shape);
@@ -9,10 +9,9 @@ var Shape = function Shape() {
var TaggedShape = /*#__PURE__*/ function(Shape) {
"use strict";
_inherits(TaggedShape, Shape);
- var _super = _create_super(TaggedShape);
function TaggedShape() {
_class_call_check(this, TaggedShape);
- return _super.apply(this, arguments);
+ return _call_super(this, TaggedShape, arguments);
}
return TaggedShape;
}(Shape);
@@ -329,11 +328,10 @@ var Base = /*#__PURE__*/ function() {
var Person = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Person, Base);
- var _super = _create_super(Person);
function Person(parts) {
_class_call_check(this, Person);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, Person);
_this.set("parts", parts);
return _this;
}
@@ -467,10 +465,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.f = function f(p) {
@@ -499,13 +496,14 @@ var SampleClass = function SampleClass(props) {
var AnotherSampleClass = /*#__PURE__*/ function(SampleClass) {
"use strict";
_inherits(AnotherSampleClass, SampleClass);
- var _super = _create_super(AnotherSampleClass);
function AnotherSampleClass(props) {
_class_call_check(this, AnotherSampleClass);
var foo = {
foo: "bar"
};
- return _super.call(this, merge(props, foo));
+ return _call_super(this, AnotherSampleClass, [
+ merge(props, foo)
+ ]);
}
var _proto = AnotherSampleClass.prototype;
_proto.brokenMethod = function brokenMethod() {
diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.2.minified.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.2.minified.js
index c48bf719bd1..db3d278ffc4 100644
--- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.2.minified.js
+++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.2.minified.js
@@ -1,8 +1,8 @@
//// [keyofAndIndexedAccess.ts]
var Flag, Flag1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
one(function() {}), on({
test: function() {}
}), on({
@@ -15,14 +15,14 @@ one(function() {}), on({
"hello",
35
]), new /*#__PURE__*/ (function(SampleClass) {
- _inherits(AnotherSampleClass, SampleClass);
- var _super = _create_super(AnotherSampleClass);
function AnotherSampleClass(props) {
- return _class_call_check(this, AnotherSampleClass), _super.call(this, merge(props, {
- foo: "bar"
- }));
+ return _class_call_check(this, AnotherSampleClass), _call_super(this, AnotherSampleClass, [
+ merge(props, {
+ foo: "bar"
+ })
+ ]);
}
- return AnotherSampleClass.prototype.brokenMethod = function() {
+ return _inherits(AnotherSampleClass, SampleClass), AnotherSampleClass.prototype.brokenMethod = function() {
this.props.foo.concat;
}, AnotherSampleClass;
}(function SampleClass(props) {
diff --git a/crates/swc/tests/tsc-references/localTypes1.1.normal.js b/crates/swc/tests/tsc-references/localTypes1.1.normal.js
index 57c69351662..34b3ee831a7 100644
--- a/crates/swc/tests/tsc-references/localTypes1.1.normal.js
+++ b/crates/swc/tests/tsc-references/localTypes1.1.normal.js
@@ -1,8 +1,8 @@
//// [localTypes1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function f1() {
var E;
(function(E) {
@@ -154,10 +154,9 @@ function f6() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -165,10 +164,9 @@ function f6() {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
diff --git a/crates/swc/tests/tsc-references/localTypes1.2.minified.js b/crates/swc/tests/tsc-references/localTypes1.2.minified.js
index 16b10e4ab5d..87efd39481d 100644
--- a/crates/swc/tests/tsc-references/localTypes1.2.minified.js
+++ b/crates/swc/tests/tsc-references/localTypes1.2.minified.js
@@ -1,5 +1,5 @@
//// [localTypes1.ts]
+import "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import "@swc/helpers/_/_inherits";
-import "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/mergedInheritedClassInterface.1.normal.js b/crates/swc/tests/tsc-references/mergedInheritedClassInterface.1.normal.js
index 859caf170eb..1520573877a 100644
--- a/crates/swc/tests/tsc-references/mergedInheritedClassInterface.1.normal.js
+++ b/crates/swc/tests/tsc-references/mergedInheritedClassInterface.1.normal.js
@@ -1,7 +1,7 @@
//// [mergedInheritedClassInterface.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var BaseClass = /*#__PURE__*/ function() {
"use strict";
function BaseClass() {
@@ -14,10 +14,9 @@ var BaseClass = /*#__PURE__*/ function() {
var Child = /*#__PURE__*/ function(BaseClass) {
"use strict";
_inherits(Child, BaseClass);
- var _super = _create_super(Child);
function Child() {
_class_call_check(this, Child);
- return _super.apply(this, arguments);
+ return _call_super(this, Child, arguments);
}
var _proto = Child.prototype;
_proto.method = function method() {};
@@ -35,10 +34,9 @@ var ChildNoBaseClass = /*#__PURE__*/ function() {
var Grandchild = /*#__PURE__*/ function(ChildNoBaseClass) {
"use strict";
_inherits(Grandchild, ChildNoBaseClass);
- var _super = _create_super(Grandchild);
function Grandchild() {
_class_call_check(this, Grandchild);
- return _super.apply(this, arguments);
+ return _call_super(this, Grandchild, arguments);
}
return Grandchild;
}(ChildNoBaseClass);
diff --git a/crates/swc/tests/tsc-references/mergedInheritedClassInterface.2.minified.js b/crates/swc/tests/tsc-references/mergedInheritedClassInterface.2.minified.js
index 67cdc53301e..fc0b519eb3f 100644
--- a/crates/swc/tests/tsc-references/mergedInheritedClassInterface.2.minified.js
+++ b/crates/swc/tests/tsc-references/mergedInheritedClassInterface.2.minified.js
@@ -1,6 +1,6 @@
//// [mergedInheritedClassInterface.ts]
var child, grandchild;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
child.required, child.optional, child.additional, child.baseNumber, child.classNumber, child.baseMethod(), child.method(), grandchild.required, grandchild.optional, grandchild.additional2, grandchild.classString, grandchild.method2();
diff --git a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.1.normal.js b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.1.normal.js
index 39220158d76..0bf8ed6c130 100644
--- a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.1.normal.js
+++ b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.1.normal.js
@@ -1,7 +1,7 @@
//// [mergedInheritedMembersSatisfyAbstractBase.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var BaseClass = function BaseClass() {
"use strict";
_class_call_check(this, BaseClass);
@@ -9,10 +9,9 @@ var BaseClass = function BaseClass() {
var Broken = /*#__PURE__*/ function(BaseClass) {
"use strict";
_inherits(Broken, BaseClass);
- var _super = _create_super(Broken);
function Broken() {
_class_call_check(this, Broken);
- return _super.apply(this, arguments);
+ return _call_super(this, Broken, arguments);
}
return Broken;
}(BaseClass);
@@ -20,10 +19,9 @@ new Broken().bar;
var IncorrectlyExtends = /*#__PURE__*/ function(BaseClass) {
"use strict";
_inherits(IncorrectlyExtends, BaseClass);
- var _super = _create_super(IncorrectlyExtends);
function IncorrectlyExtends() {
_class_call_check(this, IncorrectlyExtends);
- return _super.apply(this, arguments);
+ return _call_super(this, IncorrectlyExtends, arguments);
}
return IncorrectlyExtends;
}(BaseClass);
diff --git a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.2.minified.js b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.2.minified.js
index 289f23e5084..cc4e187df1f 100644
--- a/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.2.minified.js
+++ b/crates/swc/tests/tsc-references/mergedInheritedMembersSatisfyAbstractBase.2.minified.js
@@ -1,14 +1,12 @@
//// [mergedInheritedMembersSatisfyAbstractBase.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
new /*#__PURE__*/ (function(BaseClass) {
- _inherits(Broken, BaseClass);
- var _super = _create_super(Broken);
function Broken() {
- return _class_call_check(this, Broken), _super.apply(this, arguments);
+ return _class_call_check(this, Broken), _call_super(this, Broken, arguments);
}
- return Broken;
+ return _inherits(Broken, BaseClass), Broken;
}(function BaseClass() {
_class_call_check(this, BaseClass);
}))().bar;
diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.1.normal.js
index 1d60c82944f..b8c73e162f4 100644
--- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.1.normal.js
+++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.1.normal.js
@@ -1,7 +1,7 @@
//// [mergedInterfacesWithInheritedPrivates2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -13,20 +13,18 @@ var C2 = function C2() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
var E = /*#__PURE__*/ function(C2) {
"use strict";
_inherits(E, C2);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
return E;
}(C2);
diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.2.minified.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.2.minified.js
index 09e8414a88e..54b5cd72a49 100644
--- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.2.minified.js
+++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates2.2.minified.js
@@ -1,6 +1,6 @@
//// [mergedInterfacesWithInheritedPrivates2.ts]
var a;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
a.x, a.w;
diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.1.normal.js
index 9fff654beee..e43b4ae6ef4 100644
--- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.1.normal.js
+++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.1.normal.js
@@ -1,7 +1,7 @@
//// [mergedInterfacesWithInheritedPrivates3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -13,10 +13,9 @@ var C2 = function C2() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.2.minified.js b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.2.minified.js
index 4725871957a..a992383f057 100644
--- a/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.2.minified.js
+++ b/crates/swc/tests/tsc-references/mergedInterfacesWithInheritedPrivates3.2.minified.js
@@ -1,6 +1,6 @@
//// [mergedInterfacesWithInheritedPrivates3.ts]
var M;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
M || (M = {});
diff --git a/crates/swc/tests/tsc-references/mixinAccessModifiers.1.normal.js b/crates/swc/tests/tsc-references/mixinAccessModifiers.1.normal.js
index 43b5fa38c6b..14614fedf3d 100644
--- a/crates/swc/tests/tsc-references/mixinAccessModifiers.1.normal.js
+++ b/crates/swc/tests/tsc-references/mixinAccessModifiers.1.normal.js
@@ -1,7 +1,7 @@
//// [mixinAccessModifiers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Private = function Private() {
"use strict";
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
@@ -66,40 +66,36 @@ function f6(x) {
var C1 = /*#__PURE__*/ function(_Mix) {
"use strict";
_inherits(C1, _Mix);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
- return _super.apply(this, arguments);
+ return _call_super(this, C1, arguments);
}
return C1;
}(Mix(Private, Private2));
var C2 = /*#__PURE__*/ function(_Mix) {
"use strict";
_inherits(C2, _Mix);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(Mix(Private, Protected));
var C3 = /*#__PURE__*/ function(_Mix) {
"use strict";
_inherits(C3, _Mix);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
- return _super.apply(this, arguments);
+ return _call_super(this, C3, arguments);
}
return C3;
}(Mix(Private, Public));
var C4 = /*#__PURE__*/ function(_Mix) {
"use strict";
_inherits(C4, _Mix);
- var _super = _create_super(C4);
function C4() {
_class_call_check(this, C4);
- return _super.apply(this, arguments);
+ return _call_super(this, C4, arguments);
}
var _proto = C4.prototype;
_proto.f = function f(c4, c5, c6) {
@@ -117,10 +113,9 @@ var C4 = /*#__PURE__*/ function(_Mix) {
var C5 = /*#__PURE__*/ function(_Mix) {
"use strict";
_inherits(C5, _Mix);
- var _super = _create_super(C5);
function C5() {
_class_call_check(this, C5);
- return _super.apply(this, arguments);
+ return _call_super(this, C5, arguments);
}
var _proto = C5.prototype;
_proto.f = function f(c4, c5, c6) {
@@ -138,10 +133,9 @@ var C5 = /*#__PURE__*/ function(_Mix) {
var C6 = /*#__PURE__*/ function(_Mix) {
"use strict";
_inherits(C6, _Mix);
- var _super = _create_super(C6);
function C6() {
_class_call_check(this, C6);
- return _super.apply(this, arguments);
+ return _call_super(this, C6, arguments);
}
var _proto = C6.prototype;
_proto.f = function f(c4, c5, c6) {
diff --git a/crates/swc/tests/tsc-references/mixinAccessModifiers.2.minified.js b/crates/swc/tests/tsc-references/mixinAccessModifiers.2.minified.js
index 437223fa14e..ac13f01ebd0 100644
--- a/crates/swc/tests/tsc-references/mixinAccessModifiers.2.minified.js
+++ b/crates/swc/tests/tsc-references/mixinAccessModifiers.2.minified.js
@@ -1,7 +1,7 @@
//// [mixinAccessModifiers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Private = function Private() {
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
_class_call_check(this, Private);
@@ -17,12 +17,10 @@ var Private = function Private() {
_class_call_check(this, Private2);
}), /*#__PURE__*/ Mix(Private, Protected), /*#__PURE__*/ Mix(Private, Public);
var C4 = /*#__PURE__*/ function(_Mix) {
- _inherits(C4, _Mix);
- var _super = _create_super(C4);
function C4() {
- return _class_call_check(this, C4), _super.apply(this, arguments);
+ return _class_call_check(this, C4), _call_super(this, C4, arguments);
}
- return C4.prototype.f = function(c4, c5, c6) {
+ return _inherits(C4, _Mix), C4.prototype.f = function(c4, c5, c6) {
c4.p, c5.p, c6.p;
}, C4.g = function() {
C4.s, C5.s, C6.s;
@@ -31,23 +29,19 @@ var C4 = /*#__PURE__*/ function(_Mix) {
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
_class_call_check(this, Protected2);
})), C5 = /*#__PURE__*/ function(_Mix) {
- _inherits(C5, _Mix);
- var _super = _create_super(C5);
function C5() {
- return _class_call_check(this, C5), _super.apply(this, arguments);
+ return _class_call_check(this, C5), _call_super(this, C5, arguments);
}
- return C5.prototype.f = function(c4, c5, c6) {
+ return _inherits(C5, _Mix), C5.prototype.f = function(c4, c5, c6) {
c4.p, c5.p, c6.p;
}, C5.g = function() {
C4.s, C5.s, C6.s;
}, C5;
}(Mix(Protected, Public)), C6 = /*#__PURE__*/ function(_Mix) {
- _inherits(C6, _Mix);
- var _super = _create_super(C6);
function C6() {
- return _class_call_check(this, C6), _super.apply(this, arguments);
+ return _class_call_check(this, C6), _call_super(this, C6, arguments);
}
- return C6.prototype.f = function(c4, c5, c6) {
+ return _inherits(C6, _Mix), C6.prototype.f = function(c4, c5, c6) {
c4.p, c5.p, c6.p;
}, C6.g = function() {
C4.s, C5.s, C6.s;
diff --git a/crates/swc/tests/tsc-references/mixinClassesAnnotated.1.normal.js b/crates/swc/tests/tsc-references/mixinClassesAnnotated.1.normal.js
index ff41df704ef..50ca606a4f1 100644
--- a/crates/swc/tests/tsc-references/mixinClassesAnnotated.1.normal.js
+++ b/crates/swc/tests/tsc-references/mixinClassesAnnotated.1.normal.js
@@ -1,8 +1,8 @@
//// [mixinClassesAnnotated.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x, y) {
"use strict";
_class_call_check(this, Base);
@@ -12,11 +12,13 @@ var Base = function Base(x, y) {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(x, y, z) {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this, x, y);
+ _this = _call_super(this, Derived, [
+ x,
+ y
+ ]);
_this.z = z;
return _this;
}
@@ -26,10 +28,9 @@ var Printable = function(superClass) {
var _class = /*#__PURE__*/ function(superClass) {
"use strict";
_inherits(_class, superClass);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
var _proto = _class.prototype;
_proto.print = function print() {
@@ -44,16 +45,13 @@ function Tagged(superClass) {
var C = /*#__PURE__*/ function(superClass) {
"use strict";
_inherits(C, superClass);
- var _super = _create_super(C);
function C() {
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
args[_key] = arguments[_key];
}
_class_call_check(this, C);
var _this;
- _this = _super.call.apply(_super, [
- this
- ].concat(_to_consumable_array(args)));
+ _this = _call_super(this, C, _to_consumable_array(args));
_this._tag = "hello";
return _this;
}
@@ -78,11 +76,14 @@ function f2() {
var Thing3 = /*#__PURE__*/ function(Thing2) {
"use strict";
_inherits(Thing3, Thing2);
- var _super = _create_super(Thing3);
function Thing3(tag) {
_class_call_check(this, Thing3);
var _this;
- _this = _super.call(this, 10, 20, 30);
+ _this = _call_super(this, Thing3, [
+ 10,
+ 20,
+ 30
+ ]);
_this._tag = tag;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/mixinClassesAnnotated.2.minified.js b/crates/swc/tests/tsc-references/mixinClassesAnnotated.2.minified.js
index 155a0e1ca1a..00e9a853f51 100644
--- a/crates/swc/tests/tsc-references/mixinClassesAnnotated.2.minified.js
+++ b/crates/swc/tests/tsc-references/mixinClassesAnnotated.2.minified.js
@@ -1,39 +1,34 @@
//// [mixinClassesAnnotated.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _class, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(x, y, z) {
var _this;
- return _class_call_check(this, Derived), (_this = _super.call(this, x, y)).z = z, _this;
+ return _class_call_check(this, Derived), (_this = _call_super(this, Derived, [
+ x,
+ y
+ ])).z = z, _this;
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(function Base(x, y) {
_class_call_check(this, Base), this.x = x, this.y = y;
});
function Tagged(superClass) {
return /*#__PURE__*/ function(superClass) {
- _inherits(C, superClass);
- var _super = _create_super(C);
function C() {
for(var _this, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
- return _class_call_check(this, C), (_this = _super.call.apply(_super, [
- this
- ].concat(_to_consumable_array(args))))._tag = "hello", _this;
+ return _class_call_check(this, C), (_this = _call_super(this, C, _to_consumable_array(args)))._tag = "hello", _this;
}
- return C;
+ return _inherits(C, superClass), C;
}(superClass);
}
Tagged(Derived), Tagged(((_class = /*#__PURE__*/ function(superClass) {
- _inherits(_class, superClass);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class.prototype.print = function() {
+ return _inherits(_class, superClass), _class.prototype.print = function() {
this.x, this.y;
}, _class;
}(Derived)).message = "hello", _class)).message;
diff --git a/crates/swc/tests/tsc-references/mixinClassesAnonymous.1.normal.js b/crates/swc/tests/tsc-references/mixinClassesAnonymous.1.normal.js
index 9de578b513e..fc08439ca14 100644
--- a/crates/swc/tests/tsc-references/mixinClassesAnonymous.1.normal.js
+++ b/crates/swc/tests/tsc-references/mixinClassesAnonymous.1.normal.js
@@ -1,8 +1,8 @@
//// [mixinClassesAnonymous.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(x, y) {
"use strict";
_class_call_check(this, Base);
@@ -12,11 +12,13 @@ var Base = function Base(x, y) {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(x, y, z) {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this, x, y);
+ _this = _call_super(this, Derived, [
+ x,
+ y
+ ]);
_this.z = z;
return _this;
}
@@ -26,10 +28,9 @@ var Printable = function(superClass) {
var _class = /*#__PURE__*/ function(superClass) {
"use strict";
_inherits(_class, superClass);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
var _proto = _class.prototype;
_proto.print = function print() {
@@ -44,16 +45,13 @@ function Tagged(superClass) {
var C = /*#__PURE__*/ function(superClass) {
"use strict";
_inherits(C, superClass);
- var _super = _create_super(C);
function C() {
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
args[_key] = arguments[_key];
}
_class_call_check(this, C);
var _this;
- _this = _super.call.apply(_super, [
- this
- ].concat(_to_consumable_array(args)));
+ _this = _call_super(this, C, _to_consumable_array(args));
_this._tag = "hello";
return _this;
}
@@ -78,11 +76,14 @@ function f2() {
var Thing3 = /*#__PURE__*/ function(Thing2) {
"use strict";
_inherits(Thing3, Thing2);
- var _super = _create_super(Thing3);
function Thing3(tag) {
_class_call_check(this, Thing3);
var _this;
- _this = _super.call(this, 10, 20, 30);
+ _this = _call_super(this, Thing3, [
+ 10,
+ 20,
+ 30
+ ]);
_this._tag = tag;
return _this;
}
@@ -97,11 +98,10 @@ var Timestamped = function(Base) {
return /*#__PURE__*/ function(Base) {
"use strict";
_inherits(_class, Base);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, _class, arguments);
_this.timestamp = new Date();
return _this;
}
diff --git a/crates/swc/tests/tsc-references/mixinClassesAnonymous.2.minified.js b/crates/swc/tests/tsc-references/mixinClassesAnonymous.2.minified.js
index 6132fb34e62..cce0ed4c7b9 100644
--- a/crates/swc/tests/tsc-references/mixinClassesAnonymous.2.minified.js
+++ b/crates/swc/tests/tsc-references/mixinClassesAnonymous.2.minified.js
@@ -1,39 +1,34 @@
//// [mixinClassesAnonymous.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _class, Derived = /*#__PURE__*/ function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(x, y, z) {
var _this;
- return _class_call_check(this, Derived), (_this = _super.call(this, x, y)).z = z, _this;
+ return _class_call_check(this, Derived), (_this = _call_super(this, Derived, [
+ x,
+ y
+ ])).z = z, _this;
}
- return Derived;
+ return _inherits(Derived, Base), Derived;
}(function Base(x, y) {
_class_call_check(this, Base), this.x = x, this.y = y;
});
function Tagged(superClass) {
return /*#__PURE__*/ function(superClass) {
- _inherits(C, superClass);
- var _super = _create_super(C);
function C() {
for(var _this, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
- return _class_call_check(this, C), (_this = _super.call.apply(_super, [
- this
- ].concat(_to_consumable_array(args))))._tag = "hello", _this;
+ return _class_call_check(this, C), (_this = _call_super(this, C, _to_consumable_array(args)))._tag = "hello", _this;
}
- return C;
+ return _inherits(C, superClass), C;
}(superClass);
}
Tagged(Derived), Tagged(((_class = /*#__PURE__*/ function(superClass) {
- _inherits(_class, superClass);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class.prototype.print = function() {
+ return _inherits(_class, superClass), _class.prototype.print = function() {
this.x, this.y;
}, _class;
}(Derived)).message = "hello", _class)).message;
diff --git a/crates/swc/tests/tsc-references/mixinClassesMembers.1.normal.js b/crates/swc/tests/tsc-references/mixinClassesMembers.1.normal.js
index 2825306e0fa..661ad2c79c2 100644
--- a/crates/swc/tests/tsc-references/mixinClassesMembers.1.normal.js
+++ b/crates/swc/tests/tsc-references/mixinClassesMembers.1.normal.js
@@ -1,9 +1,9 @@
//// [mixinClassesMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function f1() {
var x1 = new Mixed1("hello");
var x2 = new Mixed1(42);
@@ -53,11 +53,12 @@ function f6() {
var C2 = /*#__PURE__*/ function(Mixed11) {
"use strict";
_inherits(C2, Mixed11);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
var _this;
- _this = _super.call(this, "hello");
+ _this = _call_super(this, C2, [
+ "hello"
+ ]);
_this.a;
_this.b;
_this.p;
@@ -68,11 +69,12 @@ var C2 = /*#__PURE__*/ function(Mixed11) {
var C3 = /*#__PURE__*/ function(Mixed31) {
"use strict";
_inherits(C3, Mixed31);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
var _this;
- _this = _super.call(this, 42);
+ _this = _call_super(this, C3, [
+ 42
+ ]);
_this.a;
_this.b;
_this.p;
diff --git a/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js b/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js
index 9833d67a1c4..373c2a669ba 100644
--- a/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js
+++ b/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js
@@ -1,7 +1,7 @@
//// [mixinClassesMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ Mixed1, /*#__PURE__*/ Mixed3;
diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js
index da0bdef1f4d..0e828f7a184 100644
--- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js
@@ -1,7 +1,7 @@
//// [moduleWithStatementsOfEveryKind.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A;
(function(A) {
var A1 = function A() {
@@ -15,20 +15,18 @@ var A;
var B = /*#__PURE__*/ function(AA) {
"use strict";
_inherits(B, AA);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(AA);
var BB = /*#__PURE__*/ function(A) {
"use strict";
_inherits(BB, A);
- var _super = _create_super(BB);
function BB() {
_class_call_check(this, BB);
- return _super.apply(this, arguments);
+ return _call_super(this, BB, arguments);
}
return BB;
}(A1);
@@ -73,10 +71,9 @@ var Y;
var B = /*#__PURE__*/ function(AA) {
"use strict";
_inherits(B, AA);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(AA);
@@ -84,10 +81,9 @@ var Y;
var BB = /*#__PURE__*/ function(A) {
"use strict";
_inherits(BB, A);
- var _super = _create_super(BB);
function BB() {
_class_call_check(this, BB);
- return _super.apply(this, arguments);
+ return _call_super(this, BB, arguments);
}
return BB;
}(A);
diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js
index ebc48bad4b1..74c0a884472 100644
--- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js
@@ -1,26 +1,22 @@
//// [moduleWithStatementsOfEveryKind.ts]
var A, Y, Module, Color, Color1, Y1, A1, AA, B, BB, Color2;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
A || (A = {}), Module || (Module = {}), (Color1 = Color || (Color = {}))[Color1.Blue = 0] = "Blue", Color1[Color1.Red = 1] = "Red", Y1 = Y || (Y = {}), A1 = function A() {
_class_call_check(this, A);
}, Y1.A = A1, AA = function AA() {
_class_call_check(this, AA);
}, Y1.AA = AA, B = /*#__PURE__*/ function(AA) {
- _inherits(B, AA);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B;
+ return _inherits(B, AA), B;
}(AA), Y1.B = B, BB = /*#__PURE__*/ function(A) {
- _inherits(BB, A);
- var _super = _create_super(BB);
function BB() {
- return _class_call_check(this, BB), _super.apply(this, arguments);
+ return _class_call_check(this, BB), _call_super(this, BB, arguments);
}
- return BB;
+ return _inherits(BB, A), BB;
}(A1), Y1.BB = BB, Y1.Module || (Y1.Module = {}), (Color2 = Y1.Color || (Y1.Color = {}))[Color2.Blue = 0] = "Blue", Color2[Color2.Red = 1] = "Red", Y1.x = 12, Y1.F = function(s) {
return 2;
}, Y1.array = null, Y1.fn = function(s) {
diff --git a/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js b/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js
index 154aa48c860..5984958f2fb 100644
--- a/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js
+++ b/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js
@@ -1,9 +1,9 @@
//// [neverReturningFunctions1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function fail(message) {
throw new Error(message);
}
@@ -194,10 +194,9 @@ var MyThrowable = /*#__PURE__*/ function() {
var SuperThrowable = /*#__PURE__*/ function(MyThrowable) {
"use strict";
_inherits(SuperThrowable, MyThrowable);
- var _super = _create_super(SuperThrowable);
function SuperThrowable() {
_class_call_check(this, SuperThrowable);
- return _super.apply(this, arguments);
+ return _call_super(this, SuperThrowable, arguments);
}
var _proto = SuperThrowable.prototype;
_proto.err = function err(msg) {
diff --git a/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js b/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js
index ce58996b16f..574f9337c2c 100644
--- a/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js
+++ b/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js
@@ -1,9 +1,9 @@
//// [neverReturningFunctions1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
registerComponent('test-component', {
schema: {
myProperty: {
diff --git a/crates/swc/tests/tsc-references/newTarget.es5.1.normal.js b/crates/swc/tests/tsc-references/newTarget.es5.1.normal.js
index 58a46b81d5d..409850f4595 100644
--- a/crates/swc/tests/tsc-references/newTarget.es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/newTarget.es5.1.normal.js
@@ -1,8 +1,8 @@
//// [newTarget.es5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
var _this = this;
@@ -21,11 +21,11 @@ A.c = function _target() {
var B = /*#__PURE__*/ function _target(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
var _this = this;
_class_call_check(this, B);
- var _this1 = _super.call(this);
+ var _this1;
+ _this1 = _call_super(this, B);
var e = _instanceof(this, B) ? this.constructor : void 0;
var f = function() {
return _instanceof(_this, B) ? _this.constructor : void 0;
diff --git a/crates/swc/tests/tsc-references/newTarget.es5.2.minified.js b/crates/swc/tests/tsc-references/newTarget.es5.2.minified.js
index ef1482e047e..be5d453739c 100644
--- a/crates/swc/tests/tsc-references/newTarget.es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/newTarget.es5.2.minified.js
@@ -1,5 +1,5 @@
//// [newTarget.es5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js
index 685eca08210..c160a8aa696 100644
--- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js
+++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js
@@ -1,8 +1,8 @@
//// [numericIndexerConstrainsPropertyDeclarations2.ts]
// String indexer providing a constraint of a user defined type
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -17,10 +17,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.bar = function bar() {
diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js
index 9c71405c4cf..11fb84893fc 100644
--- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js
+++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js
@@ -1,7 +1,7 @@
//// [numericIndexerConstrainsPropertyDeclarations2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
function A() {
_class_call_check(this, A);
@@ -10,12 +10,10 @@ var A = /*#__PURE__*/ function() {
return '';
}, A;
}(), B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B.prototype.bar = function() {
+ return _inherits(B, A), B.prototype.bar = function() {
return '';
}, B;
}(A);
diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js
index 637f82b9df0..1b39acf3c0c 100644
--- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js
@@ -1,7 +1,7 @@
//// [objectTypeHidingMembersOfExtendedObject.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -9,10 +9,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.2.minified.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.2.minified.js
index 2a93150a1c8..a1875c24cb8 100644
--- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.2.minified.js
@@ -1,14 +1,12 @@
//// [objectTypeHidingMembersOfExtendedObject.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var c, i, b, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B;
+ return _inherits(B, A), B;
}(function A() {
_class_call_check(this, A);
});
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js
index 72d3318bcd1..3fc8a22c978 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js
@@ -1,8 +1,8 @@
//// [objectTypesIdentityWithNumericIndexers1.ts]
// object types are identical structurally
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -18,20 +18,18 @@ var C = function C() {
var PA = /*#__PURE__*/ function(A) {
"use strict";
_inherits(PA, A);
- var _super = _create_super(PA);
function PA() {
_class_call_check(this, PA);
- return _super.apply(this, arguments);
+ return _call_super(this, PA, arguments);
}
return PA;
}(A);
var PB = /*#__PURE__*/ function(B) {
"use strict";
_inherits(PB, B);
- var _super = _create_super(PB);
function PB() {
_class_call_check(this, PB);
- return _super.apply(this, arguments);
+ return _call_super(this, PB, arguments);
}
return PB;
}(B);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.2.minified.js
index 464108a0756..7bdfb805977 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.2.minified.js
@@ -1,4 +1,4 @@
//// [objectTypesIdentityWithNumericIndexers1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.1.normal.js
index 3591aac12c6..cb79788d5bc 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.1.normal.js
@@ -1,8 +1,8 @@
//// [objectTypesIdentityWithNumericIndexers2.ts]
// object types are identical structurally
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -32,20 +31,18 @@ var C = function C() {
var PA = /*#__PURE__*/ function(A) {
"use strict";
_inherits(PA, A);
- var _super = _create_super(PA);
function PA() {
_class_call_check(this, PA);
- return _super.apply(this, arguments);
+ return _call_super(this, PA, arguments);
}
return PA;
}(A);
var PB = /*#__PURE__*/ function(B) {
"use strict";
_inherits(PB, B);
- var _super = _create_super(PB);
function PB() {
_class_call_check(this, PB);
- return _super.apply(this, arguments);
+ return _call_super(this, PB, arguments);
}
return PB;
}(B);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.2.minified.js
index d564afeefbd..58e7f48482e 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers2.2.minified.js
@@ -1,4 +1,4 @@
//// [objectTypesIdentityWithNumericIndexers2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js
index 35e6c26213e..cb92e400835 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js
@@ -1,8 +1,8 @@
//// [objectTypesIdentityWithNumericIndexers3.ts]
// object types are identical structurally
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -18,20 +18,18 @@ var C = function C() {
var PA = /*#__PURE__*/ function(A) {
"use strict";
_inherits(PA, A);
- var _super = _create_super(PA);
function PA() {
_class_call_check(this, PA);
- return _super.apply(this, arguments);
+ return _call_super(this, PA, arguments);
}
return PA;
}(A);
var PB = /*#__PURE__*/ function(B) {
"use strict";
_inherits(PB, B);
- var _super = _create_super(PB);
function PB() {
_class_call_check(this, PB);
- return _super.apply(this, arguments);
+ return _call_super(this, PB, arguments);
}
return PB;
}(B);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.2.minified.js
index 522a3ecb96c..19a7b973244 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.2.minified.js
@@ -1,4 +1,4 @@
//// [objectTypesIdentityWithNumericIndexers3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js
index c73152a3fe3..2873f7696e8 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js
@@ -1,8 +1,8 @@
//// [objectTypesIdentityWithPrivates.ts]
// object types are identical structurally
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -18,20 +18,18 @@ var C = function C() {
var PA = /*#__PURE__*/ function(A) {
"use strict";
_inherits(PA, A);
- var _super = _create_super(PA);
function PA() {
_class_call_check(this, PA);
- return _super.apply(this, arguments);
+ return _call_super(this, PA, arguments);
}
return PA;
}(A);
var PB = /*#__PURE__*/ function(B) {
"use strict";
_inherits(PB, B);
- var _super = _create_super(PB);
function PB() {
_class_call_check(this, PB);
- return _super.apply(this, arguments);
+ return _call_super(this, PB, arguments);
}
return PB;
}(B);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.2.minified.js
index addc3dcc246..496200bd3fa 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.2.minified.js
@@ -1,4 +1,4 @@
//// [objectTypesIdentityWithPrivates.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.1.normal.js
index c74e18ac6d6..7c56af366a6 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.1.normal.js
@@ -1,8 +1,8 @@
//// [objectTypesIdentityWithPrivates2.ts]
// object types are identical structurally
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -10,10 +10,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.2.minified.js
index 43dada9a883..c5a854cc20d 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates2.2.minified.js
@@ -1,15 +1,13 @@
//// [objectTypesIdentityWithPrivates2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
}, D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C);
new C(), new D();
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.1.normal.js
index 3ec695a5bd7..09e68ae62c1 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.1.normal.js
@@ -1,7 +1,7 @@
//// [objectTypesIdentityWithPrivates3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = function C1() {
"use strict";
_class_call_check(this, C1);
@@ -9,10 +9,9 @@ var C1 = function C1() {
var C2 = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(C2, C1);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(C1);
@@ -25,10 +24,9 @@ var C3 = function C3() {
var C4 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(C4, C3);
- var _super = _create_super(C4);
function C4() {
_class_call_check(this, C4);
- return _super.apply(this, arguments);
+ return _call_super(this, C4, arguments);
}
return C4;
}(C3);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.2.minified.js
index b3fdb1ca062..5a34831490d 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates3.2.minified.js
@@ -1,4 +1,4 @@
//// [objectTypesIdentityWithPrivates3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js
index ba2209f1421..6921e60d662 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js
@@ -1,8 +1,8 @@
//// [objectTypesIdentityWithStringIndexers.ts]
// object types are identical structurally
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -18,20 +18,18 @@ var C = function C() {
var PA = /*#__PURE__*/ function(A) {
"use strict";
_inherits(PA, A);
- var _super = _create_super(PA);
function PA() {
_class_call_check(this, PA);
- return _super.apply(this, arguments);
+ return _call_super(this, PA, arguments);
}
return PA;
}(A);
var PB = /*#__PURE__*/ function(B) {
"use strict";
_inherits(PB, B);
- var _super = _create_super(PB);
function PB() {
_class_call_check(this, PB);
- return _super.apply(this, arguments);
+ return _call_super(this, PB, arguments);
}
return PB;
}(B);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.2.minified.js
index 0a1051abc7b..fe83da08032 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.2.minified.js
@@ -1,4 +1,4 @@
//// [objectTypesIdentityWithStringIndexers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.1.normal.js
index a40375d6f7c..d77643d8f74 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.1.normal.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.1.normal.js
@@ -1,8 +1,8 @@
//// [objectTypesIdentityWithStringIndexers2.ts]
// object types are identical structurally
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -32,20 +31,18 @@ var C = function C() {
var PA = /*#__PURE__*/ function(A) {
"use strict";
_inherits(PA, A);
- var _super = _create_super(PA);
function PA() {
_class_call_check(this, PA);
- return _super.apply(this, arguments);
+ return _call_super(this, PA, arguments);
}
return PA;
}(A);
var PB = /*#__PURE__*/ function(B) {
"use strict";
_inherits(PB, B);
- var _super = _create_super(PB);
function PB() {
_class_call_check(this, PB);
- return _super.apply(this, arguments);
+ return _call_super(this, PB, arguments);
}
return PB;
}(B);
diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.2.minified.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.2.minified.js
index dd8ad811442..d3209441048 100644
--- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.2.minified.js
+++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers2.2.minified.js
@@ -1,4 +1,4 @@
//// [objectTypesIdentityWithStringIndexers2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/optionalMethods.1.normal.js b/crates/swc/tests/tsc-references/optionalMethods.1.normal.js
index 1c75680608e..6064d0d9e5a 100644
--- a/crates/swc/tests/tsc-references/optionalMethods.1.normal.js
+++ b/crates/swc/tests/tsc-references/optionalMethods.1.normal.js
@@ -1,7 +1,7 @@
//// [optionalMethods.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function test1(x) {
x.a;
x.b;
@@ -50,11 +50,10 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Derived, arguments);
_this.a = 1;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/optionalMethods.2.minified.js b/crates/swc/tests/tsc-references/optionalMethods.2.minified.js
index 805b4f44b64..e33efd5dc50 100644
--- a/crates/swc/tests/tsc-references/optionalMethods.2.minified.js
+++ b/crates/swc/tests/tsc-references/optionalMethods.2.minified.js
@@ -1,4 +1,4 @@
//// [optionalMethods.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/overloadResolution.1.normal.js b/crates/swc/tests/tsc-references/overloadResolution.1.normal.js
index 1128c444ad5..71299429f1c 100644
--- a/crates/swc/tests/tsc-references/overloadResolution.1.normal.js
+++ b/crates/swc/tests/tsc-references/overloadResolution.1.normal.js
@@ -1,7 +1,7 @@
//// [overloadResolution.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var SomeBase = function SomeBase() {
"use strict";
_class_call_check(this, SomeBase);
@@ -9,30 +9,27 @@ var SomeBase = function SomeBase() {
var SomeDerived1 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived1, SomeBase);
- var _super = _create_super(SomeDerived1);
function SomeDerived1() {
_class_call_check(this, SomeDerived1);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived1, arguments);
}
return SomeDerived1;
}(SomeBase);
var SomeDerived2 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived2, SomeBase);
- var _super = _create_super(SomeDerived2);
function SomeDerived2() {
_class_call_check(this, SomeDerived2);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived2, arguments);
}
return SomeDerived2;
}(SomeBase);
var SomeDerived3 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived3, SomeBase);
- var _super = _create_super(SomeDerived3);
function SomeDerived3() {
_class_call_check(this, SomeDerived3);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived3, arguments);
}
return SomeDerived3;
}(SomeBase);
diff --git a/crates/swc/tests/tsc-references/overloadResolution.2.minified.js b/crates/swc/tests/tsc-references/overloadResolution.2.minified.js
index c981f735475..7d321f0225b 100644
--- a/crates/swc/tests/tsc-references/overloadResolution.2.minified.js
+++ b/crates/swc/tests/tsc-references/overloadResolution.2.minified.js
@@ -1,4 +1,4 @@
//// [overloadResolution.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js
index 16ff297e22e..ea53555f56b 100644
--- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js
+++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js
@@ -1,7 +1,7 @@
//// [overloadResolutionClassConstructors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var SomeBase = function SomeBase() {
"use strict";
_class_call_check(this, SomeBase);
@@ -9,30 +9,27 @@ var SomeBase = function SomeBase() {
var SomeDerived1 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived1, SomeBase);
- var _super = _create_super(SomeDerived1);
function SomeDerived1() {
_class_call_check(this, SomeDerived1);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived1, arguments);
}
return SomeDerived1;
}(SomeBase);
var SomeDerived2 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived2, SomeBase);
- var _super = _create_super(SomeDerived2);
function SomeDerived2() {
_class_call_check(this, SomeDerived2);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived2, arguments);
}
return SomeDerived2;
}(SomeBase);
var SomeDerived3 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived3, SomeBase);
- var _super = _create_super(SomeDerived3);
function SomeDerived3() {
_class_call_check(this, SomeDerived3);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived3, arguments);
}
return SomeDerived3;
}(SomeBase);
diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js
index 7412d0f1f0c..7d0f89b7e6f 100644
--- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js
+++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js
@@ -1,7 +1,7 @@
//// [overloadResolutionClassConstructors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var fn1 = function fn1() {
_class_call_check(this, fn1);
};
diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js
index 0139706678a..15f8ae76d07 100644
--- a/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js
+++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js
@@ -1,7 +1,7 @@
//// [overloadResolutionConstructors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var SomeBase = function SomeBase() {
"use strict";
_class_call_check(this, SomeBase);
@@ -9,30 +9,27 @@ var SomeBase = function SomeBase() {
var SomeDerived1 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived1, SomeBase);
- var _super = _create_super(SomeDerived1);
function SomeDerived1() {
_class_call_check(this, SomeDerived1);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived1, arguments);
}
return SomeDerived1;
}(SomeBase);
var SomeDerived2 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived2, SomeBase);
- var _super = _create_super(SomeDerived2);
function SomeDerived2() {
_class_call_check(this, SomeDerived2);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived2, arguments);
}
return SomeDerived2;
}(SomeBase);
var SomeDerived3 = /*#__PURE__*/ function(SomeBase) {
"use strict";
_inherits(SomeDerived3, SomeBase);
- var _super = _create_super(SomeDerived3);
function SomeDerived3() {
_class_call_check(this, SomeDerived3);
- return _super.apply(this, arguments);
+ return _call_super(this, SomeDerived3, arguments);
}
return SomeDerived3;
}(SomeBase);
diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js
index 5c17407c265..dfd6925db21 100644
--- a/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js
+++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js
@@ -1,8 +1,8 @@
//// [overloadResolutionConstructors.ts]
var fn1, fn2, fn3, fn4, fn5;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
new fn1(void 0), new fn1({}), new fn2(0, void 0), new fn2(0, ''), new fn2('', 0), new fn2('', 0), new fn3(3), new fn3('', 3, ''), new fn3(5, 5, 5), new fn3(4), new fn3('', '', ''), new fn3('', '', 3), new fn3(), new fn4('', 3), new fn4(3, ''), new fn4('', 3), new fn4(3, ''), new fn4('', 3), new fn4(3, ''), new fn4(3, void 0), new fn4('', null), new fn4(null, null), new fn4(!0, null), new fn4(null, !0), new fn5(function(n) {
return n.toFixed();
}), new fn5(function(n) {
diff --git a/crates/swc/tests/tsc-references/override10.1.normal.js b/crates/swc/tests/tsc-references/override10.1.normal.js
index 64e573c3591..056134ef908 100644
--- a/crates/swc/tests/tsc-references/override10.1.normal.js
+++ b/crates/swc/tests/tsc-references/override10.1.normal.js
@@ -1,7 +1,7 @@
//// [override10.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,10 +9,9 @@ var Base = function Base() {
var Sub = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Sub, Base);
- var _super = _create_super(Sub);
function Sub() {
_class_call_check(this, Sub);
- return _super.apply(this, arguments);
+ return _call_super(this, Sub, arguments);
}
var _proto = Sub.prototype;
_proto.bar = function bar() {};
diff --git a/crates/swc/tests/tsc-references/override10.2.minified.js b/crates/swc/tests/tsc-references/override10.2.minified.js
index b52cfe50ff3..2a26aa149e5 100644
--- a/crates/swc/tests/tsc-references/override10.2.minified.js
+++ b/crates/swc/tests/tsc-references/override10.2.minified.js
@@ -1,4 +1,4 @@
//// [override10.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override15.1.normal.js b/crates/swc/tests/tsc-references/override15.1.normal.js
index 4d5420f2c8d..21b55be5d93 100644
--- a/crates/swc/tests/tsc-references/override15.1.normal.js
+++ b/crates/swc/tests/tsc-references/override15.1.normal.js
@@ -1,7 +1,7 @@
//// [override15.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -14,10 +14,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.doSomethang = function doSomethang() {};
diff --git a/crates/swc/tests/tsc-references/override15.2.minified.js b/crates/swc/tests/tsc-references/override15.2.minified.js
index 574d884f433..47db4a8dfd1 100644
--- a/crates/swc/tests/tsc-references/override15.2.minified.js
+++ b/crates/swc/tests/tsc-references/override15.2.minified.js
@@ -1,4 +1,4 @@
//// [override15.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override2.1.normal.js b/crates/swc/tests/tsc-references/override2.1.normal.js
index 05840415e0e..f4d684cdeb1 100644
--- a/crates/swc/tests/tsc-references/override2.1.normal.js
+++ b/crates/swc/tests/tsc-references/override2.1.normal.js
@@ -1,7 +1,7 @@
//// [override2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var AB = function AB() {
"use strict";
_class_call_check(this, AB);
@@ -9,30 +9,27 @@ var AB = function AB() {
var AD1 = /*#__PURE__*/ function(AB) {
"use strict";
_inherits(AD1, AB);
- var _super = _create_super(AD1);
function AD1() {
_class_call_check(this, AD1);
- return _super.apply(this, arguments);
+ return _call_super(this, AD1, arguments);
}
return AD1;
}(AB);
var AD2 = /*#__PURE__*/ function(AB) {
"use strict";
_inherits(AD2, AB);
- var _super = _create_super(AD2);
function AD2() {
_class_call_check(this, AD2);
- return _super.apply(this, arguments);
+ return _call_super(this, AD2, arguments);
}
return AD2;
}(AB);
var AD3 = /*#__PURE__*/ function(AB) {
"use strict";
_inherits(AD3, AB);
- var _super = _create_super(AD3);
function AD3() {
_class_call_check(this, AD3);
- return _super.apply(this, arguments);
+ return _call_super(this, AD3, arguments);
}
var _proto = AD3.prototype;
_proto.foo = function foo(v) {} // need override?
@@ -43,10 +40,9 @@ var AD3 = /*#__PURE__*/ function(AB) {
var D4 = /*#__PURE__*/ function(AB) {
"use strict";
_inherits(D4, AB);
- var _super = _create_super(D4);
function D4() {
_class_call_check(this, D4);
- return _super.apply(this, arguments);
+ return _call_super(this, D4, arguments);
}
var _proto = D4.prototype;
_proto.foo = function foo(v) {};
diff --git a/crates/swc/tests/tsc-references/override2.2.minified.js b/crates/swc/tests/tsc-references/override2.2.minified.js
index 09bd5fda104..44d61eb7409 100644
--- a/crates/swc/tests/tsc-references/override2.2.minified.js
+++ b/crates/swc/tests/tsc-references/override2.2.minified.js
@@ -1,4 +1,4 @@
//// [override2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override3.1.normal.js b/crates/swc/tests/tsc-references/override3.1.normal.js
index cd0f193c45e..8e3171d32b1 100644
--- a/crates/swc/tests/tsc-references/override3.1.normal.js
+++ b/crates/swc/tests/tsc-references/override3.1.normal.js
@@ -1,14 +1,13 @@
//// [override3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var DB = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(DB, B1);
- var _super = _create_super(DB);
function DB() {
_class_call_check(this, DB);
- return _super.apply(this, arguments);
+ return _call_super(this, DB, arguments);
}
var _proto = DB.prototype;
_proto.foo = function foo() {};
@@ -18,10 +17,9 @@ var DB = /*#__PURE__*/ function(B1) {
var DD = /*#__PURE__*/ function(D1) {
"use strict";
_inherits(DD, D1);
- var _super = _create_super(DD);
function DD() {
_class_call_check(this, DD);
- return _super.apply(this, arguments);
+ return _call_super(this, DD, arguments);
}
var _proto = DD.prototype;
_proto.foo = function foo() {};
@@ -31,10 +29,9 @@ var DD = /*#__PURE__*/ function(D1) {
var EB = /*#__PURE__*/ function(D1) {
"use strict";
_inherits(EB, D1);
- var _super = _create_super(EB);
function EB() {
_class_call_check(this, EB);
- return _super.apply(this, arguments);
+ return _call_super(this, EB, arguments);
}
var _proto = EB.prototype;
_proto.foo = function foo() {};
diff --git a/crates/swc/tests/tsc-references/override3.2.minified.js b/crates/swc/tests/tsc-references/override3.2.minified.js
index 55da54a0bb9..3981ab72c72 100644
--- a/crates/swc/tests/tsc-references/override3.2.minified.js
+++ b/crates/swc/tests/tsc-references/override3.2.minified.js
@@ -1,5 +1,5 @@
//// [override3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ B, /*#__PURE__*/ D, /*#__PURE__*/ D;
diff --git a/crates/swc/tests/tsc-references/override4.1.normal.js b/crates/swc/tests/tsc-references/override4.1.normal.js
index dad2c8d447e..c5f6ff89919 100644
--- a/crates/swc/tests/tsc-references/override4.1.normal.js
+++ b/crates/swc/tests/tsc-references/override4.1.normal.js
@@ -1,7 +1,7 @@
//// [override4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -17,11 +17,10 @@ var B = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, D, arguments);
_this.p1 = 2;
_this.p2 = 3;
return _this;
@@ -34,10 +33,9 @@ var D = /*#__PURE__*/ function(B) {
var DD = /*#__PURE__*/ function(B) {
"use strict";
_inherits(DD, B);
- var _super = _create_super(DD);
function DD() {
_class_call_check(this, DD);
- return _super.apply(this, arguments);
+ return _call_super(this, DD, arguments);
}
return DD;
}(B);
diff --git a/crates/swc/tests/tsc-references/override4.2.minified.js b/crates/swc/tests/tsc-references/override4.2.minified.js
index 7fcf9c925b0..49dce89642c 100644
--- a/crates/swc/tests/tsc-references/override4.2.minified.js
+++ b/crates/swc/tests/tsc-references/override4.2.minified.js
@@ -1,4 +1,4 @@
//// [override4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override6.1.normal.js b/crates/swc/tests/tsc-references/override6.1.normal.js
index 9ba6d62f001..e159a1a9bd4 100644
--- a/crates/swc/tests/tsc-references/override6.1.normal.js
+++ b/crates/swc/tests/tsc-references/override6.1.normal.js
@@ -1,7 +1,7 @@
//// [override6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B(foo, bar) {
"use strict";
_class_call_check(this, B);
@@ -12,11 +12,13 @@ var B = function B(foo, bar) {
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D(foo, baz) {
_class_call_check(this, D);
var _this;
- _this = _super.call(this, foo, 42);
+ _this = _call_super(this, D, [
+ foo,
+ 42
+ ]);
_this.foo = foo;
_this.baz = baz;
_this.bar = 1;
diff --git a/crates/swc/tests/tsc-references/override6.2.minified.js b/crates/swc/tests/tsc-references/override6.2.minified.js
index da934f54590..68a097f1134 100644
--- a/crates/swc/tests/tsc-references/override6.2.minified.js
+++ b/crates/swc/tests/tsc-references/override6.2.minified.js
@@ -1,4 +1,4 @@
//// [override6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override8.1.normal.js b/crates/swc/tests/tsc-references/override8.1.normal.js
index c7e68360af6..5275d8deb35 100644
--- a/crates/swc/tests/tsc-references/override8.1.normal.js
+++ b/crates/swc/tests/tsc-references/override8.1.normal.js
@@ -1,7 +1,7 @@
//// [override8.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
"use strict";
_class_call_check(this, B);
@@ -9,11 +9,10 @@ var B = function B() {
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D(a, b) {
_class_call_check(this, D);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, D);
_this.a = a;
_this.b = b;
return _this;
@@ -28,11 +27,12 @@ var BB = function BB(a) {
var DD = /*#__PURE__*/ function(BB) {
"use strict";
_inherits(DD, BB);
- var _super = _create_super(DD);
function DD(a) {
_class_call_check(this, DD);
var _this;
- _this = _super.call(this, a);
+ _this = _call_super(this, DD, [
+ a
+ ]);
_this.a = a;
return _this;
}
@@ -41,11 +41,12 @@ var DD = /*#__PURE__*/ function(BB) {
var DDD = /*#__PURE__*/ function(BB) {
"use strict";
_inherits(DDD, BB);
- var _super = _create_super(DDD);
function DDD(a) {
_class_call_check(this, DDD);
var _this;
- _this = _super.call(this, a);
+ _this = _call_super(this, DDD, [
+ a
+ ]);
_this.a = a;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/override8.2.minified.js b/crates/swc/tests/tsc-references/override8.2.minified.js
index 10485dad38b..d1df7e04dcf 100644
--- a/crates/swc/tests/tsc-references/override8.2.minified.js
+++ b/crates/swc/tests/tsc-references/override8.2.minified.js
@@ -1,4 +1,4 @@
//// [override8.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override_js1.1.normal.js b/crates/swc/tests/tsc-references/override_js1.1.normal.js
index e2cc5ac4f79..730a0d4baeb 100644
--- a/crates/swc/tests/tsc-references/override_js1.1.normal.js
+++ b/crates/swc/tests/tsc-references/override_js1.1.normal.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -15,10 +15,9 @@ var B = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo(v) {};
diff --git a/crates/swc/tests/tsc-references/override_js1.2.minified.js b/crates/swc/tests/tsc-references/override_js1.2.minified.js
index f6f1ffc9131..7035550baa7 100644
--- a/crates/swc/tests/tsc-references/override_js1.2.minified.js
+++ b/crates/swc/tests/tsc-references/override_js1.2.minified.js
@@ -1,4 +1,4 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override_js2.1.normal.js b/crates/swc/tests/tsc-references/override_js2.1.normal.js
index e2cc5ac4f79..730a0d4baeb 100644
--- a/crates/swc/tests/tsc-references/override_js2.1.normal.js
+++ b/crates/swc/tests/tsc-references/override_js2.1.normal.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -15,10 +15,9 @@ var B = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo(v) {};
diff --git a/crates/swc/tests/tsc-references/override_js2.2.minified.js b/crates/swc/tests/tsc-references/override_js2.2.minified.js
index f6f1ffc9131..7035550baa7 100644
--- a/crates/swc/tests/tsc-references/override_js2.2.minified.js
+++ b/crates/swc/tests/tsc-references/override_js2.2.minified.js
@@ -1,4 +1,4 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override_js3.1.normal.js b/crates/swc/tests/tsc-references/override_js3.1.normal.js
index e6ad47c8695..9329174506e 100644
--- a/crates/swc/tests/tsc-references/override_js3.1.normal.js
+++ b/crates/swc/tests/tsc-references/override_js3.1.normal.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -15,10 +15,9 @@ var B = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo(v) {};
diff --git a/crates/swc/tests/tsc-references/override_js3.2.minified.js b/crates/swc/tests/tsc-references/override_js3.2.minified.js
index f6f1ffc9131..7035550baa7 100644
--- a/crates/swc/tests/tsc-references/override_js3.2.minified.js
+++ b/crates/swc/tests/tsc-references/override_js3.2.minified.js
@@ -1,4 +1,4 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/override_js4.1.normal.js b/crates/swc/tests/tsc-references/override_js4.1.normal.js
index 8bbfdeafb9e..af4b6299a9b 100644
--- a/crates/swc/tests/tsc-references/override_js4.1.normal.js
+++ b/crates/swc/tests/tsc-references/override_js4.1.normal.js
@@ -1,8 +1,8 @@
//// [override_js4.ts]
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -15,10 +15,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
/** @override */ _proto.doSomethang = function doSomethang() {};
diff --git a/crates/swc/tests/tsc-references/override_js4.2.minified.js b/crates/swc/tests/tsc-references/override_js4.2.minified.js
index 03241959ec4..b51db26486b 100644
--- a/crates/swc/tests/tsc-references/override_js4.2.minified.js
+++ b/crates/swc/tests/tsc-references/override_js4.2.minified.js
@@ -1,5 +1,5 @@
//// [override_js4.ts]
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/parserAstSpans1.1.normal.js b/crates/swc/tests/tsc-references/parserAstSpans1.1.normal.js
index 02eceb4da5a..2c3beae1141 100644
--- a/crates/swc/tests/tsc-references/parserAstSpans1.1.normal.js
+++ b/crates/swc/tests/tsc-references/parserAstSpans1.1.normal.js
@@ -1,11 +1,11 @@
//// [parserAstSpans1.ts]
/** i1 is interface with properties*/ import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var c1 = /*#__PURE__*/ function() {
"use strict";
function c1() {
@@ -88,11 +88,12 @@ var c2 = /*#__PURE__*/ function() {
var c3 = /*#__PURE__*/ function(c2) {
"use strict";
_inherits(c3, c2);
- var _super = _create_super(c3);
function c3() {
_class_call_check(this, c3);
var _this;
- _this = _super.call(this, 10);
+ _this = _call_super(this, c3, [
+ 10
+ ]);
_this.p1 = _get((_assert_this_initialized(_this), _get_prototype_of(c3.prototype)), "c2_p1", _this);
return _this;
}
@@ -134,10 +135,9 @@ c2_i.nc_f1();
var c4 = /*#__PURE__*/ function(c2) {
"use strict";
_inherits(c4, c2);
- var _super = _create_super(c4);
function c4() {
_class_call_check(this, c4);
- return _super.apply(this, arguments);
+ return _call_super(this, c4, arguments);
}
return c4;
}(c2);
@@ -177,11 +177,10 @@ i2_i.nc_l1();
var c6 = /*#__PURE__*/ function(c5) {
"use strict";
_inherits(c6, c5);
- var _super = _create_super(c6);
function c6() {
_class_call_check(this, c6);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, c6);
_this.d = _get((_assert_this_initialized(_this), _get_prototype_of(c6.prototype)), "b", _this);
return _this;
}
diff --git a/crates/swc/tests/tsc-references/parserAstSpans1.2.minified.js b/crates/swc/tests/tsc-references/parserAstSpans1.2.minified.js
index e3b639482f5..e89c0406a7a 100644
--- a/crates/swc/tests/tsc-references/parserAstSpans1.2.minified.js
+++ b/crates/swc/tests/tsc-references/parserAstSpans1.2.minified.js
@@ -1,11 +1,11 @@
//// [parserAstSpans1.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var i1_i, i2_i, i3_i, c1 = /*#__PURE__*/ function() {
function c1() {
_class_call_check(this, c1);
@@ -48,12 +48,13 @@ var c2 = /*#__PURE__*/ function() {
}
]), c2;
}(), c3 = /*#__PURE__*/ function(c2) {
- _inherits(c3, c2);
- var _super = _create_super(c3);
function c3() {
var _this;
- return _class_call_check(this, c3), (_this = _super.call(this, 10)).p1 = _get((_assert_this_initialized(_this), _get_prototype_of(c3.prototype)), "c2_p1", _this), _this;
+ return _class_call_check(this, c3), (_this = _call_super(this, c3, [
+ 10
+ ])).p1 = _get((_assert_this_initialized(_this), _get_prototype_of(c3.prototype)), "c2_p1", _this), _this;
}
+ _inherits(c3, c2);
var _proto = c3.prototype;
return _proto.f1 = function() {}, _proto.nc_f1 = function() {}, _create_class(c3, [
{
@@ -71,10 +72,8 @@ var c2 = /*#__PURE__*/ function() {
]), c3;
}(c2), c2_i = new c2(10), c3_i = new c3();
c2_i.c2_f1(), c2_i.c2_nc_f1(), c2_i.f1(), c2_i.nc_f1(), c3_i.c2_f1(), c3_i.c2_nc_f1(), c3_i.f1(), c3_i.nc_f1(), (c2_i = c3_i).c2_f1(), c2_i.c2_nc_f1(), c2_i.f1(), c2_i.nc_f1(), new /*#__PURE__*/ (function(c2) {
- _inherits(c4, c2);
- var _super = _create_super(c4);
function c4() {
- return _class_call_check(this, c4), _super.apply(this, arguments);
+ return _class_call_check(this, c4), _call_super(this, c4, arguments);
}
- return c4;
+ return _inherits(c4, c2), c4;
}(c2))(10), i2_i.i2_f1(), i2_i.i2_nc_f1(), i2_i.f1(), i2_i.nc_f1(), i2_i.i2_l1(), i2_i.i2_nc_l1(), i2_i.l1(), i2_i.nc_l1(), i3_i.i2_f1(), i3_i.i2_nc_f1(), i3_i.f1(), i3_i.nc_f1(), i3_i.i2_l1(), i3_i.i2_nc_l1(), i3_i.l1(), i3_i.nc_l1(), (i2_i = i3_i).i2_f1(), i2_i.i2_nc_f1(), i2_i.f1(), i2_i.nc_f1(), i2_i.i2_l1(), i2_i.i2_nc_l1(), i2_i.l1(), i2_i.nc_l1();
diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.1.normal.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.1.normal.js
index 983d34115f7..89a7cd823f6 100644
--- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.1.normal.js
+++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.1.normal.js
@@ -1,14 +1,13 @@
//// [parserGenericsInTypeContexts1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(A1) {
"use strict";
_inherits(C, A1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js
index 4787d0d0f88..5e17592c5ac 100644
--- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js
+++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js
@@ -1,5 +1,5 @@
//// [parserGenericsInTypeContexts1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ A;
diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.1.normal.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.1.normal.js
index bc8a491aa16..89db229bed5 100644
--- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.1.normal.js
+++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.1.normal.js
@@ -1,14 +1,13 @@
//// [parserGenericsInTypeContexts2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(A1) {
"use strict";
_inherits(C, A1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js
index 74f96a2d15d..c878f426f1a 100644
--- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js
+++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js
@@ -1,5 +1,5 @@
//// [parserGenericsInTypeContexts2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ A;
diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.1.normal.js
index b05718530e4..91540154ad2 100644
--- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.1.normal.js
+++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.1.normal.js
@@ -1,7 +1,7 @@
//// [partiallyAnnotatedFunctionInferenceError.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -9,10 +9,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.2.minified.js
index e6b6bffbb61..937c724e5a7 100644
--- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.2.minified.js
+++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceError.2.minified.js
@@ -1,5 +1,5 @@
//// [partiallyAnnotatedFunctionInferenceError.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
testError(function(t1, t2, t3) {}), testError(function(t1, t2, t3) {}), testError(function(t1, t2, t3) {});
diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.1.normal.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.1.normal.js
index a4d5d9af0bc..ab9ac566a9b 100644
--- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.1.normal.js
+++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.1.normal.js
@@ -1,7 +1,7 @@
//// [partiallyAnnotatedFunctionInferenceWithTypeParameter.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -9,10 +9,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.2.minified.js b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.2.minified.js
index f94db4139fb..e199f8a2e1b 100644
--- a/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.2.minified.js
+++ b/crates/swc/tests/tsc-references/partiallyAnnotatedFunctionInferenceWithTypeParameter.2.minified.js
@@ -1,7 +1,7 @@
//// [partiallyAnnotatedFunctionInferenceWithTypeParameter.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
test(function(t1, t2) {
t2.test2;
}), test(function(t1, t2) {
diff --git a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.1.normal.js b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.1.normal.js
index cbef8455060..ba583b19d5d 100644
--- a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.1.normal.js
@@ -1,7 +1,7 @@
//// [privateProtectedMembersAreNotAccessibleDestructuring.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var K = /*#__PURE__*/ function() {
"use strict";
function K() {
@@ -18,10 +18,9 @@ var K = /*#__PURE__*/ function() {
var C = /*#__PURE__*/ function(K) {
"use strict";
_inherits(C, K);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.m2 = function m2() {
diff --git a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.2.minified.js b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.2.minified.js
index fdf7eda0448..aad2ebbfb7c 100644
--- a/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateProtectedMembersAreNotAccessibleDestructuring.2.minified.js
@@ -1,7 +1,7 @@
//// [privateProtectedMembersAreNotAccessibleDestructuring.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var k = new /*#__PURE__*/ (function() {
function K() {
_class_call_check(this, K);
diff --git a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js
index a92e514b7dd..7bacfbf23a7 100644
--- a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.1.normal.js
@@ -1,7 +1,7 @@
//// [privateStaticMemberAccessibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,11 +9,10 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Derived, Base1);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Derived, arguments);
_this.bing = function() {
return Base.foo;
} // error
diff --git a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.2.minified.js b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.2.minified.js
index 79f7b67306b..83cf109dc6e 100644
--- a/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateStaticMemberAccessibility.2.minified.js
@@ -1,18 +1,16 @@
//// [privateStaticMemberAccessibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
_class_call_check(this, Base);
};
/*#__PURE__*/ (function(Base1) {
- _inherits(Derived, Base1);
- var _super = _create_super(Derived);
function Derived() {
var _this;
- return _class_call_check(this, Derived), _this = _super.apply(this, arguments), _this.bing = function() {
+ return _class_call_check(this, Derived), _this = _call_super(this, Derived, arguments), _this.bing = function() {
return Base.foo;
}, _this;
}
- return Derived;
+ return _inherits(Derived, Base1), Derived;
})(Base).bar = Base.foo;
diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.1.normal.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.1.normal.js
index bb623c17463..9a29f0a91cc 100644
--- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.1.normal.js
@@ -1,8 +1,8 @@
//// [privateStaticNotAccessibleInClodule2.ts]
// Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error.
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -10,10 +10,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.2.minified.js b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.2.minified.js
index 7f70ab99664..d1918dc50ef 100644
--- a/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateStaticNotAccessibleInClodule2.2.minified.js
@@ -1,14 +1,12 @@
//// [privateStaticNotAccessibleInClodule2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var D, D1 = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(function C() {
_class_call_check(this, C);
});
diff --git a/crates/swc/tests/tsc-references/propertyAccess.1.normal.js b/crates/swc/tests/tsc-references/propertyAccess.1.normal.js
index d08e35190c8..540199f56c1 100644
--- a/crates/swc/tests/tsc-references/propertyAccess.1.normal.js
+++ b/crates/swc/tests/tsc-references/propertyAccess.1.normal.js
@@ -1,7 +1,7 @@
//// [propertyAccess.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -9,10 +9,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
diff --git a/crates/swc/tests/tsc-references/propertyAccess.2.minified.js b/crates/swc/tests/tsc-references/propertyAccess.2.minified.js
index 312f35c545a..a904a677712 100644
--- a/crates/swc/tests/tsc-references/propertyAccess.2.minified.js
+++ b/crates/swc/tests/tsc-references/propertyAccess.2.minified.js
@@ -1,7 +1,7 @@
//// [propertyAccess.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(Compass1 = Compass || (Compass = {}))[Compass1.North = 0] = "North", Compass1[Compass1.South = 1] = "South", Compass1[Compass1.East = 2] = "East", Compass1[Compass1.West = 3] = "West";
var Compass, bothIndex, stringOrNumber, someObject, Compass1, numIndex = {
3: 'three',
diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js
index b9d03f8cfde..bfede069144 100644
--- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js
+++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js
@@ -1,8 +1,8 @@
//// [propertyAccessOnTypeParameterWithConstraints2.ts]
// generic types should behave as if they have properties of their constraint type
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -17,10 +17,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.bar = function bar() {
diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js
index 314835b78ad..16a215a9c64 100644
--- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js
+++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js
@@ -1,14 +1,12 @@
//// [propertyAccessOnTypeParameterWithConstraints2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var i, a, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B.prototype.bar = function() {
+ return _inherits(B, A), B.prototype.bar = function() {
return '';
}, B;
}(/*#__PURE__*/ function() {
diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js
index 599384f5973..34524214bc7 100644
--- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js
+++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js
@@ -1,8 +1,8 @@
//// [propertyAccessOnTypeParameterWithConstraints3.ts]
// generic types should behave as if they have properties of their constraint type
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -17,10 +17,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.bar = function bar() {
diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js
index f4e17bde1b0..d01ed8d9fa5 100644
--- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js
+++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js
@@ -1,14 +1,12 @@
//// [propertyAccessOnTypeParameterWithConstraints3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var i, a, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B.prototype.bar = function() {
+ return _inherits(B, A), B.prototype.bar = function() {
return '';
}, B;
}(/*#__PURE__*/ function() {
diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js
index dab0fd8312e..16f466caa94 100644
--- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js
+++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js
@@ -1,7 +1,7 @@
//// [propertyAccessOnTypeParameterWithConstraints5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -16,10 +16,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.bar = function bar() {
diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js
index d9035a3195c..07114b2ecf1 100644
--- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js
+++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js
@@ -1,14 +1,12 @@
//// [propertyAccessOnTypeParameterWithConstraints5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var i, a, B = /*#__PURE__*/ function(A) {
- _inherits(B, A);
- var _super = _create_super(B);
function B() {
- return _class_call_check(this, B), _super.apply(this, arguments);
+ return _class_call_check(this, B), _call_super(this, B, arguments);
}
- return B.prototype.bar = function() {
+ return _inherits(B, A), B.prototype.bar = function() {
return '';
}, B;
}(/*#__PURE__*/ function() {
diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js
index 3ba7b46185f..f5d3e0c1e71 100644
--- a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js
+++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js
@@ -1,18 +1,16 @@
//// [propertyOverridesAccessors4.ts]
-import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Lion = /*#__PURE__*/ function(Animal1) {
"use strict";
_inherits(Lion, Animal1);
- var _super = _create_super(Lion);
function Lion() {
_class_call_check(this, Lion);
var _this;
- _this = _super.apply(this, arguments);
- _define_property(_assert_this_initialized(_this), "sound", 'RAWR!' // error here
+ _this = _call_super(this, Lion, arguments);
+ _define_property(_this, "sound", 'RAWR!' // error here
);
return _this;
}
diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js
index 1f308044e66..7fa9552c822 100644
--- a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js
+++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js
@@ -1,7 +1,6 @@
//// [propertyOverridesAccessors4.ts]
-import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ Animal;
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.1.normal.js
index f1f8a40ceb5..f82a9973b0e 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.1.normal.js
@@ -1,8 +1,8 @@
//// [protectedClassPropertyAccessibleWithinNestedSubclass.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
"use strict";
_class_call_check(this, B);
@@ -10,10 +10,9 @@ var B = function B() {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.foo = function foo() {
@@ -72,10 +71,9 @@ var C = /*#__PURE__*/ function(B) {
var E = /*#__PURE__*/ function(C) {
"use strict";
_inherits(E, C);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
return E;
}(C);
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.2.minified.js
index 92a3b915e5b..115acfb436d 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass.2.minified.js
@@ -1,5 +1,5 @@
//// [protectedClassPropertyAccessibleWithinNestedSubclass.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.1.normal.js
index f5b52a81d8a..9f540be9b70 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.1.normal.js
@@ -1,7 +1,7 @@
//// [protectedClassPropertyAccessibleWithinNestedSubclass1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -34,10 +34,9 @@ var Base = /*#__PURE__*/ function() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
var _proto = Derived1.prototype;
_proto.method1 = function method1() {
@@ -66,10 +65,9 @@ var Derived1 = /*#__PURE__*/ function(Base) {
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
var _proto = Derived2.prototype;
_proto.method2 = function method2() {
@@ -98,10 +96,9 @@ var Derived2 = /*#__PURE__*/ function(Base) {
var Derived3 = /*#__PURE__*/ function(Derived1) {
"use strict";
_inherits(Derived3, Derived1);
- var _super = _create_super(Derived3);
function Derived3() {
_class_call_check(this, Derived3);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived3, arguments);
}
var _proto = Derived3.prototype;
_proto.method3 = function method3() {
@@ -130,10 +127,9 @@ var Derived3 = /*#__PURE__*/ function(Derived1) {
var Derived4 = /*#__PURE__*/ function(Derived2) {
"use strict";
_inherits(Derived4, Derived2);
- var _super = _create_super(Derived4);
function Derived4() {
_class_call_check(this, Derived4);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived4, arguments);
}
var _proto = Derived4.prototype;
_proto.method4 = function method4() {
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.2.minified.js
index 9ff37cc005d..e76ff50322d 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinNestedSubclass1.2.minified.js
@@ -1,6 +1,6 @@
//// [protectedClassPropertyAccessibleWithinNestedSubclass1.ts]
var b, d1, d2, d3, d4;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
b.x, d1.x, d2.x, d3.x, d4.x;
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.1.normal.js
index 97c1af9b5db..963bb810c56 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.1.normal.js
@@ -1,9 +1,9 @@
//// [protectedClassPropertyAccessibleWithinSubclass.ts]
// no errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
"use strict";
_class_call_check(this, B);
@@ -11,10 +11,9 @@ var B = function B() {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.foo = function foo() {
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.2.minified.js
index 4a8b5007c25..8c4905b816e 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass.2.minified.js
@@ -1,5 +1,5 @@
//// [protectedClassPropertyAccessibleWithinSubclass.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.1.normal.js
index 03b6ade238b..d36d50be083 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.1.normal.js
@@ -1,7 +1,7 @@
//// [protectedClassPropertyAccessibleWithinSubclass2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -25,10 +25,9 @@ var Base = /*#__PURE__*/ function() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
var _proto = Derived1.prototype;
_proto.method1 = function method1() {
@@ -48,10 +47,9 @@ var Derived1 = /*#__PURE__*/ function(Base) {
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
var _proto = Derived2.prototype;
_proto.method2 = function method2() {
@@ -71,10 +69,9 @@ var Derived2 = /*#__PURE__*/ function(Base) {
var Derived3 = /*#__PURE__*/ function(Derived1) {
"use strict";
_inherits(Derived3, Derived1);
- var _super = _create_super(Derived3);
function Derived3() {
_class_call_check(this, Derived3);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived3, arguments);
}
var _proto = Derived3.prototype;
_proto.method3 = function method3() {
@@ -94,10 +91,9 @@ var Derived3 = /*#__PURE__*/ function(Derived1) {
var Derived4 = /*#__PURE__*/ function(Derived2) {
"use strict";
_inherits(Derived4, Derived2);
- var _super = _create_super(Derived4);
function Derived4() {
_class_call_check(this, Derived4);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived4, arguments);
}
var _proto = Derived4.prototype;
_proto.method4 = function method4() {
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.2.minified.js
index 6b56cd7d7e1..a1b2e972f9d 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass2.2.minified.js
@@ -1,6 +1,6 @@
//// [protectedClassPropertyAccessibleWithinSubclass2.ts]
var b, d1, d2, d3, d4;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
b.x, d1.x, d2.x, d3.x, d4.x;
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.1.normal.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.1.normal.js
index 6d172beb6d6..4dcdb4c4657 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.1.normal.js
@@ -1,9 +1,9 @@
//// [protectedClassPropertyAccessibleWithinSubclass3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -18,10 +18,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.method1 = function method1() {
diff --git a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.2.minified.js b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.2.minified.js
index ea11868426e..b061bfad2f3 100644
--- a/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedClassPropertyAccessibleWithinSubclass3.2.minified.js
@@ -1,6 +1,6 @@
//// [protectedClassPropertyAccessibleWithinSubclass3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.1.normal.js b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.1.normal.js
index 6e2a3d06fe0..2514e28a2cc 100644
--- a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.1.normal.js
@@ -1,9 +1,9 @@
//// [protectedInstanceMemberAccessibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -18,10 +18,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.g = function g() {
@@ -54,10 +53,9 @@ var B = /*#__PURE__*/ function(A) {
var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C, A);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.2.minified.js b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.2.minified.js
index 654d42c08c3..dca8c4dc6b8 100644
--- a/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedInstanceMemberAccessibility.2.minified.js
@@ -1,6 +1,6 @@
//// [protectedInstanceMemberAccessibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.1.normal.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.1.normal.js
index a07bcbad38b..be6a0305177 100644
--- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.1.normal.js
@@ -1,7 +1,7 @@
//// [protectedStaticClassPropertyAccessibleWithinSubclass.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -18,10 +18,9 @@ var Base = /*#__PURE__*/ function() {
var Derived1 = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Derived1, Base1);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
Derived1.staticMethod1 = function staticMethod1() {
Base.x; // OK, accessed within a class derived from their declaring class
@@ -34,10 +33,9 @@ var Derived1 = /*#__PURE__*/ function(Base1) {
var Derived2 = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Derived2, Base1);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
Derived2.staticMethod2 = function staticMethod2() {
Base.x; // OK, accessed within a class derived from their declaring class
@@ -50,10 +48,9 @@ var Derived2 = /*#__PURE__*/ function(Base1) {
var Derived3 = /*#__PURE__*/ function(Derived11) {
"use strict";
_inherits(Derived3, Derived11);
- var _super = _create_super(Derived3);
function Derived3() {
_class_call_check(this, Derived3);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived3, arguments);
}
Derived3.staticMethod3 = function staticMethod3() {
Base.x; // OK, accessed within a class derived from their declaring class
diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.2.minified.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.2.minified.js
index 7150d663f66..a3d47102ac3 100644
--- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass.2.minified.js
@@ -1,7 +1,7 @@
//// [protectedStaticClassPropertyAccessibleWithinSubclass.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
function Base() {
_class_call_check(this, Base);
@@ -10,30 +10,24 @@ var Base = /*#__PURE__*/ function() {
Base.x, Derived1.x, Derived2.x, Derived3.x;
}, Base;
}(), Derived1 = /*#__PURE__*/ function(Base1) {
- _inherits(Derived1, Base1);
- var _super = _create_super(Derived1);
function Derived1() {
- return _class_call_check(this, Derived1), _super.apply(this, arguments);
+ return _class_call_check(this, Derived1), _call_super(this, Derived1, arguments);
}
- return Derived1.staticMethod1 = function() {
+ return _inherits(Derived1, Base1), Derived1.staticMethod1 = function() {
Base.x, Derived1.x, Derived2.x, Derived3.x;
}, Derived1;
}(Base), Derived2 = /*#__PURE__*/ function(Base1) {
- _inherits(Derived2, Base1);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2.staticMethod2 = function() {
+ return _inherits(Derived2, Base1), Derived2.staticMethod2 = function() {
Base.x, Derived1.x, Derived2.x, Derived3.x;
}, Derived2;
}(Base), Derived3 = /*#__PURE__*/ function(Derived11) {
- _inherits(Derived3, Derived11);
- var _super = _create_super(Derived3);
function Derived3() {
- return _class_call_check(this, Derived3), _super.apply(this, arguments);
+ return _class_call_check(this, Derived3), _call_super(this, Derived3, arguments);
}
- return Derived3.staticMethod3 = function() {
+ return _inherits(Derived3, Derived11), Derived3.staticMethod3 = function() {
Base.x, Derived1.x, Derived2.x, Derived3.x;
}, Derived3;
}(Derived1);
diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.1.normal.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.1.normal.js
index 352ea472631..9300bc5f501 100644
--- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.1.normal.js
+++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.1.normal.js
@@ -1,9 +1,9 @@
//// [protectedStaticClassPropertyAccessibleWithinSubclass2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -17,10 +17,9 @@ var Base = /*#__PURE__*/ function() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
Derived1.staticMethod1 = function staticMethod1() {
this.x; // OK, accessed within a class derived from their declaring class
@@ -31,10 +30,9 @@ var Derived1 = /*#__PURE__*/ function(Base) {
var Derived2 = /*#__PURE__*/ function(Derived1) {
"use strict";
_inherits(Derived2, Derived1);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
Derived2.staticMethod3 = function staticMethod3() {
this.x; // OK, accessed within a class derived from their declaring class
diff --git a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.2.minified.js b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.2.minified.js
index fb4c2e96a61..434d7008951 100644
--- a/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.2.minified.js
+++ b/crates/swc/tests/tsc-references/protectedStaticClassPropertyAccessibleWithinSubclass2.2.minified.js
@@ -1,6 +1,6 @@
//// [protectedStaticClassPropertyAccessibleWithinSubclass2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/readonlyConstructorAssignment.1.normal.js b/crates/swc/tests/tsc-references/readonlyConstructorAssignment.1.normal.js
index 2d7a026c6c7..82b5b661b8a 100644
--- a/crates/swc/tests/tsc-references/readonlyConstructorAssignment.1.normal.js
+++ b/crates/swc/tests/tsc-references/readonlyConstructorAssignment.1.normal.js
@@ -1,8 +1,8 @@
//// [readonlyConstructorAssignment.ts]
// Tests that readonly parameter properties behave like regular readonly properties
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A(x) {
"use strict";
_class_call_check(this, A);
@@ -12,11 +12,12 @@ var A = function A(x) {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B(x) {
_class_call_check(this, B);
var _this;
- _this = _super.call(this, x);
+ _this = _call_super(this, B, [
+ x
+ ]);
// Fails, x is readonly
_this.x = 1;
return _this;
@@ -26,11 +27,12 @@ var B = /*#__PURE__*/ function(A) {
var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C, A);
- var _super = _create_super(C);
function C(x) {
_class_call_check(this, C);
var _this;
- _this = _super.call(this, x);
+ _this = _call_super(this, C, [
+ x
+ ]);
_this.x = x;
_this.x = 1;
return _this;
@@ -47,11 +49,12 @@ var D = function D(x) {
var E = /*#__PURE__*/ function(D) {
"use strict";
_inherits(E, D);
- var _super = _create_super(E);
function E(x) {
_class_call_check(this, E);
var _this;
- _this = _super.call(this, x);
+ _this = _call_super(this, E, [
+ x
+ ]);
_this.x = x;
_this.x = 1;
return _this;
diff --git a/crates/swc/tests/tsc-references/readonlyConstructorAssignment.2.minified.js b/crates/swc/tests/tsc-references/readonlyConstructorAssignment.2.minified.js
index ec547f3153b..b8f15753d60 100644
--- a/crates/swc/tests/tsc-references/readonlyConstructorAssignment.2.minified.js
+++ b/crates/swc/tests/tsc-references/readonlyConstructorAssignment.2.minified.js
@@ -1,4 +1,4 @@
//// [readonlyConstructorAssignment.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition.1.normal.js b/crates/swc/tests/tsc-references/reexportClassDefinition.1.normal.js
index 7d43c0e4d82..f4c3e274ca3 100644
--- a/crates/swc/tests/tsc-references/reexportClassDefinition.1.normal.js
+++ b/crates/swc/tests/tsc-references/reexportClassDefinition.1.normal.js
@@ -17,17 +17,16 @@ module.exports = {
Object.defineProperty(exports, "__esModule", {
value: true
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
-var _create_super = require("@swc/helpers/_/_create_super");
var foo2 = require("./foo2");
var x = /*#__PURE__*/ function(_foo2_x) {
"use strict";
_inherits._(x, _foo2_x);
- var _super = _create_super._(x);
function x() {
_class_call_check._(this, x);
- return _super.apply(this, arguments);
+ return _call_super._(this, x, arguments);
}
return x;
}(foo2.x);
diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition.2.minified.js b/crates/swc/tests/tsc-references/reexportClassDefinition.2.minified.js
index 57c33722d57..b4e894f891b 100644
--- a/crates/swc/tests/tsc-references/reexportClassDefinition.2.minified.js
+++ b/crates/swc/tests/tsc-references/reexportClassDefinition.2.minified.js
@@ -11,4 +11,4 @@ module.exports = {
//// [foo3.ts]
Object.defineProperty(exports, "__esModule", {
value: !0
-}), require("@swc/helpers/_/_class_call_check"), require("@swc/helpers/_/_inherits"), require("@swc/helpers/_/_create_super"), /*#__PURE__*/ require("./foo2").x;
+}), require("@swc/helpers/_/_call_super"), require("@swc/helpers/_/_class_call_check"), require("@swc/helpers/_/_inherits"), /*#__PURE__*/ require("./foo2").x;
diff --git a/crates/swc/tests/tsc-references/returnStatements.1.normal.js b/crates/swc/tests/tsc-references/returnStatements.1.normal.js
index 7e20dd8cc71..e4a0d48b0b2 100644
--- a/crates/swc/tests/tsc-references/returnStatements.1.normal.js
+++ b/crates/swc/tests/tsc-references/returnStatements.1.normal.js
@@ -1,8 +1,8 @@
//// [returnStatements.ts]
// all the following should be valid
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function fn1() {
return 1;
}
@@ -39,10 +39,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/returnStatements.2.minified.js b/crates/swc/tests/tsc-references/returnStatements.2.minified.js
index b7d8587c4da..960c70106c2 100644
--- a/crates/swc/tests/tsc-references/returnStatements.2.minified.js
+++ b/crates/swc/tests/tsc-references/returnStatements.2.minified.js
@@ -1,4 +1,4 @@
//// [returnStatements.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js b/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js
index a9f4959f979..fef2de1deba 100644
--- a/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js
+++ b/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js
@@ -1,9 +1,9 @@
//// [spellingUncheckedJS.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var inModule = 1;
inmodule.toFixed();
function f() {
@@ -30,10 +30,9 @@ var Classe = /*#__PURE__*/ function() {
var Derivee = /*#__PURE__*/ function(Classe) {
"use strict";
_inherits(Derivee, Classe);
- var _super = _create_super(Derivee);
function Derivee() {
_class_call_check(this, Derivee);
- return _super.apply(this, arguments);
+ return _call_super(this, Derivee, arguments);
}
var _proto = Derivee.prototype;
_proto.methode = function methode() {
diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js b/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js
index 5ca6ff910f3..88a8cf1ac8a 100644
--- a/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js
+++ b/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js
@@ -1,9 +1,9 @@
//// [spellingUncheckedJS.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var inModule = 1;
inmodule.toFixed();
var object = {
diff --git a/crates/swc/tests/tsc-references/staticFactory1.1.normal.js b/crates/swc/tests/tsc-references/staticFactory1.1.normal.js
index cbd4ef2bf7e..f6300e88025 100644
--- a/crates/swc/tests/tsc-references/staticFactory1.1.normal.js
+++ b/crates/swc/tests/tsc-references/staticFactory1.1.normal.js
@@ -1,7 +1,7 @@
//// [staticFactory1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -19,10 +19,9 @@ var Base = /*#__PURE__*/ function() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
var _proto = Derived.prototype;
_proto.foo = function foo() {
diff --git a/crates/swc/tests/tsc-references/staticFactory1.2.minified.js b/crates/swc/tests/tsc-references/staticFactory1.2.minified.js
index 0996165e1e7..ffae4e0124b 100644
--- a/crates/swc/tests/tsc-references/staticFactory1.2.minified.js
+++ b/crates/swc/tests/tsc-references/staticFactory1.2.minified.js
@@ -1,14 +1,12 @@
//// [staticFactory1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ (function(Base) {
- _inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
- return _class_call_check(this, Derived), _super.apply(this, arguments);
+ return _class_call_check(this, Derived), _call_super(this, Derived, arguments);
}
- return Derived.prototype.foo = function() {
+ return _inherits(Derived, Base), Derived.prototype.foo = function() {
return 2;
}, Derived;
})(/*#__PURE__*/ function() {
diff --git a/crates/swc/tests/tsc-references/staticIndexSignature3.1.normal.js b/crates/swc/tests/tsc-references/staticIndexSignature3.1.normal.js
index 6f56f113ed5..27a99d8fda6 100644
--- a/crates/swc/tests/tsc-references/staticIndexSignature3.1.normal.js
+++ b/crates/swc/tests/tsc-references/staticIndexSignature3.1.normal.js
@@ -1,7 +1,7 @@
//// [staticIndexSignature3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
"use strict";
_class_call_check(this, B);
@@ -9,30 +9,27 @@ var B = function B() {
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(B);
var ED = /*#__PURE__*/ function(D) {
"use strict";
_inherits(ED, D);
- var _super = _create_super(ED);
function ED() {
_class_call_check(this, ED);
- return _super.apply(this, arguments);
+ return _call_super(this, ED, arguments);
}
return ED;
}(D);
var DD = /*#__PURE__*/ function(D) {
"use strict";
_inherits(DD, D);
- var _super = _create_super(DD);
function DD() {
_class_call_check(this, DD);
- return _super.apply(this, arguments);
+ return _call_super(this, DD, arguments);
}
return DD;
}(D);
diff --git a/crates/swc/tests/tsc-references/staticIndexSignature3.2.minified.js b/crates/swc/tests/tsc-references/staticIndexSignature3.2.minified.js
index 1617754805c..dbb7532bd77 100644
--- a/crates/swc/tests/tsc-references/staticIndexSignature3.2.minified.js
+++ b/crates/swc/tests/tsc-references/staticIndexSignature3.2.minified.js
@@ -1,29 +1,23 @@
//// [staticIndexSignature3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var B = function B() {
_class_call_check(this, B);
}, D = /*#__PURE__*/ function(B) {
- _inherits(D, B);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, B), D;
}(B), ED = /*#__PURE__*/ function(D) {
- _inherits(ED, D);
- var _super = _create_super(ED);
function ED() {
- return _class_call_check(this, ED), _super.apply(this, arguments);
+ return _class_call_check(this, ED), _call_super(this, ED, arguments);
}
- return ED;
+ return _inherits(ED, D), ED;
}(D), DD = /*#__PURE__*/ function(D) {
- _inherits(DD, D);
- var _super = _create_super(DD);
function DD() {
- return _class_call_check(this, DD), _super.apply(this, arguments);
+ return _class_call_check(this, DD), _call_super(this, DD, arguments);
}
- return DD;
+ return _inherits(DD, D), DD;
}(D);
B.f, B[42], D.f, D[42], ED.f, ED[42], DD.f, DD[42];
diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js
index 7691015cc87..d327b922c96 100644
--- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js
+++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js
@@ -1,8 +1,8 @@
//// [stringIndexerConstrainsPropertyDeclarations2.ts]
// String indexer providing a constraint of a user defined type
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = /*#__PURE__*/ function() {
"use strict";
function A() {
@@ -17,10 +17,9 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
var _proto = B.prototype;
_proto.bar = function bar() {
diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.2.minified.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.2.minified.js
index 90cd0926228..ad11f52c3b2 100644
--- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.2.minified.js
+++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.2.minified.js
@@ -1,4 +1,4 @@
//// [stringIndexerConstrainsPropertyDeclarations2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js
index 897955577ae..c5b64ab3b4c 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypesOfTypeParameter.ts]
// checking whether other types are subtypes of type parameters
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C3 = function C3() {
"use strict";
_class_call_check(this, C3);
@@ -10,10 +10,9 @@ var C3 = function C3() {
var D1 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D1, C3);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(C3);
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameter.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameter.2.minified.js
index 8ec98a3c49d..6716585a3ec 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameter.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameter.2.minified.js
@@ -1,7 +1,7 @@
//// [subtypesOfTypeParameter.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function f() {}
(E1 = E || (E = {}))[E1.A = 0] = "A", (f || (f = {})).bar = 1;
var E, E1, c = function c() {
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.1.normal.js
index 5c4a7c4d578..9363b72fb07 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypesOfTypeParameterWithConstraints.ts]
// checking whether other types are subtypes of type parameters with constraints
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C3 = function C3() {
"use strict";
_class_call_check(this, C3);
@@ -10,40 +10,36 @@ var C3 = function C3() {
var D1 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D1, C3);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(C3);
var D2 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D2, C3);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(C3);
var D3 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D3, C3);
- var _super = _create_super(D3);
function D3() {
_class_call_check(this, D3);
- return _super.apply(this, arguments);
+ return _call_super(this, D3, arguments);
}
return D3;
}(C3);
var D4 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D4, C3);
- var _super = _create_super(D4);
function D4() {
_class_call_check(this, D4);
- return _super.apply(this, arguments);
+ return _call_super(this, D4, arguments);
}
return D4;
}(C3);
@@ -53,30 +49,27 @@ var D4 = /*#__PURE__*/ function(C3) {
var D5 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D5, C3);
- var _super = _create_super(D5);
function D5() {
_class_call_check(this, D5);
- return _super.apply(this, arguments);
+ return _call_super(this, D5, arguments);
}
return D5;
}(C3);
var D6 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D6, C3);
- var _super = _create_super(D6);
function D6() {
_class_call_check(this, D6);
- return _super.apply(this, arguments);
+ return _call_super(this, D6, arguments);
}
return D6;
}(C3);
var D7 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D7, C3);
- var _super = _create_super(D7);
function D7() {
_class_call_check(this, D7);
- return _super.apply(this, arguments);
+ return _call_super(this, D7, arguments);
}
return D7;
}(C3);
@@ -85,30 +78,27 @@ var D7 = /*#__PURE__*/ function(C3) {
var D8 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D8, C3);
- var _super = _create_super(D8);
function D8() {
_class_call_check(this, D8);
- return _super.apply(this, arguments);
+ return _call_super(this, D8, arguments);
}
return D8;
}(C3);
var D9 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D9, C3);
- var _super = _create_super(D9);
function D9() {
_class_call_check(this, D9);
- return _super.apply(this, arguments);
+ return _call_super(this, D9, arguments);
}
return D9;
}(C3);
var D10 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D10, C3);
- var _super = _create_super(D10);
function D10() {
_class_call_check(this, D10);
- return _super.apply(this, arguments);
+ return _call_super(this, D10, arguments);
}
return D10;
}(C3);
@@ -117,30 +107,27 @@ var D10 = /*#__PURE__*/ function(C3) {
var D11 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D11, C3);
- var _super = _create_super(D11);
function D11() {
_class_call_check(this, D11);
- return _super.apply(this, arguments);
+ return _call_super(this, D11, arguments);
}
return D11;
}(C3);
var D12 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D12, C3);
- var _super = _create_super(D12);
function D12() {
_class_call_check(this, D12);
- return _super.apply(this, arguments);
+ return _call_super(this, D12, arguments);
}
return D12;
}(C3);
var D13 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D13, C3);
- var _super = _create_super(D13);
function D13() {
_class_call_check(this, D13);
- return _super.apply(this, arguments);
+ return _call_super(this, D13, arguments);
}
return D13;
}(C3);
@@ -150,40 +137,36 @@ var D13 = /*#__PURE__*/ function(C3) {
var D14 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D14, C3);
- var _super = _create_super(D14);
function D14() {
_class_call_check(this, D14);
- return _super.apply(this, arguments);
+ return _call_super(this, D14, arguments);
}
return D14;
}(C3);
var D15 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D15, C3);
- var _super = _create_super(D15);
function D15() {
_class_call_check(this, D15);
- return _super.apply(this, arguments);
+ return _call_super(this, D15, arguments);
}
return D15;
}(C3);
var D16 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D16, C3);
- var _super = _create_super(D16);
function D16() {
_class_call_check(this, D16);
- return _super.apply(this, arguments);
+ return _call_super(this, D16, arguments);
}
return D16;
}(C3);
var D17 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D17, C3);
- var _super = _create_super(D17);
function D17() {
_class_call_check(this, D17);
- return _super.apply(this, arguments);
+ return _call_super(this, D17, arguments);
}
return D17;
}(C3);
@@ -192,40 +175,36 @@ var D17 = /*#__PURE__*/ function(C3) {
var D18 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D18, C3);
- var _super = _create_super(D18);
function D18() {
_class_call_check(this, D18);
- return _super.apply(this, arguments);
+ return _call_super(this, D18, arguments);
}
return D18;
}(C3);
var D19 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D19, C3);
- var _super = _create_super(D19);
function D19() {
_class_call_check(this, D19);
- return _super.apply(this, arguments);
+ return _call_super(this, D19, arguments);
}
return D19;
}(C3);
var D20 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D20, C3);
- var _super = _create_super(D20);
function D20() {
_class_call_check(this, D20);
- return _super.apply(this, arguments);
+ return _call_super(this, D20, arguments);
}
return D20;
}(C3);
var D21 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D21, C3);
- var _super = _create_super(D21);
function D21() {
_class_call_check(this, D21);
- return _super.apply(this, arguments);
+ return _call_super(this, D21, arguments);
}
return D21;
}(C3);
@@ -234,40 +213,36 @@ var D21 = /*#__PURE__*/ function(C3) {
var D22 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D22, C3);
- var _super = _create_super(D22);
function D22() {
_class_call_check(this, D22);
- return _super.apply(this, arguments);
+ return _call_super(this, D22, arguments);
}
return D22;
}(C3);
var D23 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D23, C3);
- var _super = _create_super(D23);
function D23() {
_class_call_check(this, D23);
- return _super.apply(this, arguments);
+ return _call_super(this, D23, arguments);
}
return D23;
}(C3);
var D24 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D24, C3);
- var _super = _create_super(D24);
function D24() {
_class_call_check(this, D24);
- return _super.apply(this, arguments);
+ return _call_super(this, D24, arguments);
}
return D24;
}(C3);
var D25 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D25, C3);
- var _super = _create_super(D25);
function D25() {
_class_call_check(this, D25);
- return _super.apply(this, arguments);
+ return _call_super(this, D25, arguments);
}
return D25;
}(C3);
@@ -276,40 +251,36 @@ var D25 = /*#__PURE__*/ function(C3) {
var D26 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D26, C3);
- var _super = _create_super(D26);
function D26() {
_class_call_check(this, D26);
- return _super.apply(this, arguments);
+ return _call_super(this, D26, arguments);
}
return D26;
}(C3);
var D27 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D27, C3);
- var _super = _create_super(D27);
function D27() {
_class_call_check(this, D27);
- return _super.apply(this, arguments);
+ return _call_super(this, D27, arguments);
}
return D27;
}(C3);
var D28 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D28, C3);
- var _super = _create_super(D28);
function D28() {
_class_call_check(this, D28);
- return _super.apply(this, arguments);
+ return _call_super(this, D28, arguments);
}
return D28;
}(C3);
var D29 = /*#__PURE__*/ function(C3) {
"use strict";
_inherits(D29, C3);
- var _super = _create_super(D29);
function D29() {
_class_call_check(this, D29);
- return _super.apply(this, arguments);
+ return _call_super(this, D29, arguments);
}
return D29;
}(C3);
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.2.minified.js
index c0b5dc8ac4f..901172f8fed 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints.2.minified.js
@@ -1,4 +1,4 @@
//// [subtypesOfTypeParameterWithConstraints.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.1.normal.js
index 9d2f9b1662c..d16c3899640 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypesOfTypeParameterWithConstraints4.ts]
// checking whether other types are subtypes of type parameters with constraints
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
@@ -34,90 +34,81 @@ var B1 = function B1() {
var D1 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D1, B1);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(B1);
var D2 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D2, B1);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(B1);
var D3 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D3, B1);
- var _super = _create_super(D3);
function D3() {
_class_call_check(this, D3);
- return _super.apply(this, arguments);
+ return _call_super(this, D3, arguments);
}
return D3;
}(B1);
var D4 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D4, B1);
- var _super = _create_super(D4);
function D4() {
_class_call_check(this, D4);
- return _super.apply(this, arguments);
+ return _call_super(this, D4, arguments);
}
return D4;
}(B1);
var D5 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D5, B1);
- var _super = _create_super(D5);
function D5() {
_class_call_check(this, D5);
- return _super.apply(this, arguments);
+ return _call_super(this, D5, arguments);
}
return D5;
}(B1);
var D6 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D6, B1);
- var _super = _create_super(D6);
function D6() {
_class_call_check(this, D6);
- return _super.apply(this, arguments);
+ return _call_super(this, D6, arguments);
}
return D6;
}(B1);
var D7 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D7, B1);
- var _super = _create_super(D7);
function D7() {
_class_call_check(this, D7);
- return _super.apply(this, arguments);
+ return _call_super(this, D7, arguments);
}
return D7;
}(B1);
var D8 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D8, B1);
- var _super = _create_super(D8);
function D8() {
_class_call_check(this, D8);
- return _super.apply(this, arguments);
+ return _call_super(this, D8, arguments);
}
return D8;
}(B1);
var D9 = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(D9, B1);
- var _super = _create_super(D9);
function D9() {
_class_call_check(this, D9);
- return _super.apply(this, arguments);
+ return _call_super(this, D9, arguments);
}
return D9;
}(B1);
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.2.minified.js
index a2fec4d8182..0f0e00a03e7 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints4.2.minified.js
@@ -1,4 +1,4 @@
//// [subtypesOfTypeParameterWithConstraints4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.1.normal.js
index 83a59045fcb..fb6b225cf59 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypesOfTypeParameterWithRecursiveConstraints.ts]
// checking whether other types are subtypes of type parameters with constraints
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
@@ -54,90 +54,81 @@ var M1;
var D1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D1, Base);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(Base);
var D2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D2, Base);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(Base);
var D3 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D3, Base);
- var _super = _create_super(D3);
function D3() {
_class_call_check(this, D3);
- return _super.apply(this, arguments);
+ return _call_super(this, D3, arguments);
}
return D3;
}(Base);
var D4 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D4, Base);
- var _super = _create_super(D4);
function D4() {
_class_call_check(this, D4);
- return _super.apply(this, arguments);
+ return _call_super(this, D4, arguments);
}
return D4;
}(Base);
var D5 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D5, Base);
- var _super = _create_super(D5);
function D5() {
_class_call_check(this, D5);
- return _super.apply(this, arguments);
+ return _call_super(this, D5, arguments);
}
return D5;
}(Base);
var D6 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D6, Base);
- var _super = _create_super(D6);
function D6() {
_class_call_check(this, D6);
- return _super.apply(this, arguments);
+ return _call_super(this, D6, arguments);
}
return D6;
}(Base);
var D7 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D7, Base);
- var _super = _create_super(D7);
function D7() {
_class_call_check(this, D7);
- return _super.apply(this, arguments);
+ return _call_super(this, D7, arguments);
}
return D7;
}(Base);
var D8 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D8, Base);
- var _super = _create_super(D8);
function D8() {
_class_call_check(this, D8);
- return _super.apply(this, arguments);
+ return _call_super(this, D8, arguments);
}
return D8;
}(Base);
var D9 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D9, Base);
- var _super = _create_super(D9);
function D9() {
_class_call_check(this, D9);
- return _super.apply(this, arguments);
+ return _call_super(this, D9, arguments);
}
return D9;
}(Base);
@@ -151,90 +142,81 @@ var M2;
var D1 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D1, Base2);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(Base2);
var D2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D2, Base2);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(Base2);
var D3 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D3, Base2);
- var _super = _create_super(D3);
function D3() {
_class_call_check(this, D3);
- return _super.apply(this, arguments);
+ return _call_super(this, D3, arguments);
}
return D3;
}(Base2);
var D4 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D4, Base2);
- var _super = _create_super(D4);
function D4() {
_class_call_check(this, D4);
- return _super.apply(this, arguments);
+ return _call_super(this, D4, arguments);
}
return D4;
}(Base2);
var D5 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D5, Base2);
- var _super = _create_super(D5);
function D5() {
_class_call_check(this, D5);
- return _super.apply(this, arguments);
+ return _call_super(this, D5, arguments);
}
return D5;
}(Base2);
var D6 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D6, Base2);
- var _super = _create_super(D6);
function D6() {
_class_call_check(this, D6);
- return _super.apply(this, arguments);
+ return _call_super(this, D6, arguments);
}
return D6;
}(Base2);
var D7 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D7, Base2);
- var _super = _create_super(D7);
function D7() {
_class_call_check(this, D7);
- return _super.apply(this, arguments);
+ return _call_super(this, D7, arguments);
}
return D7;
}(Base2);
var D8 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D8, Base2);
- var _super = _create_super(D8);
function D8() {
_class_call_check(this, D8);
- return _super.apply(this, arguments);
+ return _call_super(this, D8, arguments);
}
return D8;
}(Base2);
var D9 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(D9, Base2);
- var _super = _create_super(D9);
function D9() {
_class_call_check(this, D9);
- return _super.apply(this, arguments);
+ return _call_super(this, D9, arguments);
}
return D9;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.2.minified.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.2.minified.js
index 397aadf788d..edda6910c8d 100644
--- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithRecursiveConstraints.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypesOfTypeParameterWithRecursiveConstraints.ts]
var M1, M2;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
M1 || (M1 = {}), M2 || (M2 = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js
index dc8088f6224..f98b576580f 100644
--- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithCallSignatures2.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js
index 3be0ba3f906..ccd3f8daffb 100644
--- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js
@@ -1,7 +1,7 @@
//// [subtypingWithCallSignatures2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
foo1(function(x) {
return [
x
diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js
index ac5d0e23ef0..7e8cac1be2a 100644
--- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js
@@ -1,9 +1,9 @@
//// [subtypingWithCallSignatures3.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
// error cases, so function calls will all result in 'any'
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Errors;
(function(Errors) {
var Base = function Base() {
@@ -13,30 +13,27 @@ var Errors;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js
index fd3bd7bf302..d45d8bdba3b 100644
--- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js
@@ -1,8 +1,8 @@
//// [subtypingWithCallSignatures3.ts]
var Errors, WithGenericSignaturesInBaseType;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Errors || (Errors = {}), foo2(function(x) {
return null;
}), foo7(function(x) {
diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js
index f331d197ca7..c2971efc546 100644
--- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithCallSignatures4.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js
index 7eac2118c58..a358f027993 100644
--- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js
@@ -1,7 +1,7 @@
//// [subtypingWithCallSignatures4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
foo1(function(x) {
return null;
}), foo2(function(x) {
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.1.normal.js
index a9be3b6dd66..5c86a050ecf 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithConstructSignatures2.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.2.minified.js
index f7264dd6a61..d9d71a58325 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures2.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithConstructSignatures2.ts]
var r1arg1, r2arg1, r3arg1, r4arg1, r5arg1, r6arg1, r7arg1, r8arg1, r9arg1, r10arg1, r11arg1, r12arg1, r13arg1, r14arg1, r15arg1, r16arg1, r17arg1, r18arg1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
foo1(r1arg1), foo2(r2arg1), foo3(r3arg1), foo4(r4arg1), foo5(r5arg1), foo6(r6arg1), foo7(r7arg1), foo8(r8arg1), foo9(r9arg1), foo10(r10arg1), foo11(r11arg1), foo12(r12arg1), foo13(r13arg1), foo14(r14arg1), foo15(r15arg1), foo16(r16arg1), foo17(r17arg1), foo18(r18arg1);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.1.normal.js
index d4017402a1f..1c282221592 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.1.normal.js
@@ -1,9 +1,9 @@
//// [subtypingWithConstructSignatures3.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
// error cases, so function calls will all result in 'any'
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Errors;
(function(Errors) {
var Base = function Base() {
@@ -13,30 +13,27 @@ var Errors;
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.2.minified.js
index faed1e177d3..1a12d136a3f 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures3.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithConstructSignatures3.ts]
var Errors, WithGenericSignaturesInBaseType, r1arg1, r2arg1, r3arg1, r4arg1, r5arg1, r6arg1, r7arg1, r7arg3, r8arg, r9arg, r3arg2;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Errors || (Errors = {}), foo2(r1arg1), foo7(r2arg1), foo8(r3arg1), foo10(r4arg1), foo11(r5arg1), foo12(r6arg1), foo15(r7arg1), foo15(r7arg3), foo16(r8arg), foo17(r9arg), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), foo2(void 0), foo3(r3arg2);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.1.normal.js
index fb0a5420439..43ec80a76a4 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithConstructSignatures4.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,30 +10,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.2.minified.js
index 4010157ad02..ee754f54969 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures4.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithConstructSignatures4.ts]
var r1arg, r2arg, r3arg, r4arg, r5arg, r6arg, r11arg, r15arg, r16arg, r17arg, r18arg;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
foo1(r1arg), foo2(r2arg), foo3(r3arg), foo4(r4arg), foo5(r5arg), foo6(r6arg), foo11(r11arg), foo15(r15arg), foo16(r16arg), foo17(r17arg), foo18(r18arg);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.1.normal.js
index 5ff7431903e..d974921a94c 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.1.normal.js
@@ -1,9 +1,9 @@
//// [subtypingWithConstructSignatures5.ts]
// checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -11,30 +11,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.2.minified.js
index 75e3a3de5d3..5b73227c95d 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures5.2.minified.js
@@ -1,4 +1,4 @@
//// [subtypingWithConstructSignatures5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.1.normal.js
index 79ae525ced8..24eb1bcf877 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.1.normal.js
@@ -2,9 +2,9 @@
// checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures
// all are errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -12,30 +12,27 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
var OtherDerived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(OtherDerived, Base);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
- return _super.apply(this, arguments);
+ return _call_super(this, OtherDerived, arguments);
}
return OtherDerived;
}(Base);
diff --git a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.2.minified.js
index 33035a342ce..3e13bbac6b1 100644
--- a/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithConstructSignatures6.2.minified.js
@@ -1,4 +1,4 @@
//// [subtypingWithConstructSignatures6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.1.normal.js
index 094cf789635..67ce00eede9 100644
--- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithNumericIndexer.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -10,20 +10,18 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
@@ -36,40 +34,36 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
var B3 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B3, A);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A);
var B4 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B4, A);
- var _super = _create_super(B4);
function B4() {
_class_call_check(this, B4);
- return _super.apply(this, arguments);
+ return _call_super(this, B4, arguments);
}
return B4;
}(A);
diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.2.minified.js
index d8839422693..295ce16709a 100644
--- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithNumericIndexer.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.1.normal.js
index 0342fd2273c..6b2e8f40420 100644
--- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithNumericIndexer3.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -10,20 +10,18 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
@@ -36,50 +34,45 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
var B3 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B3, A);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A);
var B4 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B4, A);
- var _super = _create_super(B4);
function B4() {
_class_call_check(this, B4);
- return _super.apply(this, arguments);
+ return _call_super(this, B4, arguments);
}
return B4;
}(A);
var B5 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B5, A);
- var _super = _create_super(B5);
function B5() {
_class_call_check(this, B5);
- return _super.apply(this, arguments);
+ return _call_super(this, B5, arguments);
}
return B5;
}(A);
diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.2.minified.js
index 90b2041fc47..2dcebea21b0 100644
--- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer3.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithNumericIndexer3.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.1.normal.js
index 921e50c52c8..04cbf401acf 100644
--- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithNumericIndexer4.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -10,10 +10,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -26,20 +25,18 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B3 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B3, A);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A);
diff --git a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.2.minified.js
index 9a8a7aa20e2..7c7008eb8da 100644
--- a/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithNumericIndexer4.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithNumericIndexer4.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers.1.normal.js
index ee7d9833775..883fe8a44f1 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers.1.normal.js
@@ -1,7 +1,7 @@
//// [subtypingWithObjectMembers.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -9,20 +9,18 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
var Derived2 = /*#__PURE__*/ function(Derived) {
"use strict";
_inherits(Derived2, Derived);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Derived);
@@ -35,10 +33,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -49,10 +46,9 @@ var A2 = function A2() {
var B2 = /*#__PURE__*/ function(A2) {
"use strict";
_inherits(B2, A2);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A2);
@@ -63,10 +59,9 @@ var A3 = function A3() {
var B3 = /*#__PURE__*/ function(A3) {
"use strict";
_inherits(B3, A3);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A3);
@@ -79,10 +74,9 @@ var TwoLevels;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -93,10 +87,9 @@ var TwoLevels;
var B2 = /*#__PURE__*/ function(A2) {
"use strict";
_inherits(B2, A2);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A2);
@@ -107,10 +100,9 @@ var TwoLevels;
var B3 = /*#__PURE__*/ function(A3) {
"use strict";
_inherits(B3, A3);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A3);
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers.2.minified.js
index 042f5f22af7..127d66b90f7 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithObjectMembers.ts]
var TwoLevels;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
TwoLevels || (TwoLevels = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.1.normal.js
index 82b4d572508..7c767810c7b 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithObjectMembers4.ts]
// subtyping when property names do not match
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -24,10 +23,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -38,10 +36,9 @@ var A2 = function A2() {
var B2 = /*#__PURE__*/ function(A2) {
"use strict";
_inherits(B2, A2);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A2);
@@ -52,10 +49,9 @@ var A3 = function A3() {
var B3 = /*#__PURE__*/ function(A3) {
"use strict";
_inherits(B3, A3);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A3);
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.2.minified.js
index b0cc319d6d2..d498e0bb662 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembers4.2.minified.js
@@ -1,4 +1,4 @@
//// [subtypingWithObjectMembers4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.1.normal.js
index 5ec3e155169..1ebf62d8510 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithObjectMembersAccessibility.ts]
// Derived member is private, base member is not causes errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -24,10 +23,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -38,10 +36,9 @@ var A2 = function A2() {
var B2 = /*#__PURE__*/ function(A2) {
"use strict";
_inherits(B2, A2);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A2);
@@ -52,10 +49,9 @@ var A3 = function A3() {
var B3 = /*#__PURE__*/ function(A3) {
"use strict";
_inherits(B3, A3);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A3);
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.2.minified.js
index daee235cf4a..6fd4640497c 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility.2.minified.js
@@ -1,4 +1,4 @@
//// [subtypingWithObjectMembersAccessibility.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.1.normal.js
index 831b812c8da..6d2cbc8249a 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithObjectMembersAccessibility2.ts]
// Derived member is private, base member is not causes errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,10 +10,9 @@ var Base = function Base() {
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived() {
_class_call_check(this, Derived);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived, arguments);
}
return Derived;
}(Base);
@@ -26,10 +25,9 @@ var ExplicitPublic;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -40,10 +38,9 @@ var ExplicitPublic;
var B2 = /*#__PURE__*/ function(A2) {
"use strict";
_inherits(B2, A2);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A2);
@@ -54,10 +51,9 @@ var ExplicitPublic;
var B3 = /*#__PURE__*/ function(A3) {
"use strict";
_inherits(B3, A3);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A3);
@@ -71,10 +67,9 @@ var ImplicitPublic;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -85,10 +80,9 @@ var ImplicitPublic;
var B2 = /*#__PURE__*/ function(A2) {
"use strict";
_inherits(B2, A2);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A2);
@@ -99,10 +93,9 @@ var ImplicitPublic;
var B3 = /*#__PURE__*/ function(A3) {
"use strict";
_inherits(B3, A3);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A3);
diff --git a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.2.minified.js
index 7d6a1d4e222..470ba0ee30c 100644
--- a/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithObjectMembersAccessibility2.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithObjectMembersAccessibility2.ts]
var ExplicitPublic, ImplicitPublic;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
ExplicitPublic || (ExplicitPublic = {}), ImplicitPublic || (ImplicitPublic = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer.1.normal.js
index 91ba40a7351..aff55dbd01c 100644
--- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithStringIndexer.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -10,20 +10,18 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
@@ -36,40 +34,36 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
var B3 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B3, A);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A);
var B4 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B4, A);
- var _super = _create_super(B4);
function B4() {
_class_call_check(this, B4);
- return _super.apply(this, arguments);
+ return _call_super(this, B4, arguments);
}
return B4;
}(A);
diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer.2.minified.js
index d85e256b1f8..e639b711b1c 100644
--- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithStringIndexer.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.1.normal.js
index 7935e87785a..eeadb5fd143 100644
--- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithStringIndexer3.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -10,20 +10,18 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
@@ -36,50 +34,45 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B2, A);
- var _super = _create_super(B2);
function B2() {
_class_call_check(this, B2);
- return _super.apply(this, arguments);
+ return _call_super(this, B2, arguments);
}
return B2;
}(A);
var B3 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B3, A);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A);
var B4 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B4, A);
- var _super = _create_super(B4);
function B4() {
_class_call_check(this, B4);
- return _super.apply(this, arguments);
+ return _call_super(this, B4, arguments);
}
return B4;
}(A);
var B5 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B5, A);
- var _super = _create_super(B5);
function B5() {
_class_call_check(this, B5);
- return _super.apply(this, arguments);
+ return _call_super(this, B5, arguments);
}
return B5;
}(A);
diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.2.minified.js
index e553063ec44..b75049b2945 100644
--- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer3.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithStringIndexer3.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.1.normal.js
index f0ba6ca0757..1b3359e02a2 100644
--- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.1.normal.js
+++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.1.normal.js
@@ -1,8 +1,8 @@
//// [subtypingWithStringIndexer4.ts]
// Derived type indexer must be subtype of base type indexer
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -10,10 +10,9 @@ var A = function A() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
@@ -26,20 +25,18 @@ var Generics;
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
var B3 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B3, A);
- var _super = _create_super(B3);
function B3() {
_class_call_check(this, B3);
- return _super.apply(this, arguments);
+ return _call_super(this, B3, arguments);
}
return B3;
}(A);
diff --git a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.2.minified.js
index a7dee9ac8c8..d9ed5b6ee3f 100644
--- a/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.2.minified.js
+++ b/crates/swc/tests/tsc-references/subtypingWithStringIndexer4.2.minified.js
@@ -1,6 +1,6 @@
//// [subtypingWithStringIndexer4.ts]
var Generics;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Generics || (Generics = {});
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.1.normal.js
index bf0046ea1b6..9486cee0021 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.1.normal.js
@@ -1,7 +1,7 @@
//// [superCallBeforeThisAccessing1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(c) {
"use strict";
_class_call_check(this, Base);
@@ -9,11 +9,12 @@ var Base = function Base(c) {
var D = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D, Base);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
- _this = _super.call(this, i);
+ _this = _call_super(this, D, [
+ i
+ ]);
var s = {
t: _this._t
};
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.2.minified.js
index 98405c035ea..e33e6f87b37 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing1.2.minified.js
@@ -1,4 +1,4 @@
//// [superCallBeforeThisAccessing1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.1.normal.js
index cb409ba04bf..732b565ef5f 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.1.normal.js
@@ -1,7 +1,8 @@
//// [superCallBeforeThisAccessing2.ts]
+import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(c) {
"use strict";
_class_call_check(this, Base);
@@ -9,14 +10,14 @@ var Base = function Base(c) {
var D = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D, Base);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
- _this = _super.call(this, function() {
- _this._t;
- }); // no error. only check when this is directly accessing in constructor
- return _this;
+ return _this = _call_super(this, D, [
+ function() {
+ _assert_this_initialized(_this)._t;
+ }
+ ]); // no error. only check when this is directly accessing in constructor
}
return D;
}(Base);
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.2.minified.js
index ce3f5756328..c0b78493ce0 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing2.2.minified.js
@@ -1,4 +1,5 @@
//// [superCallBeforeThisAccessing2.ts]
+import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.1.normal.js
index a478bf64ca9..16f74788841 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.1.normal.js
@@ -1,16 +1,15 @@
//// [superCallBeforeThisAccessing5.ts]
+import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var D = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(D, _superClass);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
- _this._t; // No error
+ _assert_this_initialized(_this)._t; // No error
return _possible_constructor_return(_this);
}
return D;
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.2.minified.js
index 3ed1dd49cc3..757ef7bf333 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing5.2.minified.js
@@ -1,5 +1,5 @@
//// [superCallBeforeThisAccessing5.ts]
+import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.1.normal.js
index d0f84d47f1c..b67896b8414 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.1.normal.js
@@ -1,8 +1,7 @@
//// [superCallBeforeThisAccessing8.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(c) {
"use strict";
_class_call_check(this, Base);
@@ -10,15 +9,16 @@ var Base = function Base(c) {
var D = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D, Base);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
var x = {
- k: _this = _super.call(this, undefined),
+ k: _this = _call_super(this, D, [
+ undefined
+ ]),
j: _this._t
};
- return _possible_constructor_return(_this);
+ return _this;
}
return D;
}(Base);
diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.2.minified.js
index 16b0c00195e..4f9ab588072 100644
--- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing8.2.minified.js
@@ -1,5 +1,4 @@
//// [superCallBeforeThisAccessing8.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.1.normal.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.1.normal.js
index 0b065cc2549..2168002c046 100644
--- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.1.normal.js
@@ -1,7 +1,7 @@
//// [superCallParameterContextualTyping1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A(map) {
"use strict";
_class_call_check(this, A);
@@ -10,12 +10,13 @@ var A = function A(map) {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.call(this, function(value) {
- return String(value.toExponential());
- });
+ return _call_super(this, B, [
+ function(value) {
+ return String(value.toExponential());
+ }
+ ]);
}
return B;
}(A);
diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.2.minified.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.2.minified.js
index 86ee4c53fb4..90d732f2c44 100644
--- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping1.2.minified.js
@@ -1,4 +1,4 @@
//// [superCallParameterContextualTyping1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.1.normal.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.1.normal.js
index 46eff5e5b8e..10b8d2d6fd3 100644
--- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.1.normal.js
@@ -1,7 +1,7 @@
//// [superCallParameterContextualTyping2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A(map) {
"use strict";
_class_call_check(this, A);
@@ -10,12 +10,13 @@ var A = function A(map) {
var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C, A);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.call(this, function(value) {
- return String(value());
- });
+ return _call_super(this, C, [
+ function(value) {
+ return String(value());
+ }
+ ]);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.2.minified.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.2.minified.js
index c3c90011d59..fd3e6fb92cf 100644
--- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping2.2.minified.js
@@ -1,4 +1,4 @@
//// [superCallParameterContextualTyping2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.1.normal.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.1.normal.js
index 5593edf1b81..8dbb18179c1 100644
--- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.1.normal.js
@@ -1,10 +1,10 @@
//// [superCallParameterContextualTyping3.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var CBase = /*#__PURE__*/ function() {
"use strict";
function CBase(param) {
@@ -17,14 +17,18 @@ var CBase = /*#__PURE__*/ function() {
var C = /*#__PURE__*/ function(CBase) {
"use strict";
_inherits(C, CBase);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- var _this = _super.call(this, {
- method: function method(p) {
- p.length;
+ var _this;
+ // Should be okay.
+ // 'p' should have type 'string'.
+ _this = _call_super(this, C, [
+ {
+ method: function method(p) {
+ p.length;
+ }
}
- });
+ ]);
// Should be okay.
// 'p' should have type 'string'.
_get((_assert_this_initialized(_this), _get_prototype_of(C.prototype)), "foo", _this).call(_this, {
diff --git a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.2.minified.js b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.2.minified.js
index 5da33112762..ea438695549 100644
--- a/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCallParameterContextualTyping3.2.minified.js
@@ -1,7 +1,7 @@
//// [superCallParameterContextualTyping3.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superCalls.1.normal.js b/crates/swc/tests/tsc-references/superCalls.1.normal.js
index 0eef0d50c9c..e0866b10291 100644
--- a/crates/swc/tests/tsc-references/superCalls.1.normal.js
+++ b/crates/swc/tests/tsc-references/superCalls.1.normal.js
@@ -1,7 +1,7 @@
//// [superCalls.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base(n) {
"use strict";
_class_call_check(this, Base);
@@ -11,15 +11,18 @@ function v() {}
var Derived = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived, Base);
- var _super = _create_super(Derived);
function Derived(q) {
_class_call_check(this, Derived);
var _this;
- _this = _super.call(this, '');
+ _this = _call_super(this, Derived, [
+ ''
+ ]);
_this.q = q;
var _temp;
//type of super call expression is void
- var p = (_temp = _this = _super.call(this, ''), _this.q = q, _temp);
+ var p = (_temp = _this = _call_super(this, Derived, [
+ ''
+ ]), _this.q = q, _temp);
var p = v();
return _this;
}
@@ -32,11 +35,10 @@ var OtherBase = function OtherBase() {
var OtherDerived = /*#__PURE__*/ function(OtherBase) {
"use strict";
_inherits(OtherDerived, OtherBase);
- var _super = _create_super(OtherDerived);
function OtherDerived() {
_class_call_check(this, OtherDerived);
var p = '';
- return _super.call(this);
+ return _call_super(this, OtherDerived);
}
return OtherDerived;
}(OtherBase);
diff --git a/crates/swc/tests/tsc-references/superCalls.2.minified.js b/crates/swc/tests/tsc-references/superCalls.2.minified.js
index 531ce1b62f1..40267c6979a 100644
--- a/crates/swc/tests/tsc-references/superCalls.2.minified.js
+++ b/crates/swc/tests/tsc-references/superCalls.2.minified.js
@@ -1,4 +1,4 @@
//// [superCalls.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).1.normal.js b/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).1.normal.js
index b76a08eb0cc..ec5a23c7d68 100644
--- a/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).1.normal.js
@@ -13,18 +13,17 @@ var _default = function _default() {
};
export { _default as default };
//// [locals.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
@@ -137,129 +136,123 @@ _get(_get_prototype_of(C), "w", C).call(C);
})();
export { };
//// [varInContainingScopeStaticField1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [varInContainingScopeStaticField2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = {
Reflect: null
}.Reflect; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [varInContainingScopeStaticField3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [varInContainingScopeStaticBlock1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [varInContainingScopeStaticBlock2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = {
Reflect: null
}.Reflect; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [varInContainingScopeStaticBlock3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [classDeclInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -268,21 +261,20 @@ var Reflect = function Reflect() {
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [classDeclInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect = function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -291,569 +283,538 @@ var Reflect = function Reflect() {
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [funcDeclInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function Reflect() {} // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [funcDeclInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function Reflect() {} // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [valueNamespaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [valueNamespaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [enumInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect;
(function(Reflect) {})(Reflect || (Reflect = {})); // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [enumInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect;
(function(Reflect) {})(Reflect || (Reflect = {})); // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [constEnumInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [constEnumInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [namespaceImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [namespaceImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [namedImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [namedImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [namedImportOfInterfaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only, not a type-only import)
//// [namedImportOfInterfaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only, not a type-only import)
//// [namedImportOfUninstantiatedNamespaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only, not a type-only import)
//// [namedImportOfUninstantiatedNamespaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only, not a type-only import)
//// [namedImportOfConstEnumInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [namedImportOfConstEnumInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [typeOnlyNamedImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // no collision
//// [typeOnlyNamedImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // no collision
//// [defaultImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [defaultImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // collision (es2015-es2021 only)
//// [typeOnlyDefaultImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { }; // no collision
//// [typeOnlyDefaultImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { }; // no collision
//// [typeInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [typeInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [interfaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [interfaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [uninstantiatedNamespaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [uninstantiatedNamespaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [classExprInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -861,21 +822,20 @@ import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [classExprInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -883,21 +843,20 @@ import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [inContainingClassExprStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _Reflect;
_Reflect = function Reflect() {
"use strict";
@@ -906,10 +865,9 @@ _Reflect = function Reflect() {
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
@@ -917,11 +875,11 @@ _Reflect = function Reflect() {
}(), _Reflect;
export { };
//// [inContainingClassExprStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _Reflect;
_Reflect = function Reflect() {
"use strict";
@@ -930,10 +888,9 @@ _Reflect = function Reflect() {
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
@@ -941,57 +898,54 @@ _Reflect = function Reflect() {
}(), _Reflect;
export { };
//// [funcExprInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(function Reflect() {}); // no collision
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [funcExprInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(function Reflect() {}); // no collision
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
export { };
//// [inContainingFuncExprStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(function Reflect() {
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
@@ -999,19 +953,18 @@ import { _ as _create_super } from "@swc/helpers/_/_create_super";
});
export { };
//// [inContainingFuncExprStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(function Reflect() {
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
diff --git a/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).2.minified.js b/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).2.minified.js
index b792f2ebf0f..695987ff3fa 100644
--- a/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/superInStaticMembers1(target=es5).2.minified.js
@@ -11,18 +11,16 @@ var _default = function _default() {
};
export { _default as default };
//// [locals.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Reflect, Reflect1, C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = [
void _get(_get_prototype_of(C), "w", C).call(C),
@@ -38,676 +36,588 @@ C._ = [
void _get(_get_prototype_of(C), "w", C).call(C)
], _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), Reflect1 || (Reflect1 = {}), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C), _get(_get_prototype_of(C), "w", C).call(C);
//// [varInContainingScopeStaticField1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [varInContainingScopeStaticField2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [varInContainingScopeStaticField3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [varInContainingScopeStaticBlock1.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [varInContainingScopeStaticBlock2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [varInContainingScopeStaticBlock3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [classDeclInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [classDeclInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [funcDeclInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [funcDeclInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [valueNamespaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [valueNamespaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [enumInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Reflect || (Reflect = {});
var Reflect, C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [enumInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
Reflect || (Reflect = {});
var Reflect, C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [constEnumInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [constEnumInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [namespaceImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [namespaceImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportOfInterfaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportOfInterfaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportOfUninstantiatedNamespaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportOfUninstantiatedNamespaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportOfConstEnumInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [namedImportOfConstEnumInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [typeOnlyNamedImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [typeOnlyNamedImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [defaultImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [defaultImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [typeOnlyDefaultImportInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [typeOnlyDefaultImportInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [typeInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [typeInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [interfaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [interfaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [uninstantiatedNamespaceInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [uninstantiatedNamespaceInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [classExprInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [classExprInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [inContainingClassExprStaticField.ts]
var C;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
(C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B))._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [inContainingClassExprStaticBlock.ts]
var C;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
_get(_get_prototype_of(C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B)), "w", C).call(C);
//// [funcExprInContainingScopeStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
//// [funcExprInContainingScopeStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_get(_get_prototype_of(C), "w", C).call(C);
//// [inContainingFuncExprStaticField.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
//// [inContainingFuncExprStaticBlock.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js b/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js
index ccf16688782..0220643506d 100644
--- a/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js
+++ b/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js
@@ -6,12 +6,12 @@
//super.publicStaticMemberFunction in static member function of derived class
//super.publicStaticMemberFunction in static member accessor(get and set) of derived class
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var SomeBaseClass = /*#__PURE__*/ function() {
"use strict";
function SomeBaseClass() {
@@ -32,10 +32,10 @@ var SomeBaseClass = /*#__PURE__*/ function() {
var SomeDerivedClass = /*#__PURE__*/ function(SomeBaseClass) {
"use strict";
_inherits(SomeDerivedClass, SomeBaseClass);
- var _super = _create_super(SomeDerivedClass);
function SomeDerivedClass() {
_class_call_check(this, SomeDerivedClass);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, SomeDerivedClass);
var x = _get((_assert_this_initialized(_this), _get_prototype_of(SomeDerivedClass.prototype)), "func", _this).call(_this);
var x;
return _this;
diff --git a/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js b/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js
index 3c0c25b4022..e544ed3edc0 100644
--- a/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js
+++ b/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js
@@ -1,19 +1,17 @@
//// [superPropertyAccessNoError.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
new /*#__PURE__*/ (function(SomeBaseClass) {
- _inherits(SomeDerivedClass, SomeBaseClass);
- var _super = _create_super(SomeDerivedClass);
function SomeDerivedClass() {
- _class_call_check(this, SomeDerivedClass);
- var _this = _super.call(this);
- return _get((_assert_this_initialized(_this), _get_prototype_of(SomeDerivedClass.prototype)), "func", _this).call(_this), _this;
+ var _this;
+ return _class_call_check(this, SomeDerivedClass), _get((_assert_this_initialized(_this = _call_super(this, SomeDerivedClass)), _get_prototype_of(SomeDerivedClass.prototype)), "func", _this).call(_this), _this;
}
+ _inherits(SomeDerivedClass, SomeBaseClass);
var _proto = SomeDerivedClass.prototype;
return _proto.fn = function() {
_get(_get_prototype_of(SomeDerivedClass.prototype), "func", this).call(this);
diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.1.normal.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.1.normal.js
index f65b9d68ec0..7568df207f3 100644
--- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.1.normal.js
+++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.1.normal.js
@@ -1,9 +1,9 @@
//// [superSymbolIndexedAccess5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var symbol;
var Foo = /*#__PURE__*/ function() {
"use strict";
@@ -19,10 +19,9 @@ var Foo = /*#__PURE__*/ function() {
var Bar = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar, arguments);
}
var _proto = Bar.prototype;
_proto[symbol] = function() {
diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.2.minified.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.2.minified.js
index 1775ed6345d..79d757759f3 100644
--- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.2.minified.js
+++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess5.2.minified.js
@@ -1,6 +1,6 @@
//// [superSymbolIndexedAccess5.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.1.normal.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.1.normal.js
index f83846f767e..196dcad319c 100644
--- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.1.normal.js
+++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.1.normal.js
@@ -1,9 +1,9 @@
//// [superSymbolIndexedAccess6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var symbol;
var Foo = /*#__PURE__*/ function() {
"use strict";
@@ -18,10 +18,9 @@ var Foo = /*#__PURE__*/ function() {
var Bar = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
- return _super.apply(this, arguments);
+ return _call_super(this, Bar, arguments);
}
Bar[symbol] = function() {
return _get(_get_prototype_of(Bar), symbol, this).call(this);
diff --git a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.2.minified.js b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.2.minified.js
index 8a3394890e6..9c96d6e493e 100644
--- a/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.2.minified.js
+++ b/crates/swc/tests/tsc-references/superSymbolIndexedAccess6.2.minified.js
@@ -1,6 +1,6 @@
//// [superSymbolIndexedAccess6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/switchStatements.1.normal.js b/crates/swc/tests/tsc-references/switchStatements.1.normal.js
index 4d453ed2b51..891491ce687 100644
--- a/crates/swc/tests/tsc-references/switchStatements.1.normal.js
+++ b/crates/swc/tests/tsc-references/switchStatements.1.normal.js
@@ -1,8 +1,8 @@
//// [switchStatements.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _type_of } from "@swc/helpers/_/_type_of";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var M;
(function(M) {
function fn(x) {
@@ -47,10 +47,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/switchStatements.2.minified.js b/crates/swc/tests/tsc-references/switchStatements.2.minified.js
index eec585194e6..34dd6a0eece 100644
--- a/crates/swc/tests/tsc-references/switchStatements.2.minified.js
+++ b/crates/swc/tests/tsc-references/switchStatements.2.minified.js
@@ -1,8 +1,8 @@
//// [switchStatements.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _type_of } from "@swc/helpers/_/_type_of";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
switch((M || (M = {})).fn = function(x) {
return '';
}, x){
@@ -30,12 +30,10 @@ switch((M || (M = {})).fn = function(x) {
var M, x, C = function C() {
_class_call_check(this, C);
}, D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C);
switch(new C()){
case new D():
diff --git a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.1.normal.js b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.1.normal.js
index 111673d8464..a13d903979c 100644
--- a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.1.normal.js
+++ b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.1.normal.js
@@ -1,23 +1,22 @@
//// [thisAndSuperInStaticMembers3.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, C, arguments);
// these should be unaffected
- _define_property(_assert_this_initialized(_this), "x", 1);
- _define_property(_assert_this_initialized(_this), "y", _this.x);
- _define_property(_assert_this_initialized(_this), "z", _get((_assert_this_initialized(_this), _get_prototype_of(C.prototype)), "f", _this).call(_this));
+ _define_property(_this, "x", 1);
+ _define_property(_this, "y", _this.x);
+ _define_property(_this, "z", _get((_assert_this_initialized(_this), _get_prototype_of(C.prototype)), "f", _this).call(_this));
return _this;
}
return C;
diff --git a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.2.minified.js b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.2.minified.js
index 89e5f80df53..f828237a0d3 100644
--- a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.2.minified.js
+++ b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers3.2.minified.js
@@ -1,18 +1,16 @@
//// [thisAndSuperInStaticMembers3.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
var _this;
- return _class_call_check(this, C), _this = _super.apply(this, arguments), _define_property(_assert_this_initialized(_this), "x", 1), _define_property(_assert_this_initialized(_this), "y", _this.x), _define_property(_assert_this_initialized(_this), "z", _get((_assert_this_initialized(_this), _get_prototype_of(C.prototype)), "f", _this).call(_this)), _this;
+ return _class_call_check(this, C), _this = _call_super(this, C, arguments), _define_property(_this, "x", 1), _define_property(_this, "y", _this.x), _define_property(_this, "z", _get((_assert_this_initialized(_this), _get_prototype_of(C.prototype)), "f", _this).call(_this)), _this;
}
- return C;
+ return _inherits(C, B1), C;
}(B);
_define_property(C, "x", void 0), _define_property(C, "y1", C.x), _define_property(C, "y2", C.x()), _define_property(C, "y3", null == C ? void 0 : C.x()), _define_property(C, "y4", C.x()), _define_property(C, "y5", null == C ? void 0 : C.x()), _define_property(C, "z3", _get(_get_prototype_of(C), "f", C).call(C)), _define_property(C, "z4", _get(_get_prototype_of(C), "f", C).call(C));
diff --git a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.1.normal.js b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.1.normal.js
index fd944601307..5c0adc77a84 100644
--- a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.1.normal.js
+++ b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.1.normal.js
@@ -1,18 +1,17 @@
//// [thisAndSuperInStaticMembers4.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, C, arguments);
// these should be unaffected
_this.x = 1;
_this.y = _this.x;
diff --git a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.2.minified.js b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.2.minified.js
index abe74d59d11..49506caf86d 100644
--- a/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.2.minified.js
+++ b/crates/swc/tests/tsc-references/thisAndSuperInStaticMembers4.2.minified.js
@@ -1,17 +1,15 @@
//// [thisAndSuperInStaticMembers4.ts]
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(B1) {
- _inherits(C, B1);
- var _super = _create_super(C);
function C() {
var _this;
- return _class_call_check(this, C), _this = _super.apply(this, arguments), _this.x = 1, _this.y = _this.x, _this.z = _get((_assert_this_initialized(_this), _get_prototype_of(C.prototype)), "f", _this).call(_this), _this;
+ return _class_call_check(this, C), _this = _call_super(this, C, arguments), _this.x = 1, _this.y = _this.x, _this.z = _get((_assert_this_initialized(_this), _get_prototype_of(C.prototype)), "f", _this).call(_this), _this;
}
- return C;
+ return _inherits(C, B1), C;
}(B);
C.x = void 0, C.y1 = C.x, C.y2 = C.x(), C.y3 = null == C ? void 0 : C.x(), C.y4 = C.x(), C.y5 = null == C ? void 0 : C.x(), C.z3 = _get(_get_prototype_of(C), "f", C).call(C), C.z4 = _get(_get_prototype_of(C), "f", C).call(C);
diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js
index 2df0ef34bab..2be0d9a13f5 100644
--- a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js
+++ b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js
@@ -1,9 +1,9 @@
//// [thisPropertyAssignmentInherited.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var Element = /*#__PURE__*/ function() {
"use strict";
function Element() {
@@ -29,20 +29,18 @@ export var Element = /*#__PURE__*/ function() {
export var HTMLElement = /*#__PURE__*/ function(Element) {
"use strict";
_inherits(HTMLElement, Element);
- var _super = _create_super(HTMLElement);
function HTMLElement() {
_class_call_check(this, HTMLElement);
- return _super.apply(this, arguments);
+ return _call_super(this, HTMLElement, arguments);
}
return HTMLElement;
}(_wrap_native_super(Element));
export var TextElement = /*#__PURE__*/ function(HTMLElement) {
"use strict";
_inherits(TextElement, HTMLElement);
- var _super = _create_super(TextElement);
function TextElement() {
_class_call_check(this, TextElement);
- return _super.apply(this, arguments);
+ return _call_super(this, TextElement, arguments);
}
var _proto = TextElement.prototype;
_proto.toString = function toString() {};
diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js
index da1edb9275f..239404a6189 100644
--- a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js
+++ b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js
@@ -1,9 +1,9 @@
//// [thisPropertyAssignmentInherited.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _wrap_native_super } from "@swc/helpers/_/_wrap_native_super";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var Element = /*#__PURE__*/ function() {
function Element() {
_class_call_check(this, Element);
@@ -21,20 +21,16 @@ export var Element = /*#__PURE__*/ function() {
]), Element;
}();
export var HTMLElement = /*#__PURE__*/ function(Element) {
- _inherits(HTMLElement, Element);
- var _super = _create_super(HTMLElement);
function HTMLElement() {
- return _class_call_check(this, HTMLElement), _super.apply(this, arguments);
+ return _class_call_check(this, HTMLElement), _call_super(this, HTMLElement, arguments);
}
- return HTMLElement;
+ return _inherits(HTMLElement, Element), HTMLElement;
}(_wrap_native_super(Element));
export var TextElement = /*#__PURE__*/ function(HTMLElement) {
- _inherits(TextElement, HTMLElement);
- var _super = _create_super(TextElement);
function TextElement() {
- return _class_call_check(this, TextElement), _super.apply(this, arguments);
+ return _class_call_check(this, TextElement), _call_super(this, TextElement, arguments);
}
- return TextElement.prototype.toString = function() {}, _create_class(TextElement, [
+ return _inherits(TextElement, HTMLElement), TextElement.prototype.toString = function() {}, _create_class(TextElement, [
{
key: "innerHTML",
get: function() {
diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js
index 2b45c1a0e14..8f979ad319b 100644
--- a/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js
+++ b/crates/swc/tests/tsc-references/thisTypeInFunctions.1.normal.js
@@ -1,8 +1,8 @@
//// [thisTypeInFunctions.ts]
// body checking
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _this = this;
var B = function B() {
"use strict";
@@ -31,10 +31,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
@@ -214,10 +213,9 @@ var Base1 = /*#__PURE__*/ function() {
var Derived1 = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Derived1, Base1);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
return Derived1;
}(Base1);
@@ -238,10 +236,9 @@ var Base2 = /*#__PURE__*/ function() {
var Derived2 = /*#__PURE__*/ function(Base2) {
"use strict";
_inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base2);
diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInFunctions.2.minified.js
index b15dbb236f0..60e2f31e851 100644
--- a/crates/swc/tests/tsc-references/thisTypeInFunctions.2.minified.js
+++ b/crates/swc/tests/tsc-references/thisTypeInFunctions.2.minified.js
@@ -1,7 +1,7 @@
//// [thisTypeInFunctions.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var explicitCFunction, explicitPropertyFunction, _this = this, C = /*#__PURE__*/ function() {
function C() {
_class_call_check(this, C);
@@ -17,12 +17,10 @@ var explicitCFunction, explicitPropertyFunction, _this = this, C = /*#__PURE__*/
return m + 1;
}, C;
}(), D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C);
function implicitThis(n) {
return this.m + n + 12;
@@ -121,12 +119,10 @@ var Base1 = /*#__PURE__*/ function() {
return this.y;
}, Base1;
}(), Derived1 = /*#__PURE__*/ function(Base1) {
- _inherits(Derived1, Base1);
- var _super = _create_super(Derived1);
function Derived1() {
- return _class_call_check(this, Derived1), _super.apply(this, arguments);
+ return _class_call_check(this, Derived1), _call_super(this, Derived1, arguments);
}
- return Derived1;
+ return _inherits(Derived1, Base1), Derived1;
}(Base1), Base2 = /*#__PURE__*/ function() {
function Base2() {
_class_call_check(this, Base2);
@@ -138,12 +134,10 @@ var Base1 = /*#__PURE__*/ function() {
return this.x;
}, Base2;
}(), Derived2 = /*#__PURE__*/ function(Base2) {
- _inherits(Derived2, Base2);
- var _super = _create_super(Derived2);
function Derived2() {
- return _class_call_check(this, Derived2), _super.apply(this, arguments);
+ return _class_call_check(this, Derived2), _call_super(this, Derived2, arguments);
}
- return Derived2;
+ return _inherits(Derived2, Base2), Derived2;
}(Base2), b1 = new Base1(), b2 = new Base2(), d1 = new Derived1(), d2 = new Derived2();
d2.polymorphic = d1.polymorphic, d1.polymorphic = d2.polymorphic, d1.polymorphic = b2.polymorphic, d2.polymorphic = d1.explicit, b1.polymorphic = d2.polymorphic, b1.explicit = d2.polymorphic, new function() {
this.a = 12;
diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions3.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInFunctions3.1.normal.js
index 9e66a385805..e31f96e56c7 100644
--- a/crates/swc/tests/tsc-references/thisTypeInFunctions3.1.normal.js
+++ b/crates/swc/tests/tsc-references/thisTypeInFunctions3.1.normal.js
@@ -1,14 +1,13 @@
//// [thisTypeInFunctions3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Test = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Test, Base1);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- return _super.apply(this, arguments);
+ return _call_super(this, Test, arguments);
}
var _proto = Test.prototype;
_proto.m = function m() {
diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js
index 96f0c388f2b..47532b33df6 100644
--- a/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js
+++ b/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js
@@ -1,5 +1,5 @@
//// [thisTypeInFunctions3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ Base;
diff --git a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.1.normal.js b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.1.normal.js
index ae22208ec2a..36f773832ff 100644
--- a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.1.normal.js
@@ -1,14 +1,13 @@
//// [tsxCorrectlyParseLessThanComparison1.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var ShortDetails = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(ShortDetails, _React_Component);
- var _super = _create_super(ShortDetails);
function ShortDetails() {
_class_call_check(this, ShortDetails);
- return _super.apply(this, arguments);
+ return _call_super(this, ShortDetails, arguments);
}
var _proto = ShortDetails.prototype;
_proto.render = function render() {
diff --git a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.2.minified.js b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.2.minified.js
index 669222faa28..7d8b389c76a 100644
--- a/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxCorrectlyParseLessThanComparison1.2.minified.js
@@ -1,14 +1,12 @@
//// [tsxCorrectlyParseLessThanComparison1.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var ShortDetails = /*#__PURE__*/ function(_React_Component) {
- _inherits(ShortDetails, _React_Component);
- var _super = _create_super(ShortDetails);
function ShortDetails() {
- return _class_call_check(this, ShortDetails), _super.apply(this, arguments);
+ return _class_call_check(this, ShortDetails), _call_super(this, ShortDetails, arguments);
}
- return ShortDetails.prototype.render = function() {
+ return _inherits(ShortDetails, _React_Component), ShortDetails.prototype.render = function() {
if (this.props.id < 1) return /*#__PURE__*/ React.createElement("div", null);
}, ShortDetails;
}(React.Component);
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js
index 42444379166..3fc6b1cabd5 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js
@@ -1,18 +1,17 @@
//// [tsxDynamicTagName5.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
_class_call_check(this, Text);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Text, arguments);
_this._tagName = 'div';
return _this;
}
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js
index a88902d8b7f..e3b123edbd3 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js
@@ -1,18 +1,16 @@
//// [tsxDynamicTagName5.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
- _inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
var _this;
- return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this;
+ return _class_call_check(this, Text), _this = _call_super(this, Text, arguments), _this._tagName = 'div', _this;
}
- return Text.prototype.render = function() {
+ return _inherits(Text, _React_Component), Text.prototype.render = function() {
return /*#__PURE__*/ React.createElement(this._tagName, null);
}, Text;
}(React.Component);
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js
index c24d17f44cb..b4719469f95 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js
@@ -1,18 +1,17 @@
//// [tsxDynamicTagName7.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
_class_call_check(this, Text);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Text, arguments);
_this._tagName = 'div';
return _this;
}
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js
index b56efea13d0..f3871197d1f 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js
@@ -1,18 +1,16 @@
//// [tsxDynamicTagName7.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
- _inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
var _this;
- return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this;
+ return _class_call_check(this, Text), _this = _call_super(this, Text, arguments), _this._tagName = 'div', _this;
}
- return Text.prototype.render = function() {
+ return _inherits(Text, _React_Component), Text.prototype.render = function() {
return /*#__PURE__*/ React.createElement(this, null);
}, Text;
}(React.Component);
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js
index 0ce4c006b69..f68382461ba 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js
@@ -1,18 +1,17 @@
//// [tsxDynamicTagName8.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
_class_call_check(this, Text);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Text, arguments);
_this._tagName = 'div';
return _this;
}
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js
index 1c4796bb5d5..65710a6f393 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js
@@ -1,18 +1,16 @@
//// [tsxDynamicTagName8.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
- _inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
var _this;
- return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this;
+ return _class_call_check(this, Text), _this = _call_super(this, Text, arguments), _this._tagName = 'div', _this;
}
- return Text.prototype.render = function() {
+ return _inherits(Text, _React_Component), Text.prototype.render = function() {
return /*#__PURE__*/ React.createElement(this._tagName, null, " Hello world ");
}, Text;
}(React.Component);
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js
index 98271a0e141..96a0cb51ee3 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js
@@ -1,18 +1,17 @@
//// [tsxDynamicTagName9.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
_class_call_check(this, Text);
var _this;
- _this = _super.apply(this, arguments);
+ _this = _call_super(this, Text, arguments);
_this._tagName = 'div';
return _this;
}
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js
index b4f40e3a239..ed176001eb3 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js
@@ -1,18 +1,16 @@
//// [tsxDynamicTagName9.tsx]
//// [react.d.ts]
//// [app.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import * as React from 'react';
export var Text = /*#__PURE__*/ function(_React_Component) {
- _inherits(Text, _React_Component);
- var _super = _create_super(Text);
function Text() {
var _this;
- return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this;
+ return _class_call_check(this, Text), _this = _call_super(this, Text, arguments), _this._tagName = 'div', _this;
}
- return Text.prototype.render = function() {
+ return _inherits(Text, _React_Component), Text.prototype.render = function() {
return /*#__PURE__*/ React.createElement(this._tagName, null, " Hello world ");
}, Text;
}(React.Component);
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.1.normal.js
index 67e5ccb9fd7..c4e4ffe19d5 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.1.normal.js
@@ -13,19 +13,18 @@ Object.defineProperty(exports, "App", {
return App;
}
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
-var _create_super = require("@swc/helpers/_/_create_super");
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
var _button = require("./button");
var App = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits._(App, _React_Component);
- var _super = _create_super._(App);
function App() {
_class_call_check._(this, App);
- return _super.apply(this, arguments);
+ return _call_super._(this, App, arguments);
}
var _proto = App.prototype;
_proto.render = function render() {
@@ -44,18 +43,17 @@ Object.defineProperty(exports, "Button", {
return Button;
}
});
+var _call_super = require("@swc/helpers/_/_call_super");
var _class_call_check = require("@swc/helpers/_/_class_call_check");
var _inherits = require("@swc/helpers/_/_inherits");
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
-var _create_super = require("@swc/helpers/_/_create_super");
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
var Button = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits._(Button, _React_Component);
- var _super = _create_super._(Button);
function Button() {
_class_call_check._(this, Button);
- return _super.apply(this, arguments);
+ return _call_super._(this, Button, arguments);
}
var _proto = Button.prototype;
_proto.render = function render() {
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.2.minified.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.2.minified.js
index a56273aeea5..70230120319 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1.2.minified.js
@@ -9,13 +9,11 @@ Object.defineProperty(exports, "__esModule", {
return App;
}
});
-var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard"), _create_super = require("@swc/helpers/_/_create_super"), _react = /*#__PURE__*/ _interop_require_wildcard._(require("react")), _button = require("./button"), App = /*#__PURE__*/ function(_React_Component) {
- _inherits._(App, _React_Component);
- var _super = _create_super._(App);
+var _call_super = require("@swc/helpers/_/_call_super"), _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _react = /*#__PURE__*/ require("@swc/helpers/_/_interop_require_wildcard")._(require("react")), _button = require("./button"), App = /*#__PURE__*/ function(_React_Component) {
function App() {
- return _class_call_check._(this, App), _super.apply(this, arguments);
+ return _class_call_check._(this, App), _call_super._(this, App, arguments);
}
- return App.prototype.render = function() {
+ return _inherits._(App, _React_Component), App.prototype.render = function() {
return /*#__PURE__*/ _react.createElement(_button.Button, null);
}, App;
}(_react.Component);
@@ -28,13 +26,11 @@ Object.defineProperty(exports, "__esModule", {
return Button;
}
});
-var _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard"), _create_super = require("@swc/helpers/_/_create_super"), _react = /*#__PURE__*/ _interop_require_wildcard._(require("react")), Button = /*#__PURE__*/ function(_React_Component) {
- _inherits._(Button, _React_Component);
- var _super = _create_super._(Button);
+var _call_super = require("@swc/helpers/_/_call_super"), _class_call_check = require("@swc/helpers/_/_class_call_check"), _inherits = require("@swc/helpers/_/_inherits"), _react = /*#__PURE__*/ require("@swc/helpers/_/_interop_require_wildcard")._(require("react")), Button = /*#__PURE__*/ function(_React_Component) {
function Button() {
- return _class_call_check._(this, Button), _super.apply(this, arguments);
+ return _class_call_check._(this, Button), _call_super._(this, Button, arguments);
}
- return Button.prototype.render = function() {
+ return _inherits._(Button, _React_Component), Button.prototype.render = function() {
return /*#__PURE__*/ _react.createElement("button", null, "Some button");
}, Button;
}(_react.Component);
diff --git a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.1.normal.js b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.1.normal.js
index c060dac7443..4f63f92fb2f 100644
--- a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.1.normal.js
@@ -1,14 +1,13 @@
//// [tsxLibraryManagedAttributes.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Component = /*#__PURE__*/ function(ReactComponent1) {
"use strict";
_inherits(Component, ReactComponent1);
- var _super = _create_super(Component);
function Component() {
_class_call_check(this, Component);
- return _super.apply(this, arguments);
+ return _call_super(this, Component, arguments);
}
return Component;
}(ReactComponent);
@@ -50,10 +49,9 @@ var f = /*#__PURE__*/ React.createElement(Component, {
var JustPropTypes = /*#__PURE__*/ function(ReactComponent1) {
"use strict";
_inherits(JustPropTypes, ReactComponent1);
- var _super = _create_super(JustPropTypes);
function JustPropTypes() {
_class_call_check(this, JustPropTypes);
- return _super.apply(this, arguments);
+ return _call_super(this, JustPropTypes, arguments);
}
return JustPropTypes;
}(ReactComponent);
@@ -79,10 +77,9 @@ var j = /*#__PURE__*/ React.createElement(JustPropTypes, {
var JustDefaultProps = /*#__PURE__*/ function(ReactComponent1) {
"use strict";
_inherits(JustDefaultProps, ReactComponent1);
- var _super = _create_super(JustDefaultProps);
function JustDefaultProps() {
_class_call_check(this, JustDefaultProps);
- return _super.apply(this, arguments);
+ return _call_super(this, JustDefaultProps, arguments);
}
return JustDefaultProps;
}(ReactComponent);
@@ -102,10 +99,9 @@ var m = /*#__PURE__*/ React.createElement(JustDefaultProps, {
var BothWithSpecifiedGeneric = /*#__PURE__*/ function(ReactComponent1) {
"use strict";
_inherits(BothWithSpecifiedGeneric, ReactComponent1);
- var _super = _create_super(BothWithSpecifiedGeneric);
function BothWithSpecifiedGeneric() {
_class_call_check(this, BothWithSpecifiedGeneric);
- return _super.apply(this, arguments);
+ return _call_super(this, BothWithSpecifiedGeneric, arguments);
}
return BothWithSpecifiedGeneric;
}(ReactComponent);
@@ -147,10 +143,9 @@ var s = /*#__PURE__*/ React.createElement(BothWithSpecifiedGeneric, {
var JustPropTypesWithSpecifiedGeneric = /*#__PURE__*/ function(ReactComponent1) {
"use strict";
_inherits(JustPropTypesWithSpecifiedGeneric, ReactComponent1);
- var _super = _create_super(JustPropTypesWithSpecifiedGeneric);
function JustPropTypesWithSpecifiedGeneric() {
_class_call_check(this, JustPropTypesWithSpecifiedGeneric);
- return _super.apply(this, arguments);
+ return _call_super(this, JustPropTypesWithSpecifiedGeneric, arguments);
}
return JustPropTypesWithSpecifiedGeneric;
}(ReactComponent);
@@ -176,10 +171,9 @@ var w = /*#__PURE__*/ React.createElement(JustPropTypesWithSpecifiedGeneric, {
var JustDefaultPropsWithSpecifiedGeneric = /*#__PURE__*/ function(ReactComponent1) {
"use strict";
_inherits(JustDefaultPropsWithSpecifiedGeneric, ReactComponent1);
- var _super = _create_super(JustDefaultPropsWithSpecifiedGeneric);
function JustDefaultPropsWithSpecifiedGeneric() {
_class_call_check(this, JustDefaultPropsWithSpecifiedGeneric);
- return _super.apply(this, arguments);
+ return _call_super(this, JustDefaultPropsWithSpecifiedGeneric, arguments);
}
return JustDefaultPropsWithSpecifiedGeneric;
}(ReactComponent);
diff --git a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.2.minified.js b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.2.minified.js
index cb56d45ffde..596a59056f3 100644
--- a/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxLibraryManagedAttributes.2.minified.js
@@ -1,14 +1,12 @@
//// [tsxLibraryManagedAttributes.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Component = /*#__PURE__*/ function(ReactComponent1) {
- _inherits(Component, ReactComponent1);
- var _super = _create_super(Component);
function Component() {
- return _class_call_check(this, Component), _super.apply(this, arguments);
+ return _class_call_check(this, Component), _call_super(this, Component, arguments);
}
- return Component;
+ return _inherits(Component, ReactComponent1), Component;
}(ReactComponent);
Component.propTypes = {
foo: PropTypes.number,
@@ -17,32 +15,26 @@ Component.propTypes = {
}, Component.defaultProps = {
foo: 42
}, /*#__PURE__*/ function(ReactComponent1) {
- _inherits(JustPropTypes, ReactComponent1);
- var _super = _create_super(JustPropTypes);
function JustPropTypes() {
- return _class_call_check(this, JustPropTypes), _super.apply(this, arguments);
+ return _class_call_check(this, JustPropTypes), _call_super(this, JustPropTypes, arguments);
}
- return JustPropTypes;
+ return _inherits(JustPropTypes, ReactComponent1), JustPropTypes;
}(ReactComponent).propTypes = {
foo: PropTypes.number,
bar: PropTypes.node.isRequired
}, /*#__PURE__*/ function(ReactComponent1) {
- _inherits(JustDefaultProps, ReactComponent1);
- var _super = _create_super(JustDefaultProps);
function JustDefaultProps() {
- return _class_call_check(this, JustDefaultProps), _super.apply(this, arguments);
+ return _class_call_check(this, JustDefaultProps), _call_super(this, JustDefaultProps, arguments);
}
- return JustDefaultProps;
+ return _inherits(JustDefaultProps, ReactComponent1), JustDefaultProps;
}(ReactComponent).defaultProps = {
foo: 42
};
var BothWithSpecifiedGeneric = /*#__PURE__*/ function(ReactComponent1) {
- _inherits(BothWithSpecifiedGeneric, ReactComponent1);
- var _super = _create_super(BothWithSpecifiedGeneric);
function BothWithSpecifiedGeneric() {
- return _class_call_check(this, BothWithSpecifiedGeneric), _super.apply(this, arguments);
+ return _class_call_check(this, BothWithSpecifiedGeneric), _call_super(this, BothWithSpecifiedGeneric, arguments);
}
- return BothWithSpecifiedGeneric;
+ return _inherits(BothWithSpecifiedGeneric, ReactComponent1), BothWithSpecifiedGeneric;
}(ReactComponent);
BothWithSpecifiedGeneric.propTypes = {
foo: PropTypes.string,
@@ -51,22 +43,18 @@ BothWithSpecifiedGeneric.propTypes = {
}, BothWithSpecifiedGeneric.defaultProps = {
foo: "yo"
}, /*#__PURE__*/ function(ReactComponent1) {
- _inherits(JustPropTypesWithSpecifiedGeneric, ReactComponent1);
- var _super = _create_super(JustPropTypesWithSpecifiedGeneric);
function JustPropTypesWithSpecifiedGeneric() {
- return _class_call_check(this, JustPropTypesWithSpecifiedGeneric), _super.apply(this, arguments);
+ return _class_call_check(this, JustPropTypesWithSpecifiedGeneric), _call_super(this, JustPropTypesWithSpecifiedGeneric, arguments);
}
- return JustPropTypesWithSpecifiedGeneric;
+ return _inherits(JustPropTypesWithSpecifiedGeneric, ReactComponent1), JustPropTypesWithSpecifiedGeneric;
}(ReactComponent).propTypes = {
foo: PropTypes.string,
bar: PropTypes.node.isRequired
}, /*#__PURE__*/ function(ReactComponent1) {
- _inherits(JustDefaultPropsWithSpecifiedGeneric, ReactComponent1);
- var _super = _create_super(JustDefaultPropsWithSpecifiedGeneric);
function JustDefaultPropsWithSpecifiedGeneric() {
- return _class_call_check(this, JustDefaultPropsWithSpecifiedGeneric), _super.apply(this, arguments);
+ return _class_call_check(this, JustDefaultPropsWithSpecifiedGeneric), _call_super(this, JustDefaultPropsWithSpecifiedGeneric, arguments);
}
- return JustDefaultPropsWithSpecifiedGeneric;
+ return _inherits(JustDefaultPropsWithSpecifiedGeneric, ReactComponent1), JustDefaultPropsWithSpecifiedGeneric;
}(ReactComponent).defaultProps = {
foo: "no"
};
diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.1.normal.js
index 2c83430b4a7..e59d6e4a667 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.1.normal.js
@@ -1,14 +1,13 @@
//// [file.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var Empty = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(Empty, _React_Component);
- var _super = _create_super(Empty);
function Empty() {
_class_call_check(this, Empty);
- return _super.apply(this, arguments);
+ return _call_super(this, Empty, arguments);
}
var _proto = Empty.prototype;
_proto.render = function render() {
diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js
index c49ae5d65a1..3eecce01775 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js
@@ -1,14 +1,12 @@
//// [file.tsx]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
export var Empty = /*#__PURE__*/ function(_React_Component) {
- _inherits(Empty, _React_Component);
- var _super = _create_super(Empty);
function Empty() {
- return _class_call_check(this, Empty), _super.apply(this, arguments);
+ return _class_call_check(this, Empty), _call_super(this, Empty, arguments);
}
- return Empty.prototype.render = function() {
+ return _inherits(Empty, _React_Component), Empty.prototype.render = function() {
return /*#__PURE__*/ React.createElement("div", null, "Hello");
}, Empty;
}(React.Component);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js
index 17b7a27a135..3fdcc6276cd 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _this = this;
var B = /*#__PURE__*/ function() {
"use strict";
@@ -16,10 +16,9 @@ var B = /*#__PURE__*/ function() {
var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(B);
@@ -28,10 +27,9 @@ C.prototype.foo = function() {};
var D = /*#__PURE__*/ function(B) {
"use strict";
_inherits(D, B);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(B);
@@ -48,10 +46,9 @@ Module.prototype.size = null;
var NormalModule = /*#__PURE__*/ function(Module) {
"use strict";
_inherits(NormalModule, Module);
- var _super = _create_super(NormalModule);
function NormalModule() {
_class_call_check(this, NormalModule);
- return _super.apply(this, arguments);
+ return _call_super(this, NormalModule, arguments);
}
var _proto = NormalModule.prototype;
_proto.identifier = function identifier() {
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js
index 673b5114e7b..8b2c0e80c3a 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js
@@ -1,7 +1,7 @@
//// [a.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var _this = this, B = /*#__PURE__*/ function() {
function B() {
_class_call_check(this, B), this.n = 1;
@@ -9,19 +9,15 @@ var _this = this, B = /*#__PURE__*/ function() {
return B.prototype.foo = function() {}, B;
}();
/*#__PURE__*/ (function(B) {
- _inherits(C, B);
- var _super = _create_super(C);
function C() {
- return _class_call_check(this, C), _super.apply(this, arguments);
+ return _class_call_check(this, C), _call_super(this, C, arguments);
}
- return C;
+ return _inherits(C, B), C;
})(B).prototype.foo = function() {}, /*#__PURE__*/ function(B) {
- _inherits(D, B);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, B), D;
}(B).prototype.foo = function() {
_this.n = 'not checked, so no error';
};
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.1.normal.js
index fe7e5370925..72fa031fc2c 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.1.normal.js
@@ -1,7 +1,7 @@
//// [bug24703.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Common = {};
Common.I = function _class() {
"use strict";
@@ -11,11 +11,10 @@ Common.I = function _class() {
Common.O = /*#__PURE__*/ function(_Common_I) {
"use strict";
_inherits(_class, _Common_I);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, _class);
_this.o = 2;
return _this;
}
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.2.minified.js
index 4a4566da192..cb4cf1a1e23 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment25.2.minified.js
@@ -1,18 +1,16 @@
//// [bug24703.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Common = {};
Common.I = function _class() {
_class_call_check(this, _class), this.i = 1;
}, Common.O = /*#__PURE__*/ function(_Common_I) {
- _inherits(_class, _Common_I);
- var _super = _create_super(_class);
function _class() {
var _this;
- return _class_call_check(this, _class), (_this = _super.call(this)).o = 2, _this;
+ return _class_call_check(this, _class), (_this = _call_super(this, _class)).o = 2, _this;
}
- return _class;
+ return _inherits(_class, _Common_I), _class;
}(Common.I);
var o = new Common.O(), i = new Common.I();
o.i, o.o, i.i;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.1.normal.js
index 963602f58a1..b367e9b7202 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.1.normal.js
@@ -1,7 +1,7 @@
//// [bug24730.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var UI = {};
UI.TreeElement = function _class() {
"use strict";
@@ -12,10 +12,9 @@ UI.context = new UI.TreeElement();
var C = /*#__PURE__*/ function(_UI_TreeElement) {
"use strict";
_inherits(C, _UI_TreeElement);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
var _proto = C.prototype;
_proto.onpopulate = function onpopulate() {
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.2.minified.js
index f73a957dfce..61920e66c4c 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment26.2.minified.js
@@ -1,7 +1,7 @@
//// [bug24730.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var UI = {};
UI.TreeElement = function _class() {
_class_call_check(this, _class), this.treeOutline = 12;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.1.normal.js
index ad875051f7d..a212472897a 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.1.normal.js
@@ -1,7 +1,7 @@
//// [index.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
First.Item = function I() {
"use strict";
_class_call_check(this, I);
@@ -9,20 +9,18 @@ First.Item = function I() {
Common.Object = /*#__PURE__*/ function(_First_Item) {
"use strict";
_inherits(_class, _First_Item);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(First.Item);
Workspace.Object = /*#__PURE__*/ function(_Common_Object) {
"use strict";
_inherits(_class, _Common_Object);
- var _super = _create_super(_class);
function _class() {
_class_call_check(this, _class);
- return _super.apply(this, arguments);
+ return _call_super(this, _class, arguments);
}
return _class;
}(Common.Object);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.2.minified.js
index 1a4a65b6d8d..25a6f51ac1f 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder.2.minified.js
@@ -1,22 +1,18 @@
//// [index.js]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
First.Item = function I() {
_class_call_check(this, I);
}, Common.Object = /*#__PURE__*/ function(_First_Item) {
- _inherits(_class, _First_Item);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, _First_Item), _class;
}(First.Item), Workspace.Object = /*#__PURE__*/ function(_Common_Object) {
- _inherits(_class, _Common_Object);
- var _super = _create_super(_class);
function _class() {
- return _class_call_check(this, _class), _super.apply(this, arguments);
+ return _class_call_check(this, _class), _call_super(this, _class, arguments);
}
- return _class;
+ return _inherits(_class, _Common_Object), _class;
}(Common.Object);
//// [roots.js]
diff --git a/crates/swc/tests/tsc-references/typeGuardFunction.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunction.1.normal.js
index 6dff80ef93f..9d3218fb74a 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunction.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunction.1.normal.js
@@ -1,7 +1,7 @@
//// [typeGuardFunction.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -13,10 +13,9 @@ var B = function B() {
var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C, A);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/typeGuardFunction.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunction.2.minified.js
index 47aaae6d596..b59e176af5d 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunction.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunction.2.minified.js
@@ -1,8 +1,8 @@
//// [typeGuardFunction.ts]
var a, subType, union, union2;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
isC(a) && a.propC, isA(subType) && subType.propC, isA(union) && union.propA, isC_multipleParams(a, 0) && a.propC, f2(function(p1) {
return !0;
}), acceptingBoolean(isA(a)), acceptingTypeGuardFunction(isA), isA(union2);
diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.1.normal.js
index 1da8ff1d7a4..fa985296ef3 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.1.normal.js
@@ -1,7 +1,7 @@
//// [typeGuardFunctionGenerics.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var A = function A() {
"use strict";
_class_call_check(this, A);
@@ -13,10 +13,9 @@ var B = function B() {
var C = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C, A);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(A);
diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.2.minified.js
index 9dee561b7d6..4e4dcb79169 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunctionGenerics.2.minified.js
@@ -1,6 +1,6 @@
//// [typeGuardFunctionGenerics.ts]
var a;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
funA(isB), funB(retC, a) && a.propC, funC(isB), funD(isC, a) && a.propC, funE(isB, 1);
diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.1.normal.js
index fa6a8cb52fa..017c3e01071 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.1.normal.js
@@ -1,8 +1,8 @@
//// [typeGuardFunctionOfFormThis.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var RoyalGuard = /*#__PURE__*/ function() {
"use strict";
function RoyalGuard() {
@@ -20,10 +20,9 @@ var RoyalGuard = /*#__PURE__*/ function() {
var LeadGuard = /*#__PURE__*/ function(RoyalGuard) {
"use strict";
_inherits(LeadGuard, RoyalGuard);
- var _super = _create_super(LeadGuard);
function LeadGuard() {
_class_call_check(this, LeadGuard);
- return _super.apply(this, arguments);
+ return _call_super(this, LeadGuard, arguments);
}
var _proto = LeadGuard.prototype;
_proto.lead = function lead() {};
@@ -32,10 +31,9 @@ var LeadGuard = /*#__PURE__*/ function(RoyalGuard) {
var FollowerGuard = /*#__PURE__*/ function(RoyalGuard) {
"use strict";
_inherits(FollowerGuard, RoyalGuard);
- var _super = _create_super(FollowerGuard);
function FollowerGuard() {
_class_call_check(this, FollowerGuard);
- return _super.apply(this, arguments);
+ return _call_super(this, FollowerGuard, arguments);
}
var _proto = FollowerGuard.prototype;
_proto.follow = function follow() {};
@@ -87,10 +85,9 @@ var ArrowGuard = function ArrowGuard() {
var ArrowElite = /*#__PURE__*/ function(ArrowGuard) {
"use strict";
_inherits(ArrowElite, ArrowGuard);
- var _super = _create_super(ArrowElite);
function ArrowElite() {
_class_call_check(this, ArrowElite);
- return _super.apply(this, arguments);
+ return _call_super(this, ArrowElite, arguments);
}
var _proto = ArrowElite.prototype;
_proto.defend = function defend() {};
@@ -99,10 +96,9 @@ var ArrowElite = /*#__PURE__*/ function(ArrowGuard) {
var ArrowMedic = /*#__PURE__*/ function(ArrowGuard) {
"use strict";
_inherits(ArrowMedic, ArrowGuard);
- var _super = _create_super(ArrowMedic);
function ArrowMedic() {
_class_call_check(this, ArrowMedic);
- return _super.apply(this, arguments);
+ return _call_super(this, ArrowMedic, arguments);
}
var _proto = ArrowMedic.prototype;
_proto.heal = function heal() {};
@@ -140,10 +136,9 @@ var MimicGuard = /*#__PURE__*/ function() {
var MimicLeader = /*#__PURE__*/ function(MimicGuard) {
"use strict";
_inherits(MimicLeader, MimicGuard);
- var _super = _create_super(MimicLeader);
function MimicLeader() {
_class_call_check(this, MimicLeader);
- return _super.apply(this, arguments);
+ return _call_super(this, MimicLeader, arguments);
}
var _proto = MimicLeader.prototype;
_proto.lead = function lead() {};
@@ -152,10 +147,9 @@ var MimicLeader = /*#__PURE__*/ function(MimicGuard) {
var MimicFollower = /*#__PURE__*/ function(MimicGuard) {
"use strict";
_inherits(MimicFollower, MimicGuard);
- var _super = _create_super(MimicFollower);
function MimicFollower() {
_class_call_check(this, MimicFollower);
- return _super.apply(this, arguments);
+ return _call_super(this, MimicFollower, arguments);
}
var _proto = MimicFollower.prototype;
_proto.follow = function follow() {};
diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.2.minified.js
index b375a09edc4..3077c1f5feb 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThis.2.minified.js
@@ -1,8 +1,8 @@
//// [typeGuardFunctionOfFormThis.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var b, crate, RoyalGuard = /*#__PURE__*/ function() {
function RoyalGuard() {
_class_call_check(this, RoyalGuard);
@@ -14,19 +14,15 @@ var b, crate, RoyalGuard = /*#__PURE__*/ function() {
return _instanceof(this, FollowerGuard);
}, RoyalGuard;
}(), LeadGuard = /*#__PURE__*/ function(RoyalGuard) {
- _inherits(LeadGuard, RoyalGuard);
- var _super = _create_super(LeadGuard);
function LeadGuard() {
- return _class_call_check(this, LeadGuard), _super.apply(this, arguments);
+ return _class_call_check(this, LeadGuard), _call_super(this, LeadGuard, arguments);
}
- return LeadGuard.prototype.lead = function() {}, LeadGuard;
+ return _inherits(LeadGuard, RoyalGuard), LeadGuard.prototype.lead = function() {}, LeadGuard;
}(RoyalGuard), FollowerGuard = /*#__PURE__*/ function(RoyalGuard) {
- _inherits(FollowerGuard, RoyalGuard);
- var _super = _create_super(FollowerGuard);
function FollowerGuard() {
- return _class_call_check(this, FollowerGuard), _super.apply(this, arguments);
+ return _class_call_check(this, FollowerGuard), _call_super(this, FollowerGuard, arguments);
}
- return FollowerGuard.prototype.follow = function() {}, FollowerGuard;
+ return _inherits(FollowerGuard, RoyalGuard), FollowerGuard.prototype.follow = function() {}, FollowerGuard;
}(RoyalGuard), a = new FollowerGuard();
a.isLeader() ? a.lead() : a.isFollower() && a.follow(), b.isLeader() ? b.lead() : b.isFollower() && b.follow(), a.isLeader();
var ArrowGuard = function ArrowGuard() {
@@ -37,19 +33,15 @@ var ArrowGuard = function ArrowGuard() {
return _instanceof(_this, ArrowMedic);
};
}, ArrowElite = /*#__PURE__*/ function(ArrowGuard) {
- _inherits(ArrowElite, ArrowGuard);
- var _super = _create_super(ArrowElite);
function ArrowElite() {
- return _class_call_check(this, ArrowElite), _super.apply(this, arguments);
+ return _class_call_check(this, ArrowElite), _call_super(this, ArrowElite, arguments);
}
- return ArrowElite.prototype.defend = function() {}, ArrowElite;
+ return _inherits(ArrowElite, ArrowGuard), ArrowElite.prototype.defend = function() {}, ArrowElite;
}(ArrowGuard), ArrowMedic = /*#__PURE__*/ function(ArrowGuard) {
- _inherits(ArrowMedic, ArrowGuard);
- var _super = _create_super(ArrowMedic);
function ArrowMedic() {
- return _class_call_check(this, ArrowMedic), _super.apply(this, arguments);
+ return _class_call_check(this, ArrowMedic), _call_super(this, ArrowMedic, arguments);
}
- return ArrowMedic.prototype.heal = function() {}, ArrowMedic;
+ return _inherits(ArrowMedic, ArrowGuard), ArrowMedic.prototype.heal = function() {}, ArrowMedic;
}(ArrowGuard), guard = new ArrowGuard();
guard.isElite() ? guard.defend() : guard.isMedic() && guard.heal(), crate.isSundries() ? crate.contents.broken = !0 : crate.isSupplies() && (crate.contents.spoiled = !0), a.isFollower = b.isFollower, a.isLeader = b.isLeader;
var MimicGuard = /*#__PURE__*/ function() {
@@ -63,18 +55,14 @@ var MimicGuard = /*#__PURE__*/ function() {
return _instanceof(this, MimicFollower);
}, MimicGuard;
}(), MimicLeader = /*#__PURE__*/ function(MimicGuard) {
- _inherits(MimicLeader, MimicGuard);
- var _super = _create_super(MimicLeader);
function MimicLeader() {
- return _class_call_check(this, MimicLeader), _super.apply(this, arguments);
+ return _class_call_check(this, MimicLeader), _call_super(this, MimicLeader, arguments);
}
- return MimicLeader.prototype.lead = function() {}, MimicLeader;
+ return _inherits(MimicLeader, MimicGuard), MimicLeader.prototype.lead = function() {}, MimicLeader;
}(MimicGuard), MimicFollower = /*#__PURE__*/ function(MimicGuard) {
- _inherits(MimicFollower, MimicGuard);
- var _super = _create_super(MimicFollower);
function MimicFollower() {
- return _class_call_check(this, MimicFollower), _super.apply(this, arguments);
+ return _class_call_check(this, MimicFollower), _call_super(this, MimicFollower, arguments);
}
- return MimicFollower.prototype.follow = function() {}, MimicFollower;
+ return _inherits(MimicFollower, MimicGuard), MimicFollower.prototype.follow = function() {}, MimicFollower;
}(MimicGuard), mimic = new MimicGuard();
a.isLeader = mimic.isLeader, a.isFollower = mimic.isFollower, mimic.isFollower() && (mimic.follow(), mimic.isFollower = a.isFollower);
diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.1.normal.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.1.normal.js
index 2b9a9be4e30..f0a01121df7 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.1.normal.js
@@ -1,8 +1,8 @@
//// [typeGuardFunctionOfFormThisErrors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var RoyalGuard = /*#__PURE__*/ function() {
"use strict";
function RoyalGuard() {
@@ -20,10 +20,9 @@ var RoyalGuard = /*#__PURE__*/ function() {
var LeadGuard = /*#__PURE__*/ function(RoyalGuard) {
"use strict";
_inherits(LeadGuard, RoyalGuard);
- var _super = _create_super(LeadGuard);
function LeadGuard() {
_class_call_check(this, LeadGuard);
- return _super.apply(this, arguments);
+ return _call_super(this, LeadGuard, arguments);
}
var _proto = LeadGuard.prototype;
_proto.lead = function lead() {};
@@ -32,10 +31,9 @@ var LeadGuard = /*#__PURE__*/ function(RoyalGuard) {
var FollowerGuard = /*#__PURE__*/ function(RoyalGuard) {
"use strict";
_inherits(FollowerGuard, RoyalGuard);
- var _super = _create_super(FollowerGuard);
function FollowerGuard() {
_class_call_check(this, FollowerGuard);
- return _super.apply(this, arguments);
+ return _call_super(this, FollowerGuard, arguments);
}
var _proto = FollowerGuard.prototype;
_proto.follow = function follow() {};
diff --git a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.2.minified.js b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.2.minified.js
index 466104c8b52..e2d30616ea4 100644
--- a/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeGuardFunctionOfFormThisErrors.2.minified.js
@@ -1,8 +1,8 @@
//// [typeGuardFunctionOfFormThisErrors.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var c, RoyalGuard = /*#__PURE__*/ function() {
function RoyalGuard() {
_class_call_check(this, RoyalGuard);
@@ -14,19 +14,15 @@ var c, RoyalGuard = /*#__PURE__*/ function() {
return _instanceof(this, FollowerGuard);
}, RoyalGuard;
}(), LeadGuard = /*#__PURE__*/ function(RoyalGuard) {
- _inherits(LeadGuard, RoyalGuard);
- var _super = _create_super(LeadGuard);
function LeadGuard() {
- return _class_call_check(this, LeadGuard), _super.apply(this, arguments);
+ return _class_call_check(this, LeadGuard), _call_super(this, LeadGuard, arguments);
}
- return LeadGuard.prototype.lead = function() {}, LeadGuard;
+ return _inherits(LeadGuard, RoyalGuard), LeadGuard.prototype.lead = function() {}, LeadGuard;
}(RoyalGuard), FollowerGuard = /*#__PURE__*/ function(RoyalGuard) {
- _inherits(FollowerGuard, RoyalGuard);
- var _super = _create_super(FollowerGuard);
function FollowerGuard() {
- return _class_call_check(this, FollowerGuard), _super.apply(this, arguments);
+ return _class_call_check(this, FollowerGuard), _call_super(this, FollowerGuard, arguments);
}
- return FollowerGuard.prototype.follow = function() {}, FollowerGuard;
+ return _inherits(FollowerGuard, RoyalGuard), FollowerGuard.prototype.follow = function() {}, FollowerGuard;
}(RoyalGuard), a = new FollowerGuard(), b = new LeadGuard();
b.isFollower = b.isLeader, b.isLeader = b.isFollower, a.isFollower = a.isLeader, a.isLeader = a.isFollower, ({
invalidGuard: function(c) {
diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.1.normal.js
index 74dec375abc..4079dd33bb1 100644
--- a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.1.normal.js
@@ -4,10 +4,10 @@
// - when true, narrows the type of x to the type of the 'prototype' property in C provided
// it is a subtype of the type of x, or
// - when false, has no effect on the type of x.
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = function C1() {
"use strict";
_class_call_check(this, C1);
@@ -19,10 +19,9 @@ var C2 = function C2() {
var D1 = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(D1, C1);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(C1);
diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.2.minified.js b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.2.minified.js
index aa37e563b28..7a88014bae4 100644
--- a/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeGuardOfFormInstanceOf.2.minified.js
@@ -1,18 +1,16 @@
//// [typeGuardOfFormInstanceOf.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var ctor1, ctor2, ctor3, ctor4, ctor5, ctor6, C1 = function C1() {
_class_call_check(this, C1);
}, C2 = function C2() {
_class_call_check(this, C2);
}, D1 = /*#__PURE__*/ function(C1) {
- _inherits(D1, C1);
- var _super = _create_super(D1);
function D1() {
- return _class_call_check(this, D1), _super.apply(this, arguments);
+ return _class_call_check(this, D1), _call_super(this, D1, arguments);
}
- return D1;
+ return _inherits(D1, C1), D1;
}(C1);
_instanceof(ctor1, C1) && ctor1.p1, _instanceof(ctor1, C2) && ctor1.p2, _instanceof(ctor1, D1) && ctor1.p1, _instanceof(ctor1, D1) && ctor1.p3, _instanceof(ctor2, C2) && ctor2.p2, _instanceof(ctor2, D1) && ctor2.p3, _instanceof(ctor2, D1) && ctor2.p1, _instanceof(ctor2, C1), _instanceof(ctor3, C1) ? ctor3.p1 : ctor3.p2, _instanceof(ctor4, C1) ? ctor4.p1 : _instanceof(ctor4, C2) ? ctor4.p2 : ctor4.p4, _instanceof(ctor5, C1) ? ctor5.p1 : ctor5.p2, _instanceof(ctor6, C1) || _instanceof(ctor6, C2) || ctor6.p4;
diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormIsType.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormIsType.1.normal.js
index afcf54bedb1..c6f7e61dc01 100644
--- a/crates/swc/tests/tsc-references/typeGuardOfFormIsType.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeGuardOfFormIsType.1.normal.js
@@ -1,7 +1,7 @@
//// [typeGuardOfFormIsType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C1 = function C1() {
"use strict";
_class_call_check(this, C1);
@@ -13,10 +13,9 @@ var C2 = function C2() {
var D1 = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(D1, C1);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(C1);
diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormIsType.2.minified.js b/crates/swc/tests/tsc-references/typeGuardOfFormIsType.2.minified.js
index e0851fccd46..01297338253 100644
--- a/crates/swc/tests/tsc-references/typeGuardOfFormIsType.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeGuardOfFormIsType.2.minified.js
@@ -1,6 +1,6 @@
//// [typeGuardOfFormIsType.ts]
var c1Orc2, c2Ord1;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
c1Orc2.p1, c1Orc2.p2, c1Orc2.p1, c1Orc2.p3, c2Ord1.p2, c2Ord1.p3, c2Ord1.p1;
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).1.normal.js
index 8caab7c6c7e..e0a5510fadb 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).1.normal.js
@@ -1,10 +1,10 @@
//// [typeOfThisInStaticMembers10.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var C = function C() {
"use strict";
@@ -18,10 +18,9 @@ C = _ts_decorate([
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
D.foo = function foo1() {
return this.c + 1;
@@ -60,10 +59,9 @@ CC.b = CC.a + 1;
var DD = /*#__PURE__*/ function(CC) {
"use strict";
_inherits(DD, CC);
- var _super = _create_super(DD);
function DD() {
_class_call_check(this, DD);
- return _super.apply(this, arguments);
+ return _call_super(this, DD, arguments);
}
DD.foo = function foo1() {
return this.c + 1;
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).2.minified.js
index d64eca58680..58585f6e92f 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).2.minified.js
@@ -1,22 +1,20 @@
//// [typeOfThisInStaticMembers10.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var C = function C() {
_class_call_check(this, C);
};
C.a = 1, C.b = C.a + 1;
var D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D.foo = function() {
+ return _inherits(D, C), D.foo = function() {
return this.c + 1;
}, _create_class(D, null, [
{
@@ -44,12 +42,10 @@ var CC = function CC() {
};
CC.a = 1, CC.b = CC.a + 1;
var DD = /*#__PURE__*/ function(CC) {
- _inherits(DD, CC);
- var _super = _create_super(DD);
function DD() {
- return _class_call_check(this, DD), _super.apply(this, arguments);
+ return _class_call_check(this, DD), _call_super(this, DD, arguments);
}
- return DD.foo = function() {
+ return _inherits(DD, CC), DD.foo = function() {
return this.c + 1;
}, _create_class(DD, null, [
{
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).1.normal.js
index 5c86082f7be..6f0756a70d1 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).1.normal.js
@@ -1,11 +1,11 @@
//// [typeOfThisInStaticMembers11.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var C = function C() {
"use strict";
@@ -19,10 +19,9 @@ C = _ts_decorate([
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
_create_class(D, null, [
{
@@ -64,10 +63,9 @@ _define_property(CC, "b", CC.a + 1);
var DD = /*#__PURE__*/ function(CC) {
"use strict";
_inherits(DD, CC);
- var _super = _create_super(DD);
function DD() {
_class_call_check(this, DD);
- return _super.apply(this, arguments);
+ return _call_super(this, DD, arguments);
}
_create_class(DD, null, [
{
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).2.minified.js
index b80b5d302a9..453da39c249 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).2.minified.js
@@ -1,23 +1,21 @@
//// [typeOfThisInStaticMembers11.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
var C = function C() {
_class_call_check(this, C);
};
_define_property(C, "a", 1), _define_property(C, "b", C.a + 1);
var D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return _create_class(D, null, [
+ return _inherits(D, C), _create_class(D, null, [
{
key: "foo",
value: function() {
@@ -49,12 +47,10 @@ var CC = function CC() {
};
_define_property(CC, "a", 1), _define_property(CC, "b", CC.a + 1);
var DD = /*#__PURE__*/ function(CC) {
- _inherits(DD, CC);
- var _super = _create_super(DD);
function DD() {
- return _class_call_check(this, DD), _super.apply(this, arguments);
+ return _class_call_check(this, DD), _call_super(this, DD, arguments);
}
- return _create_class(DD, null, [
+ return _inherits(DD, CC), _create_class(DD, null, [
{
key: "foo",
value: function() {
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).1.normal.js
index d5ad4eb8b44..480d5bcd313 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).1.normal.js
@@ -1,9 +1,9 @@
//// [typeOfThisInStaticMembers3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -13,10 +13,9 @@ C.b = C.a + 1;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).2.minified.js
index 1ea7c85f8f3..68031e251af 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers3(target=es5).2.minified.js
@@ -1,19 +1,17 @@
//// [typeOfThisInStaticMembers3.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
};
C.a = 1, C.b = C.a + 1;
var D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C);
D.c = 2, D.d = D.c + 1, D.e = _get(_get_prototype_of(D), "a", D) + D.c + 1;
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).1.normal.js
index e64b38a3a75..57717f080f2 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).1.normal.js
@@ -1,10 +1,10 @@
//// [typeOfThisInStaticMembers4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -14,10 +14,9 @@ _define_property(C, "b", C.a + 1);
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).2.minified.js
index 79cfc863d36..2f9bb49cb7a 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers4(target=es5).2.minified.js
@@ -1,20 +1,18 @@
//// [typeOfThisInStaticMembers4.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
};
_define_property(C, "a", 1), _define_property(C, "b", C.a + 1);
var D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C);
_define_property(D, "c", 2), _define_property(D, "d", D.c + 1), _define_property(D, "e", _get(_get_prototype_of(D), "a", D) + D.c + 1);
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.1.normal.js
index e4a89c7b494..8c2ce530cb9 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.1.normal.js
@@ -1,7 +1,7 @@
//// [typeOfThisInStaticMembers6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -10,10 +10,9 @@ C.f = 1;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.2.minified.js
index 73d0e211065..10efca1fd68 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers6.2.minified.js
@@ -1,15 +1,13 @@
//// [typeOfThisInStaticMembers6.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
};
C.f = 1, /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C).c = super();
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).1.normal.js
index 50bcc93a1bc..ec3ec259e6c 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).1.normal.js
@@ -1,9 +1,9 @@
//// [typeOfThisInStaticMembers7.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -13,10 +13,9 @@ C.b = C.a + 1;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).2.minified.js
index a53b2472560..0cee6325f8a 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers7(target=es5).2.minified.js
@@ -1,19 +1,17 @@
//// [typeOfThisInStaticMembers7.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
};
C.a = 1, C.b = C.a + 1;
var D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C);
D.c = 2, D.d = D.c + 1, D.e = 1 + _get(_get_prototype_of(D), "a", D) + (D.c + 1) + 1;
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).1.normal.js
index 5f6b77d106d..7bf8284e6ed 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).1.normal.js
@@ -1,9 +1,9 @@
//// [typeOfThisInStaticMembers9.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -12,10 +12,9 @@ C.f = 1;
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
return D;
}(C);
diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).2.minified.js
index 6cd71724019..50c76d53165 100644
--- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers9(target=es5).2.minified.js
@@ -1,20 +1,18 @@
//// [typeOfThisInStaticMembers9.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _get } from "@swc/helpers/_/_get";
import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
_class_call_check(this, C);
};
C.f = 1;
var D = /*#__PURE__*/ function(C) {
- _inherits(D, C);
- var _super = _create_super(D);
function D() {
- return _class_call_check(this, D), _super.apply(this, arguments);
+ return _class_call_check(this, D), _call_super(this, D, arguments);
}
- return D;
+ return _inherits(D, C), D;
}(C);
D.arrowFunctionBoundary = function() {
return _get(_get_prototype_of(D), "f", D) + 1;
diff --git a/crates/swc/tests/tsc-references/typeParameterAsBaseType.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsBaseType.1.normal.js
index ee7e4fdcf48..1db4c5c82a2 100644
--- a/crates/swc/tests/tsc-references/typeParameterAsBaseType.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeParameterAsBaseType.1.normal.js
@@ -1,26 +1,24 @@
//// [typeParameterAsBaseType.ts]
// type parameters cannot be used as base types
// these are all errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function(T1) {
"use strict";
_inherits(C, T1);
- var _super = _create_super(C);
function C() {
_class_call_check(this, C);
- return _super.apply(this, arguments);
+ return _call_super(this, C, arguments);
}
return C;
}(T);
var C2 = /*#__PURE__*/ function(U1) {
"use strict";
_inherits(C2, U1);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
- return _super.apply(this, arguments);
+ return _call_super(this, C2, arguments);
}
return C2;
}(U);
diff --git a/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js
index 977848ea824..c344ef1c881 100644
--- a/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js
@@ -1,5 +1,5 @@
//// [typeParameterAsBaseType.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
/*#__PURE__*/ T, /*#__PURE__*/ U;
diff --git a/crates/swc/tests/tsc-references/typeRelationships.1.normal.js b/crates/swc/tests/tsc-references/typeRelationships.1.normal.js
index ef1b31e0961..f881bbb0fea 100644
--- a/crates/swc/tests/tsc-references/typeRelationships.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeRelationships.1.normal.js
@@ -1,8 +1,7 @@
//// [typeRelationships.ts]
-import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
@@ -40,12 +39,11 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
var _this;
- _this = _super.apply(this, arguments);
- _this.self1 = _assert_this_initialized(_this);
+ _this = _call_super(this, D, arguments);
+ _this.self1 = _this;
_this.self2 = _this.self;
_this.self3 = _this.foo();
_this.d = new D();
diff --git a/crates/swc/tests/tsc-references/typeRelationships.2.minified.js b/crates/swc/tests/tsc-references/typeRelationships.2.minified.js
index 2687742eba2..9683dcf5ddc 100644
--- a/crates/swc/tests/tsc-references/typeRelationships.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeRelationships.2.minified.js
@@ -1,5 +1,4 @@
//// [typeRelationships.ts]
-import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/typeofClass2.1.normal.js b/crates/swc/tests/tsc-references/typeofClass2.1.normal.js
index b98f4bca70f..98ae8d33ca1 100644
--- a/crates/swc/tests/tsc-references/typeofClass2.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeofClass2.1.normal.js
@@ -1,7 +1,7 @@
//// [typeofClass2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = /*#__PURE__*/ function() {
"use strict";
function C(x) {
@@ -14,10 +14,9 @@ var C = /*#__PURE__*/ function() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo() {};
diff --git a/crates/swc/tests/tsc-references/typeofClass2.2.minified.js b/crates/swc/tests/tsc-references/typeofClass2.2.minified.js
index d51beacfdcb..d672ef45700 100644
--- a/crates/swc/tests/tsc-references/typeofClass2.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeofClass2.2.minified.js
@@ -1,4 +1,4 @@
//// [typeofClass2.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js
index 97a35ac7d5b..33d39cefbca 100644
--- a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js
+++ b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js
@@ -1,8 +1,8 @@
//// [typesWithSpecializedCallSignatures.ts]
// basic uses of specialized signatures without errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,20 +10,18 @@ var Base = function Base() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
return Derived1;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js
index eb6bccf788e..97401448b4c 100644
--- a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js
+++ b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js
@@ -1,7 +1,7 @@
//// [typesWithSpecializedCallSignatures.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var i, a, c = new /*#__PURE__*/ (function() {
function C() {
_class_call_check(this, C);
diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js
index 50497a45c6c..72cde8843d1 100644
--- a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js
+++ b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js
@@ -1,8 +1,8 @@
//// [typesWithSpecializedConstructSignatures.ts]
// basic uses of specialized signatures without errors
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,20 +10,18 @@ var Base = function Base() {
var Derived1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived1, Base);
- var _super = _create_super(Derived1);
function Derived1() {
_class_call_check(this, Derived1);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived1, arguments);
}
return Derived1;
}(Base);
var Derived2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Derived2, Base);
- var _super = _create_super(Derived2);
function Derived2() {
_class_call_check(this, Derived2);
- return _super.apply(this, arguments);
+ return _call_super(this, Derived2, arguments);
}
return Derived2;
}(Base);
diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js
index 62597ccf64f..7a8e7a87868 100644
--- a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js
+++ b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js
@@ -1,7 +1,7 @@
//// [typesWithSpecializedConstructSignatures.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var i, a, C = function C(x) {
return _class_call_check(this, C), x;
};
diff --git a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.1.normal.js b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.1.normal.js
index 3722814c958..2e7380593e4 100644
--- a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.1.normal.js
+++ b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.1.normal.js
@@ -1,8 +1,8 @@
//// [undefinedIsSubtypeOfEverything.ts]
// undefined is a subtype of every other types, no errors expected below
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
@@ -10,150 +10,135 @@ var Base = function Base() {
var D0 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D0, Base);
- var _super = _create_super(D0);
function D0() {
_class_call_check(this, D0);
- return _super.apply(this, arguments);
+ return _call_super(this, D0, arguments);
}
return D0;
}(Base);
var DA = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(DA, Base);
- var _super = _create_super(DA);
function DA() {
_class_call_check(this, DA);
- return _super.apply(this, arguments);
+ return _call_super(this, DA, arguments);
}
return DA;
}(Base);
var D1 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D1, Base);
- var _super = _create_super(D1);
function D1() {
_class_call_check(this, D1);
- return _super.apply(this, arguments);
+ return _call_super(this, D1, arguments);
}
return D1;
}(Base);
var D1A = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D1A, Base);
- var _super = _create_super(D1A);
function D1A() {
_class_call_check(this, D1A);
- return _super.apply(this, arguments);
+ return _call_super(this, D1A, arguments);
}
return D1A;
}(Base);
var D2 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D2, Base);
- var _super = _create_super(D2);
function D2() {
_class_call_check(this, D2);
- return _super.apply(this, arguments);
+ return _call_super(this, D2, arguments);
}
return D2;
}(Base);
var D2A = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D2A, Base);
- var _super = _create_super(D2A);
function D2A() {
_class_call_check(this, D2A);
- return _super.apply(this, arguments);
+ return _call_super(this, D2A, arguments);
}
return D2A;
}(Base);
var D3 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D3, Base);
- var _super = _create_super(D3);
function D3() {
_class_call_check(this, D3);
- return _super.apply(this, arguments);
+ return _call_super(this, D3, arguments);
}
return D3;
}(Base);
var D3A = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D3A, Base);
- var _super = _create_super(D3A);
function D3A() {
_class_call_check(this, D3A);
- return _super.apply(this, arguments);
+ return _call_super(this, D3A, arguments);
}
return D3A;
}(Base);
var D4 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D4, Base);
- var _super = _create_super(D4);
function D4() {
_class_call_check(this, D4);
- return _super.apply(this, arguments);
+ return _call_super(this, D4, arguments);
}
return D4;
}(Base);
var D5 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D5, Base);
- var _super = _create_super(D5);
function D5() {
_class_call_check(this, D5);
- return _super.apply(this, arguments);
+ return _call_super(this, D5, arguments);
}
return D5;
}(Base);
var D6 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D6, Base);
- var _super = _create_super(D6);
function D6() {
_class_call_check(this, D6);
- return _super.apply(this, arguments);
+ return _call_super(this, D6, arguments);
}
return D6;
}(Base);
var D7 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D7, Base);
- var _super = _create_super(D7);
function D7() {
_class_call_check(this, D7);
- return _super.apply(this, arguments);
+ return _call_super(this, D7, arguments);
}
return D7;
}(Base);
var D8 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D8, Base);
- var _super = _create_super(D8);
function D8() {
_class_call_check(this, D8);
- return _super.apply(this, arguments);
+ return _call_super(this, D8, arguments);
}
return D8;
}(Base);
var D9 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D9, Base);
- var _super = _create_super(D9);
function D9() {
_class_call_check(this, D9);
- return _super.apply(this, arguments);
+ return _call_super(this, D9, arguments);
}
return D9;
}(Base);
var D10 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D10, Base);
- var _super = _create_super(D10);
function D10() {
_class_call_check(this, D10);
- return _super.apply(this, arguments);
+ return _call_super(this, D10, arguments);
}
return D10;
}(Base);
@@ -164,10 +149,9 @@ var E;
var D11 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D11, Base);
- var _super = _create_super(D11);
function D11() {
_class_call_check(this, D11);
- return _super.apply(this, arguments);
+ return _call_super(this, D11, arguments);
}
return D11;
}(Base);
@@ -178,10 +162,9 @@ function f() {}
var D12 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D12, Base);
- var _super = _create_super(D12);
function D12() {
_class_call_check(this, D12);
- return _super.apply(this, arguments);
+ return _call_super(this, D12, arguments);
}
return D12;
}(Base);
@@ -195,30 +178,27 @@ var c = function c() {
var D13 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D13, Base);
- var _super = _create_super(D13);
function D13() {
_class_call_check(this, D13);
- return _super.apply(this, arguments);
+ return _call_super(this, D13, arguments);
}
return D13;
}(Base);
var D14 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D14, Base);
- var _super = _create_super(D14);
function D14() {
_class_call_check(this, D14);
- return _super.apply(this, arguments);
+ return _call_super(this, D14, arguments);
}
return D14;
}(Base);
var D15 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D15, Base);
- var _super = _create_super(D15);
function D15() {
_class_call_check(this, D15);
- return _super.apply(this, arguments);
+ return _call_super(this, D15, arguments);
}
return D15;
}(Base);
@@ -228,20 +208,18 @@ var D15 = /*#__PURE__*/ function(Base) {
var D16 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D16, Base);
- var _super = _create_super(D16);
function D16() {
_class_call_check(this, D16);
- return _super.apply(this, arguments);
+ return _call_super(this, D16, arguments);
}
return D16;
}(Base);
var D17 = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(D17, Base);
- var _super = _create_super(D17);
function D17() {
_class_call_check(this, D17);
- return _super.apply(this, arguments);
+ return _call_super(this, D17, arguments);
}
return D17;
}(Base);
diff --git a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.2.minified.js b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.2.minified.js
index 9a0f697d098..f4707f484ce 100644
--- a/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.2.minified.js
+++ b/crates/swc/tests/tsc-references/undefinedIsSubtypeOfEverything.2.minified.js
@@ -1,7 +1,7 @@
//// [undefinedIsSubtypeOfEverything.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
function f() {}
(E1 = E || (E = {}))[E1.A = 0] = "A", (f || (f = {})).bar = 1;
var E, E1, c = function c() {
diff --git a/crates/swc/tests/tsc-references/unionTypeEquivalence.1.normal.js b/crates/swc/tests/tsc-references/unionTypeEquivalence.1.normal.js
index 1cd312b3bb5..f2891af7f0a 100644
--- a/crates/swc/tests/tsc-references/unionTypeEquivalence.1.normal.js
+++ b/crates/swc/tests/tsc-references/unionTypeEquivalence.1.normal.js
@@ -1,8 +1,8 @@
//// [unionTypeEquivalence.ts]
// A | B is equivalent to A if B is a subtype of A
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var C = function C() {
"use strict";
_class_call_check(this, C);
@@ -10,10 +10,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo = function foo() {};
diff --git a/crates/swc/tests/tsc-references/unionTypeEquivalence.2.minified.js b/crates/swc/tests/tsc-references/unionTypeEquivalence.2.minified.js
index fa02c2af791..188abd4067e 100644
--- a/crates/swc/tests/tsc-references/unionTypeEquivalence.2.minified.js
+++ b/crates/swc/tests/tsc-references/unionTypeEquivalence.2.minified.js
@@ -1,4 +1,4 @@
//// [unionTypeEquivalence.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.1.normal.js b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.1.normal.js
index c2434c60a5c..ad460ccc3cb 100644
--- a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.1.normal.js
+++ b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.1.normal.js
@@ -3,9 +3,9 @@
// If the array literal is empty, the resulting type is an array type with the element type Undefined.
// Otherwise, if the array literal is contextually typed by a type that has a property with the numeric name ‘0’, the resulting type is a tuple type constructed from the types of the element expressions.
// Otherwise, the resulting type is an array type with an element type that is the union of the types of the element expressions.
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var arr1 = [
1,
2
@@ -54,10 +54,9 @@ var D = /*#__PURE__*/ function() {
var E = /*#__PURE__*/ function(C) {
"use strict";
_inherits(E, C);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo3 = function foo3() {};
@@ -66,10 +65,9 @@ var E = /*#__PURE__*/ function(C) {
var F = /*#__PURE__*/ function(C) {
"use strict";
_inherits(F, C);
- var _super = _create_super(F);
function F() {
_class_call_check(this, F);
- return _super.apply(this, arguments);
+ return _call_super(this, F, arguments);
}
var _proto = F.prototype;
_proto.foo4 = function foo4() {};
diff --git a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.2.minified.js b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.2.minified.js
index b5081ee5bf9..306be6b2454 100644
--- a/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.2.minified.js
+++ b/crates/swc/tests/tsc-references/unionTypeFromArrayLiteral.2.minified.js
@@ -1,4 +1,4 @@
//// [unionTypeFromArrayLiteral.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
diff --git a/crates/swc/tests/tsc-references/unionTypesAssignability.1.normal.js b/crates/swc/tests/tsc-references/unionTypesAssignability.1.normal.js
index bc3a5f1a16f..c0f476217ca 100644
--- a/crates/swc/tests/tsc-references/unionTypesAssignability.1.normal.js
+++ b/crates/swc/tests/tsc-references/unionTypesAssignability.1.normal.js
@@ -1,7 +1,7 @@
//// [unionTypesAssignability.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
var unionNumberString;
var C = function C() {
"use strict";
@@ -10,10 +10,9 @@ var C = function C() {
var D = /*#__PURE__*/ function(C) {
"use strict";
_inherits(D, C);
- var _super = _create_super(D);
function D() {
_class_call_check(this, D);
- return _super.apply(this, arguments);
+ return _call_super(this, D, arguments);
}
var _proto = D.prototype;
_proto.foo1 = function foo1() {};
@@ -22,10 +21,9 @@ var D = /*#__PURE__*/ function(C) {
var E = /*#__PURE__*/ function(C) {
"use strict";
_inherits(E, C);
- var _super = _create_super(E);
function E() {
_class_call_check(this, E);
- return _super.apply(this, arguments);
+ return _call_super(this, E, arguments);
}
var _proto = E.prototype;
_proto.foo2 = function foo2() {};
diff --git a/crates/swc/tests/tsc-references/unionTypesAssignability.2.minified.js b/crates/swc/tests/tsc-references/unionTypesAssignability.2.minified.js
index 2ec15e10b22..6ccefa6e90b 100644
--- a/crates/swc/tests/tsc-references/unionTypesAssignability.2.minified.js
+++ b/crates/swc/tests/tsc-references/unionTypesAssignability.2.minified.js
@@ -1,6 +1,6 @@
//// [unionTypesAssignability.ts]
var unionNumberString, unionDE, num, str, c, d, e;
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
c = d, c = e, c = unionDE, d = e, e = d = unionDE, e = unionDE, num = str, str = num = unionNumberString, str = unionNumberString, d = c, e = c, unionDE = c, e = d, unionDE = d, d = e, unionDE = e, str = num, unionNumberString = num, num = str;
diff --git a/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).1.normal.js b/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).1.normal.js
index 2ffd41628d8..b2df215dedf 100644
--- a/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).1.normal.js
+++ b/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).1.normal.js
@@ -1,13 +1,13 @@
//// [usingDeclarations.1.ts]
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
import { _ as _await_async_generator } from "@swc/helpers/_/_await_async_generator";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
import { _ as _wrap_async_generator } from "@swc/helpers/_/_wrap_async_generator";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
try {
@@ -384,14 +384,13 @@ try {
var C2 = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(C2, C1);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
var _this;
try {
var _usingCtx = _using_ctx();
var d16 = _usingCtx.u(_define_property({}, Symbol.dispose, function() {}));
- _this = _super.call(this);
+ _this = _call_super(this, C2);
} catch (_) {
_usingCtx.e = _;
} finally{
@@ -404,14 +403,13 @@ try {
var C3 = /*#__PURE__*/ function(C1) {
"use strict";
_inherits(C3, C1);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
var _this;
try {
var _usingCtx = _using_ctx();
var d17 = _usingCtx.u(_define_property({}, Symbol.dispose, function() {}));
- _this = _super.call(this);
+ _this = _call_super(this, C3);
_this.y = 1;
} catch (_) {
_usingCtx.e = _;
diff --git a/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).2.minified.js b/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).2.minified.js
index 445a366d3e2..64390ce1dfd 100644
--- a/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).2.minified.js
+++ b/crates/swc/tests/tsc-references/usingDeclarations.1(target=es5).2.minified.js
@@ -1,13 +1,13 @@
//// [usingDeclarations.1.ts]
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
import { _ as _await_async_generator } from "@swc/helpers/_/_await_async_generator";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
import { _ as _wrap_async_generator } from "@swc/helpers/_/_wrap_async_generator";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
try {
diff --git a/crates/swc/tests/tsc-references/usingDeclarations.11.1.normal.js b/crates/swc/tests/tsc-references/usingDeclarations.11.1.normal.js
index 8dde64a1e4b..41e1589c4d5 100644
--- a/crates/swc/tests/tsc-references/usingDeclarations.11.1.normal.js
+++ b/crates/swc/tests/tsc-references/usingDeclarations.11.1.normal.js
@@ -1,8 +1,8 @@
//// [usingDeclarations.11.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
var A = function A() {
"use strict";
@@ -11,14 +11,13 @@ var A = function A() {
var C1 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C1, A);
- var _super = _create_super(C1);
function C1() {
_class_call_check(this, C1);
var _this;
try {
var _usingCtx = _using_ctx();
var x = _usingCtx.u(null);
- _this = _super.call(this);
+ _this = _call_super(this, C1);
} catch (_) {
_usingCtx.e = _;
} finally{
@@ -31,13 +30,12 @@ var C1 = /*#__PURE__*/ function(A) {
var C2 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C2, A);
- var _super = _create_super(C2);
function C2() {
_class_call_check(this, C2);
var _this;
try {
var _usingCtx = _using_ctx();
- _this = _super.call(this);
+ _this = _call_super(this, C2);
var x = _usingCtx.u(null);
} catch (_) {
_usingCtx.e = _;
@@ -51,14 +49,13 @@ var C2 = /*#__PURE__*/ function(A) {
var C3 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C3, A);
- var _super = _create_super(C3);
function C3() {
_class_call_check(this, C3);
var _this;
try {
var _usingCtx = _using_ctx();
var x = _usingCtx.u(null);
- _this = _super.call(this);
+ _this = _call_super(this, C3);
_this.y = 1;
} catch (_) {
_usingCtx.e = _;
@@ -72,14 +69,13 @@ var C3 = /*#__PURE__*/ function(A) {
var C4 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C4, A);
- var _super = _create_super(C4);
function C4(y) {
_class_call_check(this, C4);
var _this;
try {
var _usingCtx = _using_ctx();
var x = _usingCtx.u(null);
- _this = _super.call(this);
+ _this = _call_super(this, C4);
_this.y = y;
} catch (_) {
_usingCtx.e = _;
@@ -93,14 +89,13 @@ var C4 = /*#__PURE__*/ function(A) {
var C5 = /*#__PURE__*/ function(A) {
"use strict";
_inherits(C5, A);
- var _super = _create_super(C5);
function C5(y) {
_class_call_check(this, C5);
var _this;
try {
var _usingCtx = _using_ctx();
var x = _usingCtx.u(null);
- _this = _super.call(this);
+ _this = _call_super(this, C5);
_this.y = y;
_this.z = 1;
} catch (_) {
diff --git a/crates/swc/tests/tsc-references/usingDeclarations.11.2.minified.js b/crates/swc/tests/tsc-references/usingDeclarations.11.2.minified.js
index 09e7774421b..9f068c3518e 100644
--- a/crates/swc/tests/tsc-references/usingDeclarations.11.2.minified.js
+++ b/crates/swc/tests/tsc-references/usingDeclarations.11.2.minified.js
@@ -1,6 +1,6 @@
//// [usingDeclarations.11.ts]
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _possible_constructor_return } from "@swc/helpers/_/_possible_constructor_return";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx";
diff --git a/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js b/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js
index f2036038616..2987d868557 100644
--- a/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js
+++ b/crates/swc/tests/vercel/full/react-autowhatever/1/output/index.js
@@ -4,20 +4,18 @@ Object.defineProperty(exports, "__esModule", {
}), Object.defineProperty(exports, "default", {
enumerable: !0,
get: function() {
- return p;
+ return _;
}
});
-var e = require("@swc/helpers/_/_assert_this_initialized"), t = require("@swc/helpers/_/_class_call_check"), r = require("@swc/helpers/_/_create_class"), i = require("@swc/helpers/_/_define_property"), n = require("@swc/helpers/_/_inherits"), s = require("@swc/helpers/_/_interop_require_default"), u = require("@swc/helpers/_/_interop_require_wildcard"), d = require("@swc/helpers/_/_object_spread"), c = require("@swc/helpers/_/_object_spread_props"), l = require("@swc/helpers/_/_create_super"), a = require("react/jsx-runtime"), o = /*#__PURE__*/ u._(require("react")), _ = /*#__PURE__*/ s._(require("prop-types")), p = /*#__PURE__*/ function(s) {
+var e = require("@swc/helpers/_/_call_super"), t = require("@swc/helpers/_/_class_call_check"), r = require("@swc/helpers/_/_create_class"), i = require("@swc/helpers/_/_define_property"), n = require("@swc/helpers/_/_inherits"), s = require("@swc/helpers/_/_interop_require_default"), u = require("@swc/helpers/_/_interop_require_wildcard"), d = require("@swc/helpers/_/_object_spread"), c = require("@swc/helpers/_/_object_spread_props"), l = require("react/jsx-runtime"), a = /*#__PURE__*/ u._(require("react")), o = /*#__PURE__*/ s._(require("prop-types")), _ = /*#__PURE__*/ function(s) {
"use strict";
- n._(o, s);
- var u = l._(o);
- function o() {
+ function u() {
var r;
- return t._(this, o), r = u.apply(this, arguments), i._(e._(r), "storeHighlightedItemReference", function(e) {
+ return t._(this, u), r = e._(this, u, arguments), i._(r, "storeHighlightedItemReference", function(e) {
r.props.onHighlightedItemChange(null === e ? null : e.item);
}), r;
}
- return r._(o, [
+ return n._(u, s), r._(u, [
{
key: "shouldComponentUpdate",
value: function(e) {
@@ -27,19 +25,19 @@ var e = require("@swc/helpers/_/_assert_this_initialized"), t = require("@swc/he
{
key: "render",
value: function() {
- var e = this, t = this.props, r = t.items, i = t.itemProps, n = t.renderItem, s = t.renderItemData, u = t.sectionIndex, l = t.highlightedItemIndex, o = t.getItemId, _ = t.theme, p = t.keyPrefix, h = null === u ? p : "".concat(p, "section-").concat(u, "-"), f = "function" == typeof i;
- return /*#__PURE__*/ (0, a.jsx)("ul", c._(d._({
+ var e = this, t = this.props, r = t.items, i = t.itemProps, n = t.renderItem, s = t.renderItemData, u = t.sectionIndex, a = t.highlightedItemIndex, o = t.getItemId, _ = t.theme, p = t.keyPrefix, h = null === u ? p : "".concat(p, "section-").concat(u, "-"), f = "function" == typeof i;
+ return /*#__PURE__*/ (0, l.jsx)("ul", c._(d._({
role: "listbox"
}, _("".concat(h, "items-list"), "itemsList")), {
children: r.map(function(t, r) {
- var p = 0 === r, m = r === l, I = "".concat(h, "item-").concat(r), g = f ? i({
+ var p = 0 === r, m = r === a, I = "".concat(h, "item-").concat(r), g = f ? i({
sectionIndex: u,
itemIndex: r
}) : i, q = d._({
id: o(u, r),
"aria-selected": m
}, _(I, "item", p && "itemFirst", m && "itemHighlighted"), g);
- return m && (q.ref = e.storeHighlightedItemReference), /*#__PURE__*/ (0, a.jsx)(Item, c._(d._({}, q), {
+ return m && (q.ref = e.storeHighlightedItemReference), /*#__PURE__*/ (0, l.jsx)(Item, c._(d._({}, q), {
sectionIndex: u,
isHighlighted: m,
itemIndex: r,
@@ -51,22 +49,22 @@ var e = require("@swc/helpers/_/_assert_this_initialized"), t = require("@swc/he
}));
}
}
- ]), o;
-}(o.Component);
-i._(p, "propTypes", {
- items: _.default.array.isRequired,
- itemProps: _.default.oneOfType([
- _.default.object,
- _.default.func
+ ]), u;
+}(a.Component);
+i._(_, "propTypes", {
+ items: o.default.array.isRequired,
+ itemProps: o.default.oneOfType([
+ o.default.object,
+ o.default.func
]),
- renderItem: _.default.func.isRequired,
- renderItemData: _.default.object.isRequired,
- sectionIndex: _.default.number,
- highlightedItemIndex: _.default.number,
- onHighlightedItemChange: _.default.func.isRequired,
- getItemId: _.default.func.isRequired,
- theme: _.default.func.isRequired,
- keyPrefix: _.default.string.isRequired
-}), i._(p, "defaultProps", {
+ renderItem: o.default.func.isRequired,
+ renderItemData: o.default.object.isRequired,
+ sectionIndex: o.default.number,
+ highlightedItemIndex: o.default.number,
+ onHighlightedItemChange: o.default.func.isRequired,
+ getItemId: o.default.func.isRequired,
+ theme: o.default.func.isRequired,
+ keyPrefix: o.default.string.isRequired
+}), i._(_, "defaultProps", {
sectionIndex: null
-}), new p();
+}), new _();
diff --git a/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js b/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js
index 1d0e3e714f0..4e6de904f57 100644
--- a/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js
+++ b/crates/swc/tests/vercel/full/react-autowhatever/2/output/index.js
@@ -7,17 +7,15 @@ Object.defineProperty(exports, "__esModule", {
return u;
}
});
-var e = require("@swc/helpers/_/_assert_this_initialized"), r = require("@swc/helpers/_/_class_call_check"), t = require("@swc/helpers/_/_create_class"), i = require("@swc/helpers/_/_define_property"), s = require("@swc/helpers/_/_inherits"), n = require("@swc/helpers/_/_interop_require_wildcard"), c = require("@swc/helpers/_/_object_spread"), o = require("@swc/helpers/_/_object_spread_props"), _ = require("@swc/helpers/_/_create_super"), l = require("react/jsx-runtime"), u = /*#__PURE__*/ function(n) {
+var e = require("@swc/helpers/_/_call_super"), t = require("@swc/helpers/_/_class_call_check"), r = require("@swc/helpers/_/_create_class"), i = require("@swc/helpers/_/_define_property"), s = require("@swc/helpers/_/_inherits"), n = require("@swc/helpers/_/_interop_require_wildcard"), c = require("@swc/helpers/_/_object_spread"), o = require("@swc/helpers/_/_object_spread_props"), l = require("react/jsx-runtime"), u = /*#__PURE__*/ function(n) {
"use strict";
- s._(p, n);
- var u = _._(p);
- function p() {
- var t;
- return r._(this, p), t = u.apply(this, arguments), i._(e._(t), "storeHighlightedItemReference", function(e) {
- t.props.onHighlightedItemChange(null === e ? null : e.item);
- }), t;
+ function u() {
+ var r;
+ return t._(this, u), r = e._(this, u, arguments), i._(r, "storeHighlightedItemReference", function(e) {
+ r.props.onHighlightedItemChange(null === e ? null : e.item);
+ }), r;
}
- return t._(p, [
+ return s._(u, n), r._(u, [
{
key: "shouldComponentUpdate",
value: function(e) {
@@ -29,23 +27,23 @@ var e = require("@swc/helpers/_/_assert_this_initialized"), r = require("@swc/he
{
key: "render",
value: function() {
- var e = this, r = this.props, t = r.items, i = r.itemProps, s = r.renderItem, n = r.renderItemData, _ = r.sectionIndex, u = r.highlightedItemIndex, p = r.getItemId, a = r.theme, d = r.keyPrefix, h = null === _ ? d : "".concat(d, "section-").concat(_, "-"), m = "function" == typeof i;
+ var e = this, t = this.props, r = t.items, i = t.itemProps, s = t.renderItem, n = t.renderItemData, u = t.sectionIndex, _ = t.highlightedItemIndex, p = t.getItemId, a = t.theme, d = t.keyPrefix, h = null === u ? d : "".concat(d, "section-").concat(u, "-"), m = "function" == typeof i;
return /*#__PURE__*/ (0, l.jsx)("ul", o._(c._({
role: "listbox"
}, a("".concat(h, "items-list"), "itemsList")), {
- children: t.map(function(r, t) {
- var d = 0 === t, f = t === u, I = "".concat(h, "item-").concat(t), g = m ? i({
- sectionIndex: _,
- itemIndex: t
+ children: r.map(function(t, r) {
+ var d = 0 === r, f = r === _, I = "".concat(h, "item-").concat(r), g = m ? i({
+ sectionIndex: u,
+ itemIndex: r
}) : i, x = c._({
- id: p(_, t),
+ id: p(u, r),
"aria-selected": f
}, a(I, "item", d && "itemFirst", f && "itemHighlighted"), g);
return f && (x.ref = e.storeHighlightedItemReference), /*#__PURE__*/ (0, l.jsx)(Item, o._(c._({}, x), {
- sectionIndex: _,
+ sectionIndex: u,
isHighlighted: f,
- itemIndex: t,
- item: r,
+ itemIndex: r,
+ item: t,
renderItem: s,
renderItemData: n
}));
@@ -53,7 +51,7 @@ var e = require("@swc/helpers/_/_assert_this_initialized"), r = require("@swc/he
}));
}
}
- ]), p;
+ ]), u;
}(/*#__PURE__*/ n._(require("react")).Component);
i._(u, "propTypes", {
items: 500
diff --git a/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js b/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js
index 679ba4e06b8..a2593c51ea3 100644
--- a/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js
+++ b/crates/swc/tests/vercel/loader-only/react-autowhatever/1/output/index.js
@@ -1,11 +1,10 @@
-import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
+import { _ as _call_super } from "@swc/helpers/_/_call_super";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _inherits } from "@swc/helpers/_/_inherits";
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
-import { _ as _create_super } from "@swc/helpers/_/_create_super";
import { jsx as _jsx } from "react/jsx-runtime";
import React, { Component } from "react";
import PropTypes from "prop-types";
@@ -14,12 +13,11 @@ import compareObjects from "./compareObjects";
var ItemsList = /*#__PURE__*/ function(Component) {
"use strict";
_inherits(ItemsList, Component);
- var _super = _create_super(ItemsList);
function ItemsList() {
_class_call_check(this, ItemsList);
var _this;
- _this = _super.apply(this, arguments);
- _define_property(_assert_this_initialized(_this), "storeHighlightedItemReference", function(highlightedItem) {
+ _this = _call_super(this, ItemsList, arguments);
+ _define_property(_this, "storeHighlightedItemReference", function(highlightedItem) {
_this.props.onHighlightedItemChange(highlightedItem === null ? null : highlightedItem.item);
});
return _this;
diff --git a/crates/swc_ecma_compat_es2015/src/classes/constructor.rs b/crates/swc_ecma_compat_es2015/src/classes/constructor.rs
index 35889703b67..08edb050b53 100644
--- a/crates/swc_ecma_compat_es2015/src/classes/constructor.rs
+++ b/crates/swc_ecma_compat_es2015/src/classes/constructor.rs
@@ -1,527 +1,551 @@
-use std::iter;
+use std::mem;
-use swc_common::{util::take::Take, Mark, SyntaxContext, DUMMY_SP};
+use swc_common::{util::take::Take, Spanned, SyntaxContext, DUMMY_SP};
use swc_ecma_ast::*;
-use swc_ecma_transforms_base::helper;
-use swc_ecma_transforms_classes::{get_prototype_of, visit_mut_only_key};
-use swc_ecma_utils::{quote_ident, ExprFactory};
-use swc_ecma_visit::{
- noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitMutWith, VisitWith,
-};
+use swc_ecma_transforms_base::{helper, helper_expr};
+use swc_ecma_transforms_classes::super_field::SuperFieldAccessFolder;
+use swc_ecma_utils::{default_constructor, private_ident, quote_ident, ExprFactory};
+use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;
+use tracing::debug;
-pub(super) struct SuperCallFinder {
- mode: Option,
- /// True in conditional statement or arrow expression.
- in_complex: bool,
-}
+use super::Config;
-#[swc_trace]
-impl SuperCallFinder {
- ///
- /// - `None`: if no `super()` is found or super() is last call
- /// - `Some(Var)`: `var _this = ...`
- /// - `Some(Assign)`: `_this = ...`
- pub fn find(node: &[Stmt]) -> Option {
- if let Some(Stmt::Expr(ExprStmt { ref expr, .. })) = node.last() {
- if let Expr::Call(CallExpr {
- callee: Callee::Super(..),
- ..
- }) = &**expr
- {
- return None;
+pub(super) fn fold_constructor(
+ constructor: Option,
+ class_name: &Ident,
+ class_super_name: &Option,
+ config: Config,
+) -> FnDecl {
+ let is_derived = class_super_name.is_some();
+ let mut constructor = constructor.unwrap_or_else(|| default_constructor(is_derived));
+
+ // Black magic to detect injected constructor.
+ let is_constructor_default = constructor.span.is_dummy();
+ if is_constructor_default {
+ debug!("Dropping constructor parameters because the constructor is injected");
+ constructor.params.take();
+ }
+
+ let params = constructor
+ .params
+ .take()
+ .into_iter()
+ .map(|p| p.param().expect("All TS params should be converted"))
+ .collect();
+
+ let mut stmts = vec![];
+
+ if !config.no_class_calls {
+ // _class_call_check(this, C)
+ stmts.push(
+ CallExpr {
+ callee: helper!(class_call_check),
+ args: vec![
+ Expr::This(ThisExpr { span: DUMMY_SP }).as_arg(),
+ class_name.clone().as_arg(),
+ ],
+ ..Default::default()
}
- }
+ .into_stmt(),
+ );
+ }
- let mut v = SuperCallFinder {
- mode: None,
- in_complex: false,
+ // handle super prop by default
+ let mut has_super_prop = true;
+ let mut this_mark = None;
+
+ let mut body = constructor.body.take().unwrap();
+ if let Some(class_super_name) = class_super_name {
+ let is_last_super = (&*body.stmts).is_super_last_call();
+
+ let mut constructor_folder = ConstructorFolder {
+ class_key_init: vec![],
+ class_name: class_name.clone(),
+ class_super_name: class_super_name.clone(),
+ in_arrow: false,
+ in_nested_class: false,
+ is_constructor_default,
+ is_super_callable_constructor: config.super_is_callable_constructor,
+ super_found: false,
+ super_prop_found: false,
+ this: None,
+ this_ref_count: 0,
};
- node.visit_with(&mut v);
- v.mode
- }
-}
-macro_rules! ignore_return {
- ($name:ident, $T:ty) => {
- fn $name(&mut self, n: &mut $T) {
- let old = self.ignore_return;
- self.ignore_return = true;
- n.visit_mut_children_with(self);
- self.ignore_return = old;
- }
- };
-}
+ body.visit_mut_with(&mut constructor_folder);
-macro_rules! mark_as_complex {
- ($name:ident, $T:ty) => {
- fn $name(&mut self, node: &$T) {
- let old = self.in_complex;
- self.in_complex = true;
- node.visit_children_with(self);
- self.in_complex = old;
- }
- };
-}
+ // disable SuperFieldAccessFolder if super prop is not used
+ has_super_prop = constructor_folder.super_prop_found;
-#[swc_trace]
-impl Visit for SuperCallFinder {
- noop_visit_type!(fail);
+ // Optimize for last super call
+ if is_last_super {
+ if let Some(stmt) = body.stmts.last_mut() {
+ if let Some(expr_stmt) = stmt.as_mut_expr() {
+ let span = expr_stmt.span;
+ match expr_stmt.expr.as_mut() {
+ Expr::Assign(assign) => {
+ let arg = if constructor_folder.this_ref_count == 1 {
+ constructor_folder.this_ref_count = 0;
+ assign.right.take()
+ } else {
+ assign.take().into()
+ };
+ *stmt = ReturnStmt {
+ span,
+ arg: arg.into(),
+ }
+ .into();
+ }
+ arg @ Expr::Seq(..) | arg @ Expr::Paren(..) => {
+ *stmt = ReturnStmt {
+ span,
+ arg: Some(Box::new(arg.take())),
+ }
+ .into();
+ }
- mark_as_complex!(visit_arrow_expr, ArrowExpr);
-
- mark_as_complex!(visit_if_stmt, IfStmt);
-
- mark_as_complex!(visit_prop_name, PropName);
-
- fn visit_assign_expr(&mut self, node: &AssignExpr) {
- node.left.visit_with(self);
-
- let old = self.in_complex;
- self.in_complex = true;
- node.right.visit_children_with(self);
- self.in_complex = old;
- }
-
- fn visit_call_expr(&mut self, e: &CallExpr) {
- match e.callee {
- Callee::Super(..) => match self.mode {
- None if !self.in_complex => self.mode = Some(SuperFoldingMode::Var),
-
- // Complex `super()`
- None if self.in_complex => self.mode = Some(SuperFoldingMode::Assign),
-
- // Multiple `super()`
- Some(SuperFoldingMode::Var) => self.mode = Some(SuperFoldingMode::Assign),
- _ => {}
- },
-
- _ => e.visit_children_with(self),
- }
- }
-
- /// Don't recurse into class declaration.
- fn visit_class(&mut self, _: &Class) {}
-
- /// Don't recurse into function.
- fn visit_function(&mut self, _: &Function) {}
-
- fn visit_member_expr(&mut self, e: &MemberExpr) {
- e.visit_children_with(self);
-
- if let Expr::Call(CallExpr {
- callee: Callee::Super(..),
- ..
- }) = &*e.obj
- {
- // super().foo
- self.mode = Some(SuperFoldingMode::Assign)
- }
- }
-}
-
-pub(super) fn constructor_fn(c: Constructor) -> Box {
- Function {
- span: DUMMY_SP,
- decorators: Default::default(),
- params: c
- .params
- .into_iter()
- .map(|pat| match pat {
- ParamOrTsParamProp::Param(p) => p,
- _ => unimplemented!("TsParamProp in constructor"),
- })
- .collect(),
- body: c.body,
- is_async: false,
- is_generator: false,
- ..Default::default()
- }
- .into()
-}
-
-/// # In
-///
-/// ```js
-/// super();
-/// ```
-///
-/// # Out
-/// ```js
-/// _this = ...;
-/// ```
-pub(super) struct ConstructorFolder<'a> {
- pub class_name: &'a Ident,
- pub mode: Option,
-
- /// Mark for `_this`
- pub mark: Mark,
- pub is_constructor_default: bool,
- pub super_var: Option,
- /// True when recursing into other function or class.
- pub ignore_return: bool,
- pub super_is_callable_constructor: bool,
-}
-
-/// `None`: `return _possible_constructor_return`
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub(super) enum SuperFoldingMode {
- /// `var _this;` followed by `_this = ...`
- Assign,
- /// `var _this = ...`
- Var,
-}
-
-#[swc_trace]
-impl VisitMut for ConstructorFolder<'_> {
- noop_visit_mut_type!(fail);
-
- visit_mut_only_key!();
-
- ignore_return!(visit_mut_class, Class);
-
- ignore_return!(visit_mut_arrow_expr, ArrowExpr);
-
- ignore_return!(visit_mut_constructor, Constructor);
-
- ignore_return!(visit_mut_getter_prop, GetterProp);
-
- ignore_return!(visit_mut_setter_prop, SetterProp);
-
- fn visit_mut_function(&mut self, _: &mut Function) {}
-
- fn visit_mut_expr(&mut self, expr: &mut Expr) {
- match self.mode {
- Some(SuperFoldingMode::Assign) => {}
- _ => {
- expr.visit_mut_children_with(self);
- return;
+ _ => {}
+ }
+ };
}
}
- expr.visit_mut_children_with(self);
+ if constructor_folder.this_ref_count > 0 || constructor_folder.super_prop_found {
+ let this = constructor_folder
+ .this
+ .get_or_insert_with(|| private_ident!("_this"))
+ .clone();
- if let Expr::Call(CallExpr {
- callee: Callee::Super(..),
- args,
- ..
- }) = expr
- {
- let right = match self.super_var.clone() {
- Some(super_var) => {
- let call = CallExpr {
- span: DUMMY_SP,
- callee: if self.is_constructor_default {
- super_var.make_member(quote_ident!("apply")).as_callee()
- } else {
- super_var.make_member(quote_ident!("call")).as_callee()
- },
- args: if self.is_constructor_default {
- vec![
- ThisExpr { span: DUMMY_SP }.as_arg(),
- quote_ident!("arguments").as_arg(),
- ]
- } else {
- let mut call_args = vec![ThisExpr { span: DUMMY_SP }.as_arg()];
- call_args.extend(args.take());
+ this_mark = Some(this.ctxt.outer());
- call_args
- },
- ..Default::default()
- }
- .into();
-
- if self.super_is_callable_constructor {
- BinExpr {
- span: DUMMY_SP,
- left: call,
- op: op!("||"),
- right: Box::new(ThisExpr { span: DUMMY_SP }.into()),
- }
- .into()
- } else {
- call
- }
- }
-
- None => Box::new(make_possible_return_value(ReturningMode::Prototype {
- class_name: self.class_name.clone(),
- args: Some(args.take()),
- is_constructor_default: self.is_constructor_default,
- })),
+ let var = VarDeclarator {
+ name: Pat::Ident(this.into()),
+ span: DUMMY_SP,
+ init: None,
+ definite: false,
};
- *expr = AssignExpr {
+ let var = VarDecl {
+ decls: vec![var],
+ ..Default::default()
+ };
+
+ stmts.push(var.into());
+ }
+
+ if !is_last_super {
+ let this = if constructor_folder.super_found {
+ Expr::Ident(constructor_folder.this.unwrap())
+ } else {
+ let this = constructor_folder
+ .this
+ .map_or_else(|| Expr::undefined(DUMMY_SP).as_arg(), |this| this.as_arg());
+
+ helper_expr!(possible_constructor_return).as_call(DUMMY_SP, vec![this])
+ };
+
+ let return_this = ReturnStmt {
span: DUMMY_SP,
- left: quote_ident!(SyntaxContext::empty().apply_mark(self.mark), "_this").into(),
- op: op!("="),
- right,
- }
- .into();
- };
+ arg: Some(this.into()),
+ };
+ body.stmts.push(return_this.into());
+ }
}
- fn visit_mut_return_stmt(&mut self, stmt: &mut ReturnStmt) {
- if self.ignore_return {
+ if has_super_prop {
+ let mut folder = SuperFieldAccessFolder {
+ class_name,
+ constructor_this_mark: this_mark,
+ // constructor cannot be static
+ is_static: false,
+ folding_constructor: true,
+ in_nested_scope: false,
+ in_injected_define_property_call: false,
+ this_alias_mark: None,
+ constant_super: config.constant_super,
+ super_class: class_super_name,
+ in_pat: false,
+ };
+
+ body.visit_mut_with(&mut folder);
+
+ if let Some(mark) = folder.this_alias_mark {
+ stmts.push(
+ VarDecl {
+ span: DUMMY_SP,
+ declare: false,
+ kind: VarDeclKind::Var,
+ decls: vec![VarDeclarator {
+ span: DUMMY_SP,
+ name: quote_ident!(SyntaxContext::empty().apply_mark(mark), "_this").into(),
+ init: Some(Box::new(Expr::This(ThisExpr { span: DUMMY_SP }))),
+ definite: false,
+ }],
+ ..Default::default()
+ }
+ .into(),
+ )
+ }
+ }
+
+ stmts.extend(body.stmts);
+
+ let function = Function {
+ params,
+ body: Some(BlockStmt {
+ stmts,
+ ..Default::default()
+ }),
+ ..Default::default()
+ };
+
+ FnDecl {
+ ident: class_name.clone(),
+ declare: false,
+ function: function.into(),
+ }
+}
+
+struct ConstructorFolder {
+ class_key_init: Vec,
+ class_name: Ident,
+ class_super_name: Ident,
+
+ in_arrow: bool,
+ in_nested_class: bool,
+
+ is_constructor_default: bool,
+ is_super_callable_constructor: bool,
+
+ // super_found will be inherited from parent scope
+ // but it should be reset when exiting from the conditional scope
+ // e.g. if/while/for/try
+ super_found: bool,
+ super_prop_found: bool,
+
+ this: Option,
+ this_ref_count: usize,
+}
+
+#[swc_trace]
+impl VisitMut for ConstructorFolder {
+ noop_visit_mut_type!(fail);
+
+ fn visit_mut_constructor(&mut self, _: &mut Constructor) {
+ // skip
+ }
+
+ fn visit_mut_function(&mut self, _: &mut Function) {
+ // skip
+ }
+
+ fn visit_mut_getter_prop(&mut self, _: &mut GetterProp) {
+ // skip
+ }
+
+ fn visit_mut_setter_prop(&mut self, _: &mut SetterProp) {
+ // skip
+ }
+
+ fn visit_mut_if_stmt(&mut self, node: &mut IfStmt) {
+ node.test.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.cons.visit_mut_with(self);
+ node.alt.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+
+ fn visit_mut_while_stmt(&mut self, node: &mut WhileStmt) {
+ node.test.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.body.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+
+ fn visit_mut_do_while_stmt(&mut self, node: &mut DoWhileStmt) {
+ node.test.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.body.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+
+ fn visit_mut_for_stmt(&mut self, node: &mut ForStmt) {
+ node.init.visit_mut_with(self);
+ node.test.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.body.visit_mut_with(self);
+ node.update.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+
+ fn visit_mut_for_of_stmt(&mut self, node: &mut ForOfStmt) {
+ node.left.visit_mut_with(self);
+ node.right.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.body.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+
+ fn visit_mut_for_in_stmt(&mut self, node: &mut ForInStmt) {
+ node.left.visit_mut_with(self);
+ node.right.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.body.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+
+ fn visit_mut_cond_expr(&mut self, node: &mut CondExpr) {
+ node.test.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.cons.visit_mut_with(self);
+ node.alt.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+
+ fn visit_mut_try_stmt(&mut self, node: &mut TryStmt) {
+ let super_found = self.super_found;
+ node.block.visit_mut_with(self);
+ node.handler.visit_mut_with(self);
+ self.super_found = super_found;
+ node.finalizer.visit_mut_with(self);
+ }
+
+ fn visit_mut_bin_expr(&mut self, node: &mut BinExpr) {
+ match node.op {
+ op!("&&") | op!("||") => {
+ node.left.visit_mut_with(self);
+ let super_found = self.super_found;
+ node.right.visit_mut_with(self);
+ self.super_found = super_found;
+ }
+ _ => {
+ node.visit_mut_children_with(self);
+ }
+ }
+ }
+
+ fn visit_mut_class(&mut self, node: &mut Class) {
+ let in_nested_class = mem::replace(&mut self.in_nested_class, true);
+ node.visit_mut_children_with(self);
+ self.in_nested_class = in_nested_class;
+ }
+
+ fn visit_mut_arrow_expr(&mut self, node: &mut ArrowExpr) {
+ let in_arrow = mem::replace(&mut self.in_arrow, true);
+ let super_found = self.super_found;
+ node.visit_mut_children_with(self);
+ self.super_found = super_found;
+ self.in_arrow = in_arrow;
+ }
+
+ fn visit_mut_stmts(&mut self, node: &mut Vec) {
+ for mut stmt in node.take().drain(..) {
+ stmt.visit_mut_with(self);
+ let class_key_init = self.class_key_init.take();
+ if !class_key_init.is_empty() {
+ node.extend(class_key_init);
+ }
+ node.push(stmt);
+ }
+ }
+
+ fn visit_mut_expr(&mut self, node: &mut Expr) {
+ if node.is_this() {
+ if !self.super_found {
+ *node = helper_expr!(assert_this_initialized)
+ .as_call(DUMMY_SP, vec![self.get_this().clone().as_arg()]);
+ } else {
+ *node = self.get_this().clone().into();
+ }
return;
}
- stmt.arg.visit_mut_with(self);
+ node.visit_mut_children_with(self);
- stmt.arg = Some(Box::new(make_possible_return_value(
- ReturningMode::Returning {
- mark: self.mark,
- arg: stmt.arg.take(),
- },
- )));
+ if self.transform_super_call(node) {
+ self.super_found = true;
+
+ let this = self.get_this().clone();
+ let assign_expr = node.take().make_assign_to(op!("="), this.clone().into());
+
+ if self.in_nested_class {
+ self.class_key_init.push(assign_expr.into_stmt());
+ *node = this.into();
+ } else {
+ *node = assign_expr;
+ }
+ }
}
- fn visit_mut_stmt(&mut self, stmt: &mut Stmt) {
- stmt.visit_mut_children_with(self);
+ fn visit_mut_return_stmt(&mut self, node: &mut ReturnStmt) {
+ node.visit_mut_children_with(self);
- if let Stmt::Expr(ExprStmt { span: _, expr }) = stmt {
- if let Expr::Call(CallExpr {
- callee: Callee::Super(..),
- args,
- ..
- }) = &mut **expr
- {
- let expr = match self.super_var.clone() {
- Some(super_var) => CallExpr {
- span: DUMMY_SP,
- callee: if self.is_constructor_default {
- super_var.make_member(quote_ident!("apply")).as_callee()
- } else {
- super_var.make_member(quote_ident!("call")).as_callee()
- },
- args: if self.is_constructor_default {
- vec![
- ThisExpr { span: DUMMY_SP }.as_arg(),
- quote_ident!("arguments").as_arg(),
- ]
- } else {
- let mut call_args = vec![ThisExpr { span: DUMMY_SP }.as_arg()];
- call_args.extend(args.take());
-
- call_args
- },
- ..Default::default()
- }
+ if !self.in_arrow {
+ let arg = node.arg.take().map(ExprFactory::as_arg);
+ let mut args = vec![self.get_this().clone().as_arg()];
+ args.extend(arg);
+ node.arg = Some(
+ helper_expr!(possible_constructor_return)
+ .as_call(DUMMY_SP, args)
.into(),
- None => Box::new(make_possible_return_value(ReturningMode::Prototype {
- is_constructor_default: self.is_constructor_default,
- class_name: self.class_name.clone(),
- args: Some(args.take()),
- })),
- };
-
- match self.mode {
- Some(SuperFoldingMode::Assign) => {
- *stmt = AssignExpr {
- span: DUMMY_SP,
- left: quote_ident!(
- SyntaxContext::empty().apply_mark(self.mark),
- "_this"
- )
- .into(),
- op: op!("="),
- right: expr,
- }
- .into_stmt()
- }
- Some(SuperFoldingMode::Var) => {
- *stmt = VarDecl {
- span: DUMMY_SP,
- declare: false,
- kind: VarDeclKind::Var,
- decls: vec![VarDeclarator {
- span: DUMMY_SP,
- name: quote_ident!(
- SyntaxContext::empty().apply_mark(self.mark),
- "_this"
- )
- .into(),
- init: Some(expr),
- definite: false,
- }],
- ..Default::default()
- }
- .into()
- }
- None => {
- *stmt = ReturnStmt {
- span: DUMMY_SP,
- arg: Some(expr),
- }
- .into()
- }
- }
- }
+ );
}
}
-}
-#[derive(Debug)]
-pub(super) enum ReturningMode {
- /// `return arg`
- Returning {
- /// Mark for `_this`
- mark: Mark,
- arg: Option>,
- },
+ fn visit_mut_super_prop(&mut self, node: &mut SuperProp) {
+ self.super_prop_found = true;
- /// `super()` call
- Prototype {
- /// Hack to handle injected (default) constructor
- is_constructor_default: bool,
- class_name: Ident,
- /// None when `super(arguments)` is injected because no constructor is
- /// defined.
- args: Option>,
- },
-}
-
-pub(super) fn make_possible_return_value(mode: ReturningMode) -> Expr {
- let callee = helper!(possible_constructor_return);
-
- CallExpr {
- span: DUMMY_SP,
- callee,
- args: match mode {
- ReturningMode::Returning { mark, arg } => {
- iter::once(quote_ident!(SyntaxContext::empty().apply_mark(mark), "_this").as_arg())
- .chain(arg.map(|arg| arg.as_arg()))
- .collect()
- }
- ReturningMode::Prototype {
- class_name,
- args,
- is_constructor_default,
- } => {
- let (fn_name, args) = if is_constructor_default {
- (
- quote_ident!("apply"),
- vec![
- ThisExpr { span: DUMMY_SP }.as_arg(),
- quote_ident!("arguments").as_arg(),
- ],
- )
- } else {
- match args {
- Some(mut args) => {
- //
- if args.len() == 1
- && matches!(
- args[0],
- ExprOrSpread {
- spread: Some(..),
- ..
- }
- )
- {
- args[0].spread = None;
- (
- quote_ident!("apply"),
- vec![ThisExpr { span: DUMMY_SP }.as_arg(), args.pop().unwrap()],
- )
- } else {
- (
- quote_ident!("call"),
- iter::once(ThisExpr { span: DUMMY_SP }.as_arg())
- .chain(args)
- .collect(),
- )
- }
- }
- None => (
- quote_ident!("apply"),
- vec![
- ThisExpr { span: DUMMY_SP }.as_arg(),
- quote_ident!("arguments").as_arg(),
- ],
- ),
- }
- };
-
- vec![ThisExpr { span: DUMMY_SP }.as_arg(), {
- let apply = Box::new(Expr::Call(CallExpr {
- span: DUMMY_SP,
- callee: get_prototype_of(Box::new(Expr::Ident(class_name)))
- .make_member(fn_name)
- .as_callee(),
-
- // super(foo, bar) => possibleReturnCheck(this, foo, bar)
- args,
-
- ..Default::default()
- }));
-
- apply.as_arg()
- }]
- }
- },
- ..Default::default()
+ node.visit_mut_children_with(self);
}
- .into()
}
-/// `mark`: Mark for `_this`
-pub(super) fn replace_this_in_constructor(mark: Mark, c: &mut Constructor) -> bool {
- struct Replacer {
- mark: Mark,
- found: bool,
- wrap_with_assertion: bool,
+#[swc_trace]
+impl ConstructorFolder {
+ fn get_this(&mut self) -> &Ident {
+ self.this_ref_count += 1;
+ self.this.get_or_insert_with(|| private_ident!("_this"))
}
- impl VisitMut for Replacer {
- noop_visit_mut_type!(fail);
+ fn transform_super_call(&self, node: &mut Expr) -> bool {
+ let Expr::Call(call_expr) = node else {
+ return false;
+ };
- // let computed keys be visited
- fn visit_mut_constructor(&mut self, _: &mut Constructor) {}
+ let CallExpr {
+ callee: callee @ Callee::Super(..),
+ args: origin_args,
+ ..
+ } = call_expr
+ else {
+ return false;
+ };
- fn visit_mut_function(&mut self, _: &mut Function) {}
+ if self.is_super_callable_constructor {
+ if self.is_constructor_default || is_spread_arguements(origin_args) {
+ *callee = self
+ .class_super_name
+ .clone()
+ .make_member(quote_ident!("apply"))
+ .as_callee();
- fn visit_mut_expr(&mut self, expr: &mut Expr) {
- match expr {
- Expr::This(..) => {
- self.found = true;
- let this = quote_ident!(SyntaxContext::empty().apply_mark(self.mark), "_this");
+ let mut arguments = quote_ident!("arguments");
- if self.wrap_with_assertion {
- *expr = CallExpr {
- span: DUMMY_SP,
- callee: helper!(assert_this_initialized),
- args: vec![this.as_arg()],
- ..Default::default()
- }
- .into()
- } else {
- *expr = this.into();
- }
+ if let Some(e) = origin_args.first() {
+ arguments.span = e.expr.span()
}
- _ => expr.visit_mut_children_with(self),
+ *origin_args = vec![ThisExpr { span: DUMMY_SP }.as_arg(), arguments.as_arg()];
+ } else {
+ *callee = self
+ .class_super_name
+ .clone()
+ .make_member(quote_ident!("call"))
+ .as_callee();
+ origin_args.insert(0, ThisExpr { span: DUMMY_SP }.as_arg());
}
+
+ *node = BinExpr {
+ span: DUMMY_SP,
+ left: Box::new(node.take()),
+ op: op!("||"),
+ right: Box::new(Expr::This(ThisExpr { span: DUMMY_SP })),
+ }
+ .into();
+
+ return true;
}
- fn visit_mut_member_expr(&mut self, expr: &mut MemberExpr) {
- if self.mark != Mark::root() {
- let old = self.wrap_with_assertion;
- self.wrap_with_assertion = false;
- // it's not ExprOrSuper no more, so visit children will ignore this.aaa
- expr.obj.visit_mut_with(self);
- self.wrap_with_assertion = old;
+ *callee = helper!(call_super);
+
+ let mut args = vec![
+ ThisExpr { span: DUMMY_SP }.as_arg(),
+ self.class_name.clone().as_arg(),
+ ];
+
+ if self.is_constructor_default || is_spread_arguements(origin_args) {
+ // super(...arguments)
+ // _call_super(this, _super_class_name, ...arguments)
+
+ let mut arguments = quote_ident!("arguments");
+
+ if let Some(e) = origin_args.first() {
+ arguments.span = e.expr.span()
}
- expr.prop.visit_mut_with(self);
+
+ args.push(arguments.as_arg())
+ } else if !origin_args.is_empty() {
+ // super(a, b)
+ // _call_super(this, _super_class_name, [a, b])
+
+ let array = ArrayLit {
+ elems: origin_args.take().into_iter().map(Some).collect(),
+ ..Default::default()
+ };
+
+ args.push(array.as_arg());
}
+
+ *origin_args = args;
+
+ true
+ }
+}
+
+// ...arguments
+fn is_spread_arguements(args: &[ExprOrSpread]) -> bool {
+ if args.len() != 1 {
+ return false;
}
- let mut v = Replacer {
- found: false,
- mark,
- wrap_with_assertion: true,
- };
- c.visit_mut_children_with(&mut v);
+ let arg = &args[0];
- v.found
+ if arg.spread.is_none() {
+ return false;
+ }
+
+ return arg
+ .expr
+ .as_ident()
+ .filter(|ident| ident.sym == *"arguments")
+ .is_some();
+}
+
+trait SuperLastCall {
+ fn is_super_last_call(&self) -> bool;
+}
+
+impl SuperLastCall for &[Stmt] {
+ fn is_super_last_call(&self) -> bool {
+ self.iter()
+ .rev()
+ .find(|s| !s.is_empty())
+ .map_or(false, |s| s.is_super_last_call())
+ }
+}
+
+impl SuperLastCall for &Stmt {
+ fn is_super_last_call(&self) -> bool {
+ match self {
+ Stmt::Expr(ExprStmt { expr, .. }) => (&**expr).is_super_last_call(),
+ Stmt::Return(ReturnStmt { arg: Some(arg), .. }) => (&**arg).is_super_last_call(),
+ _ => false,
+ }
+ }
+}
+
+impl SuperLastCall for &Expr {
+ fn is_super_last_call(&self) -> bool {
+ match self {
+ Expr::Call(CallExpr {
+ callee: Callee::Super(..),
+ ..
+ }) => true,
+ Expr::Paren(ParenExpr { expr, .. }) => (&**expr).is_super_last_call(),
+ Expr::Seq(SeqExpr { exprs, .. }) => {
+ exprs.last().map_or(false, |e| (&**e).is_super_last_call())
+ }
+ _ => false,
+ }
+ }
}
diff --git a/crates/swc_ecma_compat_es2015/src/classes/mod.rs b/crates/swc_ecma_compat_es2015/src/classes/mod.rs
index 7a2337a0815..b06ef7d3587 100644
--- a/crates/swc_ecma_compat_es2015/src/classes/mod.rs
+++ b/crates/swc_ecma_compat_es2015/src/classes/mod.rs
@@ -10,21 +10,17 @@ use swc_ecma_transforms_base::{helper, native::is_native, perf::Check};
use swc_ecma_transforms_classes::super_field::SuperFieldAccessFolder;
use swc_ecma_transforms_macros::fast_path;
use swc_ecma_utils::{
- alias_if_required, contains_this_expr, default_constructor, is_valid_ident,
- is_valid_prop_ident, prepend_stmt, private_ident, prop_name_to_expr, quote_expr, quote_ident,
- quote_str, replace_ident, ExprFactory, ModuleItemLike, StmtLike,
+ alias_if_required, contains_this_expr, is_valid_ident, is_valid_prop_ident, prepend_stmt,
+ private_ident, prop_name_to_expr, quote_expr, quote_ident, quote_str, replace_ident,
+ ExprFactory, ModuleItemLike, StmtLike,
};
use swc_ecma_visit::{
as_folder, noop_visit_mut_type, noop_visit_type, Fold, Visit, VisitMut, VisitMutWith, VisitWith,
};
use swc_trace_macro::swc_trace;
-use tracing::debug;
use self::{
- constructor::{
- constructor_fn, make_possible_return_value, replace_this_in_constructor, ConstructorFolder,
- ReturningMode, SuperCallFinder, SuperFoldingMode,
- },
+ constructor::fold_constructor,
prop_name::{is_pure_prop_name, should_extract_class_prop_key, HashKey},
};
@@ -538,13 +534,7 @@ where
let mut constructor = None;
for member in class.body {
match member {
- ClassMember::Constructor(c) => {
- if constructor.is_some() {
- unimplemented!("multiple constructor")
- } else {
- constructor = Some(c)
- }
- }
+ ClassMember::Constructor(c) => constructor = Some(c),
ClassMember::Method(m) => methods.push(m),
ClassMember::PrivateMethod(_)
@@ -579,201 +569,10 @@ where
);
}
- let super_var = super_class_ident.as_ref().map(|super_class| {
- let var = private_ident!("_super");
- let mut class_name_sym = class_name.clone();
- class_name_sym.span = DUMMY_SP;
- class_name_sym.ctxt = class_name.ctxt;
-
- if !self.config.super_is_callable_constructor {
- stmts.push(
- VarDecl {
- span: DUMMY_SP,
- kind: VarDeclKind::Var,
- declare: Default::default(),
- decls: vec![VarDeclarator {
- span: DUMMY_SP,
- name: var.clone().into(),
- init: Some(Box::new(Expr::Call(CallExpr {
- span: DUMMY_SP,
- callee: helper!(create_super),
- args: vec![class_name_sym.as_arg()],
- ..Default::default()
- }))),
- definite: Default::default(),
- }],
- ..Default::default()
- }
- .into(),
- );
- var
- } else {
- super_class.clone()
- }
- });
-
- // Marker for `_this`
- let this_mark = Mark::fresh(Mark::root());
-
- {
- // Process constructor
-
- let mut constructor =
- constructor.unwrap_or_else(|| default_constructor(super_class_ident.is_some()));
-
- // Rename variables to avoid conflicting with class name
- // TODO: bring it back once we have a proper private ident
- // constructor.body.visit_mut_with(&mut VarRenamer {
- // mark: Mark::fresh(Mark::root()),
- // class_name: &class_name.sym,
- // });
-
- // Black magic to detect injected constructor.
- let is_constructor_default = constructor.span.is_dummy();
- if is_constructor_default {
- debug!("Dropping constructor parameters because the constructor is injected");
- constructor.params = Vec::new();
- }
-
- let mut insert_this = false;
-
- if super_class_ident.is_some() {
- let inserted_this = replace_this_in_constructor(this_mark, &mut constructor);
-
- insert_this |= inserted_this;
- }
-
- let mut vars = Vec::new();
- let mut body = constructor.body.unwrap().stmts;
- // should we insert `var _this`?
-
- let is_always_initialized = is_always_initialized(&body);
-
- // We should handle branching
- if !is_always_initialized {
- insert_this = true;
- }
-
- // inject possibleReturnCheck
- let found_mode = SuperCallFinder::find(&body);
- let mode = match found_mode {
- None => None,
- _ => {
- if insert_this {
- Some(SuperFoldingMode::Assign)
- } else {
- found_mode
- }
- }
- };
-
- if super_class_ident.is_some() {
- let this = quote_ident!(SyntaxContext::empty().apply_mark(this_mark), "_this");
-
- // We should fold body instead of constructor itself.
- // Handle `super()`
- body.visit_mut_with(&mut ConstructorFolder {
- class_name: &class_name,
- mode: if insert_this {
- Some(SuperFoldingMode::Assign)
- } else {
- mode
- },
- mark: this_mark,
- is_constructor_default,
- super_var,
- ignore_return: false,
- super_is_callable_constructor: self.config.super_is_callable_constructor,
- });
-
- insert_this |= (mode.is_none() && !is_always_initialized)
- || mode == Some(SuperFoldingMode::Assign);
-
- if insert_this {
- vars.push(VarDeclarator {
- span: DUMMY_SP,
- name: this.clone().into(),
- init: None,
- definite: false,
- });
- }
- if !vars.is_empty() {
- prepend_stmt(
- &mut body,
- VarDecl {
- span: DUMMY_SP,
- declare: false,
- kind: VarDeclKind::Var,
- decls: vars,
- ..Default::default()
- }
- .into(),
- );
- }
-
- let is_last_return = matches!(body.last(), Some(Stmt::Return(..)));
- if !is_last_return {
- if is_always_initialized {
- body.push(
- ReturnStmt {
- span: DUMMY_SP,
- arg: Some(this.into()),
- }
- .into(),
- );
- } else {
- let possible_return_value =
- Box::new(make_possible_return_value(ReturningMode::Returning {
- mark: this_mark,
- arg: None,
- }));
- body.push(
- ReturnStmt {
- span: DUMMY_SP,
- arg: Some(possible_return_value),
- }
- .into(),
- );
- }
- }
- }
-
- let is_this_declared = (insert_this && super_class_ident.is_some())
- || (mode == Some(SuperFoldingMode::Var));
-
- // Handle `super.XX`
- body = self.handle_super_access(
- &class_name,
- &super_class_ident,
- body,
- if is_this_declared {
- Some(this_mark)
- } else {
- None
- },
- );
-
- // inject _class_call_check(this, Bar);
- if !self.config.no_class_calls {
- inject_class_call_check(&mut body, class_name.clone());
- }
-
- stmts.push(
- FnDecl {
- ident: class_name.clone(),
- function: constructor_fn(Constructor {
- body: Some(BlockStmt {
- span: DUMMY_SP,
- stmts: body,
- ..Default::default()
- }),
- ..constructor
- }),
- declare: false,
- }
- .into(),
- );
- }
+ // constructor
+ stmts.push(
+ fold_constructor(constructor, &class_name, &super_class_ident, self.config).into(),
+ );
// convert class methods
stmts.extend(self.fold_class_methods(&class_name, &super_class_ident, methods));
@@ -825,70 +624,6 @@ where
stmts
}
- ///
- /// - `this_mark`: `Some(mark)` if we injected `var _this;`; otherwise
- /// `None`
- fn handle_super_access(
- &mut self,
- class_name: &Ident,
- super_class_ident: &Option,
- mut body: Vec,
- this_mark: Option,
- ) -> Vec {
- let mut vars = Vec::new();
- let mut folder = SuperFieldAccessFolder {
- class_name,
- vars: &mut vars,
- constructor_this_mark: this_mark,
- // constructor cannot be static
- is_static: false,
- folding_constructor: true,
- in_nested_scope: false,
- in_injected_define_property_call: false,
- this_alias_mark: None,
- constant_super: self.config.constant_super,
- super_class: super_class_ident,
- in_pat: false,
- };
-
- body.visit_mut_with(&mut folder);
-
- if let Some(mark) = folder.this_alias_mark {
- prepend_stmt(
- &mut body,
- VarDecl {
- span: DUMMY_SP,
- declare: false,
- kind: VarDeclKind::Var,
- decls: vec![VarDeclarator {
- span: DUMMY_SP,
- name: quote_ident!(SyntaxContext::empty().apply_mark(mark), "_this").into(),
- init: Some(Box::new(Expr::This(ThisExpr { span: DUMMY_SP }))),
- definite: false,
- }],
- ..Default::default()
- }
- .into(),
- );
- }
-
- if !vars.is_empty() {
- prepend_stmt(
- &mut body,
- VarDecl {
- span: DUMMY_SP,
- kind: VarDeclKind::Var,
- declare: false,
- decls: vars,
- ..Default::default()
- }
- .into(),
- );
- }
-
- body
- }
-
fn fold_class_methods(
&mut self,
class_name: &Ident,
@@ -1038,10 +773,9 @@ where
&mut props
};
- let mut vars = Vec::new();
let mut folder = SuperFieldAccessFolder {
class_name,
- vars: &mut vars,
+
constructor_this_mark: None,
is_static: m.is_static,
folding_constructor: false,
@@ -1074,20 +808,6 @@ where
);
}
- if !vars.is_empty() {
- prepend_stmt(
- &mut m.function.body.as_mut().unwrap().stmts,
- VarDecl {
- span: DUMMY_SP,
- kind: VarDeclKind::Var,
- declare: false,
- decls: vars,
- ..Default::default()
- }
- .into(),
- );
- }
-
let value = FnExpr {
ident: if m.kind == MethodKind::Method && !computed {
match prop_name {
diff --git a/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_189.js b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_189.js
index ec5b2d467bd..0265fadc41b 100644
--- a/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_189.js
+++ b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_189.js
@@ -1,10 +1,9 @@
var HomePage = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(HomePage, _React_Component);
- var _super = _create_super(HomePage);
function HomePage() {
_class_call_check(this, HomePage);
- return _super.apply(this, arguments);
+ return _call_super(this, HomePage, arguments);
}
return HomePage;
}(React.Component);
diff --git a/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_400_1.js b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_400_1.js
index c31ecbeaf24..4db60dc5490 100644
--- a/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_400_1.js
+++ b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_400_1.js
@@ -17,11 +17,10 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B(num) {
_class_call_check(this, B);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, B);
_this.b_num = num;
return _this;
}
diff --git a/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs b/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs
index b815b66500f..ca937fd8f39 100644
--- a/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs
+++ b/crates/swc_ecma_compat_es2022/src/class_properties/mod.rs
@@ -668,7 +668,6 @@ impl ClassProperties {
value.visit_mut_with(&mut SuperFieldAccessFolder {
class_name: &class_ident,
- vars: &mut vars,
constructor_this_mark: None,
is_static: true,
folding_constructor: false,
@@ -711,7 +710,6 @@ impl ClassProperties {
if prop.is_static {
value.visit_mut_with(&mut SuperFieldAccessFolder {
class_name: &class_ident,
- vars: &mut vars,
constructor_this_mark: None,
is_static: true,
folding_constructor: false,
@@ -941,7 +939,6 @@ impl ClassProperties {
method.function.visit_mut_with(&mut SuperFieldAccessFolder {
class_name: &class_ident,
- vars: &mut vars,
constructor_this_mark: None,
is_static,
folding_constructor: false,
diff --git a/crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_modules_3.js b/crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_modules_3.js
index 0532ca00641..75954b50cfe 100644
--- a/crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_modules_3.js
+++ b/crates/swc_ecma_transforms/tests/__swc_snapshots__/tests/es2015_function_name.rs/function_name_modules_3.js
@@ -12,10 +12,9 @@ var _store = require("./store");
let Login = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(Login, _React_Component);
- var _super = _create_super(Login);
function Login() {
_class_call_check(this, Login);
- return _super.apply(this, arguments);
+ return _call_super(this, Login, arguments);
}
_create_class(Login, [
{
diff --git a/crates/swc_ecma_transforms_base/src/helpers/_call_super.js b/crates/swc_ecma_transforms_base/src/helpers/_call_super.js
new file mode 100644
index 00000000000..9ff48ed016c
--- /dev/null
+++ b/crates/swc_ecma_transforms_base/src/helpers/_call_super.js
@@ -0,0 +1,11 @@
+function _call_super(_this, derived, args) {
+ // Super
+ derived = _get_prototype_of(derived);
+ return _possible_constructor_return(
+ _this,
+ _is_native_reflect_construct()
+ // NOTE: This doesn't work if this.__proto__.constructor has been modified.
+ ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor)
+ : derived.apply(_this, args)
+ );
+}
diff --git a/crates/swc_ecma_transforms_base/src/helpers/_is_native_reflect_construct.js b/crates/swc_ecma_transforms_base/src/helpers/_is_native_reflect_construct.js
index 746831c3d44..74d2cdc0d7d 100644
--- a/crates/swc_ecma_transforms_base/src/helpers/_is_native_reflect_construct.js
+++ b/crates/swc_ecma_transforms_base/src/helpers/_is_native_reflect_construct.js
@@ -1,11 +1,14 @@
function _is_native_reflect_construct() {
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
- if (Reflect.construct.sham) return false;
- if (typeof Proxy === "function") return true;
+ // Since Reflect.construct can't be properly polyfilled, some
+ // implementations (e.g. core-js@2) don't set the correct internal slots.
+ // Those polyfills don't allow us to subclass built-ins, so we need to
+ // use our fallback implementation.
try {
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
- return true;
- } catch (e) {
- return false;
- }
+ // If the internal slots aren't set, this throws an error similar to
+ // TypeError: this is not a Boolean object.
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
+ } catch (_) {}
+ return (_is_native_reflect_construct = function() {
+ return !!result;
+ })();
}
diff --git a/crates/swc_ecma_transforms_base/src/helpers/mod.rs b/crates/swc_ecma_transforms_base/src/helpers/mod.rs
index 7720369d2ea..89b1b267a85 100644
--- a/crates/swc_ecma_transforms_base/src/helpers/mod.rs
+++ b/crates/swc_ecma_transforms_base/src/helpers/mod.rs
@@ -262,6 +262,11 @@ define_helpers!(Helpers {
async_to_generator: (),
await_async_generator: (await_value),
await_value: (),
+ call_super: (
+ get_prototype_of,
+ is_native_reflect_construct,
+ possible_constructor_return
+ ),
check_private_redeclaration: (),
class_apply_descriptor_destructure: (),
class_apply_descriptor_get: (),
diff --git a/crates/swc_ecma_transforms_classes/src/super_field.rs b/crates/swc_ecma_transforms_classes/src/super_field.rs
index 2b0311b6a56..abbe7ad5f28 100644
--- a/crates/swc_ecma_transforms_classes/src/super_field.rs
+++ b/crates/swc_ecma_transforms_classes/src/super_field.rs
@@ -24,7 +24,6 @@ use super::get_prototype_of;
pub struct SuperFieldAccessFolder<'a> {
pub class_name: &'a Ident,
- pub vars: &'a mut Vec,
/// Mark for the `_this`. Used only when folding constructor.
pub constructor_this_mark: Option,
pub is_static: bool,
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_call.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_call.js
index 2662137688c..939e01be069 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_call.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_call.js
@@ -1,10 +1,10 @@
let Test = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Test, Foo);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, Test);
Foo.prototype.test.whatever();
Foo.prototype.test.call(_assert_this_initialized(_this));
return _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_class.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_class.js
index 76a30c7055b..8564792420a 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_class.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_class.js
@@ -1,15 +1,17 @@
let Test = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Test, Foo);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
var _this;
woops.super.test();
- _this = _super.call(this);
+ _this = _call_super(this, Test);
Foo.prototype.test.call(_assert_this_initialized(_this));
- _this = _super.call(this, ...arguments);
- _this = _super.call(this, "test", ...arguments);
+ _this = _call_super(this, Test, arguments);
+ _this = _call_super(this, Test, [
+ "test",
+ ...arguments
+ ]);
Foo.prototype.test.apply(_assert_this_initialized(_this), arguments);
Foo.prototype.test.call(_assert_this_initialized(_this), "test", ...arguments);
return _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_property.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_property.js
index 18262feab08..80d51d2bf0a 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_property.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_property.js
@@ -1,10 +1,10 @@
let Test = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Test, Foo);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, Test);
Foo.prototype.test;
Foo.prototype.test.whatever;
return _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_update.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_update.js
index 9497d326f66..942b654dab1 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_update.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constant_super_update.js
@@ -1,7 +1,6 @@
let A = /*#__PURE__*/ function(B) {
"use strict";
_inherits(A, B);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
var _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constructor_super_update.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constructor_super_update.js
index 6f1374fbee1..345d53a4add 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constructor_super_update.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/constructor_super_update.js
@@ -1,7 +1,6 @@
let A = /*#__PURE__*/ function(B) {
"use strict";
_inherits(A, B);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
var _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_native.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_native.js
index 55256578a3d..63d2a32530a 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_native.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_native.js
@@ -1,10 +1,9 @@
let List = /*#__PURE__*/ function(Array) {
"use strict";
_inherits(List, Array);
- var _super = _create_super(List);
function List() {
_class_call_check(this, List);
- return _super.apply(this, arguments);
+ return _call_super(this, List, arguments);
}
return List;
}(_wrap_native_super(Array));
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_singleton.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_singleton.js
index 941c5bf3c1c..66ead87b800 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_singleton.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/custom_singleton.js
@@ -2,15 +2,14 @@ let singleton;
let Sub = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Sub, Foo);
- var _super = _create_super(Sub);
function Sub() {
_class_call_check(this, Sub);
var _this;
if (singleton) {
return _possible_constructor_return(_this, singleton);
}
- singleton = _this = _super.call(this);
- return _possible_constructor_return(_this);
+ singleton = _this = _call_super(this, Sub);
+ return _this;
}
return Sub;
}(Foo);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/duplicate_ident.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/duplicate_ident.js
index 0353c94677e..a8265b95161 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/duplicate_ident.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/duplicate_ident.js
@@ -1,13 +1,11 @@
let Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- var _this;
var Foo1 = 123;
console.log(Foo1);
- return _possible_constructor_return(_this);
+ return _possible_constructor_return(void 0);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_data_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_data_defined_on_parent.js
index de619df7217..af5dc53a7fd 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_data_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_data_defined_on_parent.js
@@ -22,10 +22,9 @@ let Base = /*#__PURE__*/ function() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_getter_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_getter_defined_on_parent.js
index 57371805d8a..3ac33a0a345 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_getter_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_getter_defined_on_parent.js
@@ -25,10 +25,9 @@ let Base = /*#__PURE__*/ function() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_not_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_not_defined_on_parent.js
index 029c5fbbfc1..f8347e6c622 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_not_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_not_defined_on_parent.js
@@ -5,10 +5,9 @@ let Base = function Base() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_setter_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_setter_defined_on_parent.js
index 40f968eb9b4..ade1c034b75 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_setter_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_call_semantics_setter_defined_on_parent.js
@@ -16,10 +16,9 @@ let Base = /*#__PURE__*/ function() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_data_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_data_defined_on_parent.js
index e5e2425c835..ec4ccc5992c 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_data_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_data_defined_on_parent.js
@@ -6,10 +6,9 @@ Base.prototype.test = 1;
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_getter_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_getter_defined_on_parent.js
index 78ac5bbf7c8..5904bd4aa86 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_getter_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_getter_defined_on_parent.js
@@ -17,10 +17,9 @@ let Base = /*#__PURE__*/ function() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_not_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_not_defined_on_parent.js
index 982aaac11b7..b6c048b937c 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_not_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_not_defined_on_parent.js
@@ -5,10 +5,9 @@ let Base = function Base() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_setter_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_setter_defined_on_parent.js
index 7ef79a1ac1f..999a96b2bf0 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_setter_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_get_semantics_setter_defined_on_parent.js
@@ -16,10 +16,9 @@ let Base = /*#__PURE__*/ function() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_assign.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_assign.js
index cc8720ac2ea..18bfd232b90 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_assign.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_assign.js
@@ -21,10 +21,9 @@ const proper = {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_update.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_update.js
index 1ccc3ace846..81009115dfd 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_update.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_memoized_update.js
@@ -21,10 +21,9 @@ const proper = {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_data_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_data_defined_on_parent.js
index da3c89c5194..71cf87254e7 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_data_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_data_defined_on_parent.js
@@ -10,10 +10,9 @@ Object.defineProperty(Base.prototype, 'test', {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_getter_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_getter_defined_on_parent.js
index e85f5ff2716..4f6339504c9 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_getter_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_getter_defined_on_parent.js
@@ -17,10 +17,9 @@ let Base = /*#__PURE__*/ function() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_data_on_obj.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_data_on_obj.js
index 16dee1ed7dc..8d0598c9100 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_data_on_obj.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_data_on_obj.js
@@ -5,10 +5,9 @@ let Base = function Base() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_getter_on_obj.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_getter_on_obj.js
index 86b29e30d3c..38923d8727d 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_getter_on_obj.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_getter_on_obj.js
@@ -5,10 +5,9 @@ let Base = function Base() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_not_on_obj.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_not_on_obj.js
index 879e3ccdf43..23e6ba323db 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_not_on_obj.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_not_on_obj.js
@@ -5,10 +5,9 @@ let Base = function Base() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_setter_on_obj.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_setter_on_obj.js
index 4b82d73f6b4..ab7dd6f8c95 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_setter_on_obj.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_not_defined_on_parent_setter_on_obj.js
@@ -6,10 +6,9 @@ let value = 2;
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_setter_defined_on_parent.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_setter_defined_on_parent.js
index d8e9207a61c..6f874c83ae0 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_setter_defined_on_parent.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/get_set_set_semantics_setter_defined_on_parent.js
@@ -17,10 +17,9 @@ let Base = /*#__PURE__*/ function() {
let Obj = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Obj, Base);
- var _super = _create_super(Obj);
function Obj() {
_class_call_check(this, Obj);
- return _super.apply(this, arguments);
+ return _call_super(this, Obj, arguments);
}
_create_class(Obj, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_1.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_1.js
index ff2381832b5..d81fa77946b 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_1.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_1.js
@@ -1,10 +1,9 @@
let ColouredCanvasElement = /*#__PURE__*/ function(CanvasElement) {
"use strict";
_inherits(ColouredCanvasElement, CanvasElement);
- var _super = _create_super(ColouredCanvasElement);
function ColouredCanvasElement() {
_class_call_check(this, ColouredCanvasElement);
- return _super.apply(this, arguments);
+ return _call_super(this, ColouredCanvasElement, arguments);
}
_create_class(ColouredCanvasElement, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_2.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_2.js
index 650ad035b63..bbb4cc62def 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_2.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1490_2.js
@@ -1,10 +1,9 @@
let ColouredCanvasElement = /*#__PURE__*/ function(CanvasElement) {
"use strict";
_inherits(ColouredCanvasElement, CanvasElement);
- var _super = _create_super(ColouredCanvasElement);
function ColouredCanvasElement() {
_class_call_check(this, ColouredCanvasElement);
- return _super.apply(this, arguments);
+ return _call_super(this, ColouredCanvasElement, arguments);
}
_create_class(ColouredCanvasElement, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_1.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_1.js
index 8f8968f7d56..437dfbca155 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_1.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_1.js
@@ -1,10 +1,9 @@
let A = /*#__PURE__*/ function(B) {
"use strict";
_inherits(A, B);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
- return _super.apply(this, arguments);
+ return _call_super(this, A, arguments);
}
_create_class(A, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_2.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_2.js
index 62a487f8266..7654a4c58e7 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_2.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1617_2.js
@@ -1,10 +1,9 @@
let A = /*#__PURE__*/ function(B) {
"use strict";
_inherits(A, B);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
- return _super.apply(this, arguments);
+ return _call_super(this, A, arguments);
}
_create_class(A, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_189.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_189.js
index ef81f04b88c..ba9b90047c8 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_189.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_189.js
@@ -1,10 +1,9 @@
let HomePage = /*#__PURE__*/ function(_React_Component) {
"use strict";
_inherits(HomePage, _React_Component);
- var _super = _create_super(HomePage);
function HomePage() {
_class_call_check(this, HomePage);
- return _super.apply(this, arguments);
+ return _call_super(this, HomePage, arguments);
}
return HomePage;
}(React.Component);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_1.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_1.js
index 8171525c484..2539c3d4e08 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_1.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_1.js
@@ -1,10 +1,9 @@
var Extended = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Extended, Base1);
- var _super = _create_super(Extended);
function Extended() {
_class_call_check(this, Extended);
- return _super.apply(this, arguments);
+ return _call_super(this, Extended, arguments);
}
_create_class(Extended, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_2.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_2.js
index 0f2025bba1e..cdd2c321cd2 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_2.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_1959_2.js
@@ -1,10 +1,9 @@
var Extended = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Extended, Base1);
- var _super = _create_super(Extended);
function Extended() {
_class_call_check(this, Extended);
- return _super.apply(this, arguments);
+ return _call_super(this, Extended, arguments);
}
_create_class(Extended, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup.js
index dbc56fb8c56..d133f10ee3e 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup.js
@@ -2,10 +2,9 @@ if (true) {
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- return _super.apply(this, arguments);
+ return _call_super(this, Foo, arguments);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup_2.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup_2.js
index 1e6509a7c18..e847caaccbb 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup_2.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/issue_454_followup_2.js
@@ -3,10 +3,9 @@ function broken(x, ...foo) {
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- return _super.apply(this, arguments);
+ return _call_super(this, Foo, arguments);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/nested_this_in_key.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/nested_this_in_key.js
index ab17664b890..097e2e1899b 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/nested_this_in_key.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/nested_this_in_key.js
@@ -1,7 +1,6 @@
let Outer = /*#__PURE__*/ function(B) {
"use strict";
_inherits(Outer, B);
- var _super = _create_super(Outer);
function Outer() {
_class_call_check(this, Outer);
var _this;
@@ -23,6 +22,7 @@ let Outer = /*#__PURE__*/ function(B) {
return this;
}
return _possible_constructor_return(_this, new Inner());
+ return _possible_constructor_return(_this);
}
return Outer;
}(B);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/no_class_call_super.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/no_class_call_super.js
index 295ffcad2c1..378daabea50 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/no_class_call_super.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/no_class_call_super.js
@@ -4,11 +4,12 @@ let B = function B() {
let A = /*#__PURE__*/ function(B) {
"use strict";
_inherits(A, B);
- var _super = _create_super(A);
function A(track) {
var _this;
- if (track !== undefined) _this = _super.call(this, track);
- else _this = _super.call(this);
+ if (track !== undefined) _this = _call_super(this, A, [
+ track
+ ]);
+ else _this = _call_super(this, A);
return _possible_constructor_return(_this);
}
return A;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/prefix_super_update.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/prefix_super_update.js
index 738ce34f281..421a7d9ce54 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/prefix_super_update.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/prefix_super_update.js
@@ -1,10 +1,9 @@
let A = /*#__PURE__*/ function(B) {
"use strict";
_inherits(A, B);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
- return _super.apply(this, arguments);
+ return _call_super(this, A, arguments);
}
_create_class(A, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5769.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5769.js
index 0fc67a5f718..776909c699b 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5769.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5769.js
@@ -16,11 +16,10 @@ let Point = /*#__PURE__*/ function() {
let ColorPoint = /*#__PURE__*/ function(Point) {
"use strict";
_inherits(ColorPoint, Point);
- var _super = _create_super(ColorPoint);
function ColorPoint() {
_class_call_check(this, ColorPoint);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, ColorPoint);
_this.x = 2;
_set((_assert_this_initialized(_this), _get_prototype_of(ColorPoint.prototype)), "x", 3, _this, true);
expect(_this.x).toBe(3); // A
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5817.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5817.js
index 3cbddf17ee9..77933d1c5dc 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5817.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_5817.js
@@ -1,11 +1,10 @@
let A = /*#__PURE__*/ function(B) {
"use strict";
_inherits(A, B);
- var _super = _create_super(A);
function A() {
_class_call_check(this, A);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, A);
_this.arrow1 = function(x) {
return x;
};
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_8499.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_8499.js
index 50a018d7f3d..7c74b077cc3 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_8499.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_8499.js
@@ -9,10 +9,9 @@ var constructor;
let CustomElement = /*#__PURE__*/ function(HTMLElement) {
"use strict";
_inherits(CustomElement, HTMLElement);
- var _super = _create_super(CustomElement);
function CustomElement() {
_class_call_check(this, CustomElement);
- return _super.apply(this, arguments);
+ return _call_super(this, CustomElement, arguments);
}
return CustomElement;
}(_wrap_native_super(HTMLElement));
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2494.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2494.js
index aad3e4a9c54..87fe8478c84 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2494.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2494.js
@@ -2,10 +2,9 @@ var x = {
Foo: /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Foo1, Foo);
- var _super = _create_super(Foo1);
function Foo1() {
_class_call_check(this, Foo1);
- return _super.apply(this, arguments);
+ return _call_super(this, Foo1, arguments);
}
return Foo1;
}(Foo)
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2997.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2997.js
index 9e7123006c6..e24e74de2e9 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2997.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/regression_t2997.js
@@ -5,11 +5,10 @@ let A = function A() {
let B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
var _this;
- return _possible_constructor_return(_this, _this = _super.call(this));
+ return _possible_constructor_return(_this, _this = _call_super(this, B));
}
return B;
}(A);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/set_method_getter_setter.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/set_method_getter_setter.js
index a3e8daab3e8..6ad67aacaec 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/set_method_getter_setter.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/set_method_getter_setter.js
@@ -1,10 +1,9 @@
let Test = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Test, Foo);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- return _super.apply(this, arguments);
+ return _call_super(this, Test, arguments);
}
_create_class(Test, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_accessing_super_properties.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_accessing_super_properties.js
index a128e7e3b46..67032c1f817 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_accessing_super_properties.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_accessing_super_properties.js
@@ -1,10 +1,10 @@
var Test = /*#__PURE__*/ function(Foo1) {
"use strict";
_inherits(Test, Foo1);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, Test);
_get((_assert_this_initialized(_this), _get_prototype_of(Test.prototype)), "test", _this);
_get((_assert_this_initialized(_this), _get_prototype_of(Test.prototype)), "test", _this).whatever;
return _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_calling_super_properties.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_calling_super_properties.js
index acb62f0f4dc..2d27c7b50e1 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_calling_super_properties.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_calling_super_properties.js
@@ -1,10 +1,10 @@
var Test = /*#__PURE__*/ function(Foo1) {
"use strict";
_inherits(Test, Foo1);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, Test);
_get((_assert_this_initialized(_this), _get_prototype_of(Test.prototype)), "test", _this).whatever();
_get((_assert_this_initialized(_this), _get_prototype_of(Test.prototype)), "test", _this).call(_this);
return _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_constructor.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_constructor.js
index 8b2fdb65734..37c8427efe6 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_constructor.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_constructor.js
@@ -6,11 +6,10 @@ var Test = function Test() {
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _this = _super.call(this);
+ _this = _call_super(this, Foo);
_this.state = "test";
return _this;
}
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_delay_arrow_function_for_bare_super_derived.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_delay_arrow_function_for_bare_super_derived.js
index 2b6bad61ec5..6d25eb8a98c 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_delay_arrow_function_for_bare_super_derived.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_delay_arrow_function_for_bare_super_derived.js
@@ -1,14 +1,14 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _this = _super.call(this, ()=>{
- _this.test;
- });
- return _this;
+ return _this = _call_super(this, Foo, [
+ ()=>{
+ _assert_this_initialized(_this).test;
+ }
+ ]);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super.js
index 04ea40286b7..e556e2b9229 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super.js
@@ -1,11 +1,9 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- var _this;
- return _possible_constructor_return(_this);
+ return _possible_constructor_return(void 0);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_2.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_2.js
index 07c089f0749..cfe2ab1bd26 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_2.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_2.js
@@ -1,11 +1,10 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- if (eval("false")) _this = _super.call(this);
+ if (eval("false")) _this = _call_super(this, Foo);
return _possible_constructor_return(_this);
}
return Foo;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_3.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_3.js
index c670e4c2f64..82ba45e05cf 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_3.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_3.js
@@ -1,11 +1,10 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- var fn = ()=>_this = _super.call(this);
+ var fn = ()=>_this = _call_super(this, Foo);
fn();
return _possible_constructor_return(_this);
}
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_4.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_4.js
index 71f7f94b578..56db03fcf4a 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_4.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_must_call_super_4.js
@@ -1,11 +1,10 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- var fn = ()=>_this = _super.call(this);
+ var fn = ()=>_this = _call_super(this, Foo);
return _possible_constructor_return(_this);
}
return Foo;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_falsey.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_falsey.js
index 422945cb5a2..cadb4cb4f2b 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_falsey.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_falsey.js
@@ -1,11 +1,11 @@
var Child = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Child, Base1);
- var _super = _create_super(Child);
function Child() {
_class_call_check(this, Child);
var _this;
return _possible_constructor_return(_this, false);
+ return _possible_constructor_return(_this);
}
return Child;
}(Base);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_object.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_object.js
index e1c6109d306..a3db0929a71 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_object.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_derived_constructor_no_super_return_object.js
@@ -1,11 +1,11 @@
var Child = /*#__PURE__*/ function(Base1) {
"use strict";
_inherits(Child, Base1);
- var _super = _create_super(Child);
function Child() {
_class_call_check(this, Child);
var _this;
return _possible_constructor_return(_this, {});
+ return _possible_constructor_return(_this);
}
return Child;
}(Base);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_export_super_class.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_export_super_class.js
index c82a2012483..8be002a5343 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_export_super_class.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_export_super_class.js
@@ -1,10 +1,9 @@
var _default = /*#__PURE__*/ function(A1) {
"use strict";
_inherits(_default, A1);
- var _super = _create_super(_default);
function _default() {
_class_call_check(this, _default);
- return _super.apply(this, arguments);
+ return _call_super(this, _default, arguments);
}
return _default;
}(A);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_call_in_key.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_call_in_key.js
index a808b623cab..851733c0b24 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_call_in_key.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_call_in_key.js
@@ -10,18 +10,17 @@ var Hello = function Hello() {
var Outer = /*#__PURE__*/ function(Hello) {
"use strict";
_inherits(Outer, Hello);
- var _super = _create_super(Outer);
function Outer() {
_class_call_check(this, Outer);
- var _this = this;
- var _this1;
+ var _this;
+ _this = _call_super(this, Outer);
var Inner = /*#__PURE__*/ function() {
function Inner() {
_class_call_check(this, Inner);
}
_create_class(Inner, [
{
- key: _this1 = _super.call(_this),
+ key: _this,
value: function() {
return 'hello';
}
@@ -29,7 +28,8 @@ var Outer = /*#__PURE__*/ function(Hello) {
]);
return Inner;
}();
- return _possible_constructor_return(_this1, new Inner());
+ return _possible_constructor_return(_this, new Inner());
+ return _this;
}
return Outer;
}(Hello);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_property_in_key.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_property_in_key.js
index 0450b85f430..b47df8ae3ce 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_property_in_key.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_class_super_property_in_key.js
@@ -16,10 +16,10 @@ var Hello = /*#__PURE__*/ function() {
var Outer = /*#__PURE__*/ function(Hello) {
"use strict";
_inherits(Outer, Hello);
- var _super = _create_super(Outer);
function Outer() {
_class_call_check(this, Outer);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, Outer);
var Inner = /*#__PURE__*/ function() {
function Inner() {
_class_call_check(this, Inner);
@@ -35,6 +35,7 @@ var Outer = /*#__PURE__*/ function(Hello) {
return Inner;
}();
return _possible_constructor_return(_this, new Inner());
+ return _this;
}
return Outer;
}(Hello);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_call_in_key.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_call_in_key.js
index fc846744248..096cf324df8 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_call_in_key.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_call_in_key.js
@@ -10,16 +10,16 @@ var Hello = function Hello() {
var Outer = /*#__PURE__*/ function(Hello) {
"use strict";
_inherits(Outer, Hello);
- var _super = _create_super(Outer);
function Outer() {
_class_call_check(this, Outer);
var _this;
var Inner = {
- [_this = _super.call(this)] () {
+ [_this = _call_super(this, Outer)] () {
return 'hello';
}
};
return _possible_constructor_return(_this, Inner);
+ return _this;
}
return Outer;
}(Hello);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_property_in_key.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_property_in_key.js
index fe54e419e7a..736c05b3eaa 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_property_in_key.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_nested_object_super_property_in_key.js
@@ -16,16 +16,17 @@ var Hello = /*#__PURE__*/ function() {
var Outer = /*#__PURE__*/ function(Hello) {
"use strict";
_inherits(Outer, Hello);
- var _super = _create_super(Outer);
function Outer() {
_class_call_check(this, Outer);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, Outer);
var Inner = {
[_get((_assert_this_initialized(_this), _get_prototype_of(Outer.prototype)), "toString", _this).call(_this)] () {
return 'hello';
}
};
return _possible_constructor_return(_this, Inner);
+ return _this;
}
return Outer;
}(Hello);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_preserves_directives.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_preserves_directives.js
index 9ccf8168904..86eab6719b3 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_preserves_directives.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_preserves_directives.js
@@ -1,20 +1,20 @@
var MyCtrl = function MyCtrl(a) {
- "any directive prologue";
"use strict";
_class_call_check(this, MyCtrl);
+ "any directive prologue";
foo;
};
var MyCtrl2 = function MyCtrl2(a) {
- "a";
- "b";
"use strict";
_class_call_check(this, MyCtrl2);
+ "a";
+ "b";
foo;
};
var MyCtrl3 = function MyCtrl3(a) {
- "a";
"use strict";
_class_call_check(this, MyCtrl3);
+ "a";
foo;
"b";
};
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class.js
index 4c0df09544f..d1ea7b62829 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class.js
@@ -1,10 +1,9 @@
var Test = /*#__PURE__*/ function(Foo1) {
"use strict";
_inherits(Test, Foo1);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- return _super.apply(this, arguments);
+ return _call_super(this, Test, arguments);
}
return Test;
}(Foo);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_anonymous.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_anonymous.js
index 01291b3afd4..924d6a8df32 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_anonymous.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_anonymous.js
@@ -1,10 +1,9 @@
var TestEmpty = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(TestEmpty, _superClass);
- var _super = _create_super(TestEmpty);
function TestEmpty() {
_class_call_check(this, TestEmpty);
- return _super.apply(this, arguments);
+ return _call_super(this, TestEmpty, arguments);
}
return TestEmpty;
}(function _class() {
@@ -14,10 +13,9 @@ var TestEmpty = /*#__PURE__*/ function(_superClass) {
var TestConstructorOnly = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(TestConstructorOnly, _superClass);
- var _super = _create_super(TestConstructorOnly);
function TestConstructorOnly() {
_class_call_check(this, TestConstructorOnly);
- return _super.apply(this, arguments);
+ return _call_super(this, TestConstructorOnly, arguments);
}
return TestConstructorOnly;
}(function _class() {
@@ -27,10 +25,9 @@ var TestConstructorOnly = /*#__PURE__*/ function(_superClass) {
var TestMethodOnly = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(TestMethodOnly, _superClass);
- var _super = _create_super(TestMethodOnly);
function TestMethodOnly() {
_class_call_check(this, TestMethodOnly);
- return _super.apply(this, arguments);
+ return _call_super(this, TestMethodOnly, arguments);
}
return TestMethodOnly;
}(/*#__PURE__*/ function() {
@@ -49,10 +46,9 @@ var TestMethodOnly = /*#__PURE__*/ function(_superClass) {
var TestConstructorAndMethod = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(TestConstructorAndMethod, _superClass);
- var _super = _create_super(TestConstructorAndMethod);
function TestConstructorAndMethod() {
_class_call_check(this, TestConstructorAndMethod);
- return _super.apply(this, arguments);
+ return _call_super(this, TestConstructorAndMethod, arguments);
}
return TestConstructorAndMethod;
}(/*#__PURE__*/ function() {
@@ -71,10 +67,9 @@ var TestConstructorAndMethod = /*#__PURE__*/ function(_superClass) {
var TestMultipleMethods = /*#__PURE__*/ function(_superClass) {
"use strict";
_inherits(TestMultipleMethods, _superClass);
- var _super = _create_super(TestMultipleMethods);
function TestMultipleMethods() {
_class_call_check(this, TestMultipleMethods);
- return _super.apply(this, arguments);
+ return _call_super(this, TestMultipleMethods, arguments);
}
return TestMultipleMethods;
}(/*#__PURE__*/ function() {
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_id_member_expression.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_id_member_expression.js
index e6b7c50620d..b2f5dc994a9 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_id_member_expression.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_class_id_member_expression.js
@@ -1,20 +1,18 @@
var BaseController = /*#__PURE__*/ function(_Chaplin_Controller) {
"use strict";
_inherits(BaseController, _Chaplin_Controller);
- var _super = _create_super(BaseController);
function BaseController() {
_class_call_check(this, BaseController);
- return _super.apply(this, arguments);
+ return _call_super(this, BaseController, arguments);
}
return BaseController;
}(Chaplin.Controller);
var BaseController2 = /*#__PURE__*/ function(_Chaplin_Controller_Another) {
"use strict";
_inherits(BaseController2, _Chaplin_Controller_Another);
- var _super = _create_super(BaseController2);
function BaseController2() {
_class_call_check(this, BaseController2);
- return _super.apply(this, arguments);
+ return _call_super(this, BaseController2, arguments);
}
return BaseController2;
}(Chaplin.Controller.Another);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_reference_in_prop_exression.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_reference_in_prop_exression.js
index 7b8d3829bb1..b4fee49bfca 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_reference_in_prop_exression.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_super_reference_in_prop_exression.js
@@ -1,12 +1,11 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _get((_assert_this_initialized(_this), _get_prototype_of(Foo.prototype)), (_this = _super.call(this)).method, _this).call(_this);
- return _possible_constructor_return(_this);
+ _get((_assert_this_initialized(_this), _get_prototype_of(Foo.prototype)), (_this = _call_super(this, Foo)).method, _this).call(_this);
+ return _this;
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes.js
index fcfc5b63bf8..586b785711a 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes.js
@@ -1,13 +1,11 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _this.foo = "bar";
- _this = _super.call(this);
- return _this;
+ _assert_this_initialized(_this).foo = "bar";
+ return _this = _call_super(this, Foo);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_2.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_2.js
index 00207c63c7e..202f9017d3a 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_2.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_2.js
@@ -1,12 +1,12 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _this = _super.call(this, _assert_this_initialized(_this));
- return _this;
+ return _this = _call_super(this, Foo, [
+ _assert_this_initialized(_this)
+ ]);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_3.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_3.js
index 8a1599e65d4..d74ce9c1380 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_3.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_3.js
@@ -1,14 +1,12 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
var fn = ()=>_assert_this_initialized(_this);
fn();
- _this = _super.call(this);
- return _this;
+ return _this = _call_super(this, Foo);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_4.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_4.js
index 391e7ce8aa8..46f48e8d544 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_4.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_4.js
@@ -1,12 +1,11 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
var fn = ()=>_assert_this_initialized(_this);
- _this = _super.call(this);
+ _this = _call_super(this, Foo);
fn();
return _this;
}
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_5.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_5.js
index 640b6ad3f7d..56591a4325d 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_5.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/spec_this_not_allowed_before_super_in_derived_classes_5.js
@@ -1,7 +1,6 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_binding.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_binding.js
index ef56da53d85..ac1429230f2 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_binding.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_binding.js
@@ -5,10 +5,9 @@ let Foo = function Foo() {
let Test = /*#__PURE__*/ function(Foo1) {
"use strict";
_inherits(Test, Foo1);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- return _super.apply(this, arguments);
+ return _call_super(this, Test, arguments);
}
_create_class(Test, [
{
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable.js
index ec22466b1ed..89603996205 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable.js
@@ -3,7 +3,7 @@ let BaseController = /*#__PURE__*/ function(_Chaplin_Controller) {
_inherits(BaseController, _Chaplin_Controller);
function BaseController() {
_class_call_check(this, BaseController);
- return _Chaplin_Controller.apply(this, arguments);
+ return _Chaplin_Controller.apply(this, arguments) || this;
}
return BaseController;
}(Chaplin.Controller);
@@ -12,7 +12,7 @@ let BaseController2 = /*#__PURE__*/ function(_Chaplin_Controller_Another) {
_inherits(BaseController2, _Chaplin_Controller_Another);
function BaseController2() {
_class_call_check(this, BaseController2);
- return _Chaplin_Controller_Another.apply(this, arguments);
+ return _Chaplin_Controller_Another.apply(this, arguments) || this;
}
return BaseController2;
}(Chaplin.Controller.Another);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable_super.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable_super.js
index 96878932ed4..ff98031a330 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable_super.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_classes.rs/super_callable_super.js
@@ -3,7 +3,7 @@ let Test = /*#__PURE__*/ function(Foo) {
_inherits(Test, Foo);
function Test() {
_class_call_check(this, Test);
- return Foo.apply(this, arguments);
+ return Foo.apply(this, arguments) || this;
}
return Test;
}(Foo);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_new_target.rs/issue_6259.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_new_target.rs/issue_6259.js
index 599bb8b5dbb..404357b889a 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_new_target.rs/issue_6259.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_new_target.rs/issue_6259.js
@@ -2,10 +2,10 @@
var SomeError = /*#__PURE__*/ function _target(Error) {
"use strict";
_inherits(SomeError, Error);
- var _super = _create_super(SomeError);
function SomeError(issues) {
_class_call_check(this, SomeError);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, SomeError);
const actualProto = (this instanceof SomeError ? this.constructor : void 0).prototype;
return _this;
}
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_parameters.rs/rest_nested_iife.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_parameters.rs/rest_nested_iife.js
index ad802da0299..79a2ccfe216 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_parameters.rs/rest_nested_iife.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2015_parameters.rs/rest_nested_iife.js
@@ -6,10 +6,9 @@ function broken(x) {
let Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- return _super.apply(this, arguments);
+ return _call_super(this, Foo, arguments);
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_call_in_key.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_call_in_key.js
index 6afa71a326f..7cb1924626e 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_call_in_key.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_call_in_key.js
@@ -10,16 +10,16 @@ var Hello = function Hello() {
var Outer = /*#__PURE__*/ function(Hello) {
"use strict";
_inherits(Outer, Hello);
- var _super = _create_super(Outer);
function Outer() {
_class_call_check(this, Outer);
var _this;
- var _ref = _this = _super.call(this);
+ var _ref = _this = _call_super(this, Outer);
var Inner = function Inner() {
_class_call_check(this, Inner);
_define_property(this, _ref, "hello");
};
return _possible_constructor_return(_this, new Inner());
+ return _this;
}
return Outer;
}(Hello);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_property_in_key.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_property_in_key.js
index a92523544a7..ccfa5d922b0 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_property_in_key.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/nested_class_super_property_in_key.js
@@ -16,16 +16,17 @@ var Hello = /*#__PURE__*/ function() {
var Outer = /*#__PURE__*/ function(Hello) {
"use strict";
_inherits(Outer, Hello);
- var _super = _create_super(Outer);
function Outer() {
_class_call_check(this, Outer);
- var _this = _super.call(this);
+ var _this;
+ _this = _call_super(this, Outer);
var _super_toString = _get((_assert_this_initialized(_this), _get_prototype_of(Outer.prototype)), "toString", _this).call(_this);
var Inner = function Inner() {
_class_call_check(this, Inner);
_define_property(this, _super_toString, 'hello');
};
return _possible_constructor_return(_this, new Inner());
+ return _this;
}
return Outer;
}(Hello);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js
index 8e932fa3096..aa041e6cb3d 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived.js
@@ -11,12 +11,11 @@ var _prop1 = /*#__PURE__*/ new WeakMap();
var Bar = /*#__PURE__*/ function(Foo) {
"use strict";
_inherits(Bar, Foo);
- var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
var _this;
- _this = _super.apply(this, arguments);
- _class_private_field_init(_assert_this_initialized(_this), _prop1, {
+ _this = _call_super(this, Bar, arguments);
+ _class_private_field_init(_this, _prop1, {
writable: true,
value: "bar"
});
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js
index 827867e2fa6..f95c3fd252d 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_derived_multiple_supers.js
@@ -2,19 +2,18 @@ var _bar = /*#__PURE__*/ new WeakMap();
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
if (condition) {
- _this = _super.call(this);
- _class_private_field_init(_assert_this_initialized(_this), _bar, {
+ _this = _call_super(this, Foo);
+ _class_private_field_init(_this, _bar, {
writable: true,
value: "foo"
});
} else {
- _this = _super.call(this);
- _class_private_field_init(_assert_this_initialized(_this), _bar, {
+ _this = _call_super(this, Foo);
+ _class_private_field_init(_this, _bar, {
writable: true,
value: "foo"
});
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js
index 46a21b59130..b052f9f6d4b 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_foobar.js
@@ -2,12 +2,11 @@ var _scopedFunctionWithThis = /*#__PURE__*/ new WeakMap();
var Child = /*#__PURE__*/ function(Parent1) {
"use strict";
_inherits(Child, Parent1);
- var _super = _create_super(Child);
function Child() {
_class_call_check(this, Child);
var _this;
- _this = _super.call(this);
- _class_private_field_init(_assert_this_initialized(_this), _scopedFunctionWithThis, {
+ _this = _call_super(this, Child);
+ _class_private_field_init(_this, _scopedFunctionWithThis, {
writable: true,
value: ()=>{
_this.name = {};
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_private_in_derived.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_private_in_derived.js
index 741d017faaf..56ec82f8c3f 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_private_in_derived.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_private_in_derived.js
@@ -9,10 +9,9 @@ var Outer = function Outer() {
});
var Test = /*#__PURE__*/ function(_class_private_field_get1) {
_inherits(Test, _class_private_field_get1);
- var _super = _create_super(Test);
function Test() {
_class_call_check(this, Test);
- return _super.apply(this, arguments);
+ return _call_super(this, Test, arguments);
}
return Test;
}(_class_private_field_get(_this, _outer));
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js
index 022b2c04292..0ad78880f67 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_call.js
@@ -17,12 +17,11 @@ var _foo = /*#__PURE__*/ new WeakMap();
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
var _this;
- _this = _super.apply(this, arguments);
- _class_private_field_init(_assert_this_initialized(_this), _foo, {
+ _this = _call_super(this, B, arguments);
+ _class_private_field_init(_this, _foo, {
writable: true,
value: _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this)
});
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js
index 55208bae871..9f5458bd201 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_expression.js
@@ -2,16 +2,15 @@ var _bar = /*#__PURE__*/ new WeakMap();
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
var _temp;
- foo((_temp = _this = _super.call(this), _class_private_field_init(_assert_this_initialized(_this), _bar, {
+ foo((_temp = _this = _call_super(this, Foo), _class_private_field_init(_this, _bar, {
writable: true,
value: "foo"
}), _temp));
- return _possible_constructor_return(_this);
+ return _this;
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js
index 67c3e508dab..7e2ff59dcb5 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/private_super_statement.js
@@ -2,12 +2,11 @@ var _bar = /*#__PURE__*/ new WeakMap();
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _this = _super.call(this);
- _class_private_field_init(_assert_this_initialized(_this), _bar, {
+ _this = _call_super(this, Foo);
+ _class_private_field_init(_this, _bar, {
writable: true,
value: "foo"
});
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js
index c08fe418c45..f83080e256c 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived.js
@@ -1,12 +1,11 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _this = _super.apply(this, arguments);
- _define_property(_assert_this_initialized(_this), "bar", "foo");
+ _this = _call_super(this, Foo, arguments);
+ _define_property(_this, "bar", "foo");
return _this;
}
return Foo;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js
index cc78776002c..cdd54955002 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_derived_multiple_supers.js
@@ -1,16 +1,15 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
if (condition) {
- _this = _super.call(this);
- _define_property(_assert_this_initialized(_this), "bar", "foo");
+ _this = _call_super(this, Foo);
+ _define_property(_this, "bar", "foo");
} else {
- _this = _super.call(this);
- _define_property(_assert_this_initialized(_this), "bar", "foo");
+ _this = _call_super(this, Foo);
+ _define_property(_this, "bar", "foo");
}
return _possible_constructor_return(_this);
}
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_regression_t6719.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_regression_t6719.js
index 850ee92a898..ebf850e359b 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_regression_t6719.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_regression_t6719.js
@@ -3,10 +3,9 @@ function withContext(ComposedComponent) {
return _WithContext = /*#__PURE__*/ function(Component1) {
"use strict";
_inherits(WithContext, Component1);
- var _super = _create_super(WithContext);
function WithContext() {
_class_call_check(this, WithContext);
- return _super.apply(this, arguments);
+ return _call_super(this, WithContext, arguments);
}
return WithContext;
}(Component), _define_property(_WithContext, "propTypes", {
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_super.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_super.js
index 9b7675085a2..3b3fda86cfb 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_super.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_static_super.js
@@ -6,10 +6,9 @@ _define_property(A, "prop", 1);
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
- return _super.apply(this, arguments);
+ return _call_super(this, B, arguments);
}
return B;
}(A);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js
index dbedf7d81b1..02c3d9c0673 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_call.js
@@ -16,12 +16,11 @@ var A = /*#__PURE__*/ function() {
var B = /*#__PURE__*/ function(A) {
"use strict";
_inherits(B, A);
- var _super = _create_super(B);
function B() {
_class_call_check(this, B);
var _this;
- _this = _super.apply(this, arguments);
- _define_property(_assert_this_initialized(_this), "foo", _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this));
+ _this = _call_super(this, B, arguments);
+ _define_property(_this, "foo", _get((_assert_this_initialized(_this), _get_prototype_of(B.prototype)), "foo", _this).call(_this));
return _this;
}
return B;
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js
index 26fe6286a44..a417f613c9d 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_expression.js
@@ -1,13 +1,12 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
var _temp;
- foo((_temp = _this = _super.call(this), _define_property(_assert_this_initialized(_this), "bar", "foo"), _temp));
- return _possible_constructor_return(_this);
+ foo((_temp = _this = _call_super(this, Foo), _define_property(_this, "bar", "foo"), _temp));
+ return _this;
}
return Foo;
}(Bar);
diff --git a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js
index c7a6f0f1f95..7fe00821f4d 100644
--- a/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js
+++ b/crates/swc_ecma_transforms_compat/tests/__swc_snapshots__/tests/es2022_class_properties.rs/public_super_statement.js
@@ -1,12 +1,11 @@
var Foo = /*#__PURE__*/ function(Bar1) {
"use strict";
_inherits(Foo, Bar1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
var _this;
- _this = _super.call(this);
- _define_property(_assert_this_initialized(_this), "bar", "foo");
+ _this = _call_super(this, Foo);
+ _define_property(_this, "bar", "foo");
return _this;
}
return Foo;
diff --git a/crates/swc_ecma_transforms_compat/tests/classes/create-super-1/output.js b/crates/swc_ecma_transforms_compat/tests/classes/create-super-1/output.js
index 71e043656a7..eba6143a877 100644
--- a/crates/swc_ecma_transforms_compat/tests/classes/create-super-1/output.js
+++ b/crates/swc_ecma_transforms_compat/tests/classes/create-super-1/output.js
@@ -1,10 +1,9 @@
let Foo = /*#__PURE__*/ function(UnknownNativeClass1) {
"use strict";
_inherits(Foo, UnknownNativeClass1);
- var _super = _create_super(Foo);
function Foo() {
_class_call_check(this, Foo);
- return _super.apply(this, arguments);
+ return _call_super(this, Foo, arguments);
}
return Foo;
}(UnknownNativeClass);
diff --git a/crates/swc_ecma_transforms_proposal/src/decorators/mod.rs b/crates/swc_ecma_transforms_proposal/src/decorators/mod.rs
index 642ca4563f3..a2c48c4a14f 100644
--- a/crates/swc_ecma_transforms_proposal/src/decorators/mod.rs
+++ b/crates/swc_ecma_transforms_proposal/src/decorators/mod.rs
@@ -327,15 +327,12 @@ impl Decorators {
}
};
- let mut vars = Vec::new();
-
macro_rules! fold_method {
($method:expr, $fn_name:expr, $key_prop_value:expr) => {{
let fn_name = $fn_name;
let method = $method;
let mut folder = swc_ecma_visit::as_folder(SuperFieldAccessFolder {
class_name: &ident,
- vars: &mut vars,
constructor_this_mark: None,
is_static: method.is_static,
folding_constructor: false,
@@ -555,8 +552,6 @@ impl Decorators {
.map(Some)
.collect();
- self.vars.extend(vars);
-
make_decorate_call(
class.decorators,
iter::once({
diff --git a/packages/core/scripts/npm/darwin-arm64/package.json b/packages/core/scripts/npm/darwin-arm64/package.json
index 731270deaac..bf1ae10adb3 100644
--- a/packages/core/scripts/npm/darwin-arm64/package.json
+++ b/packages/core/scripts/npm/darwin-arm64/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/darwin-x64/package.json b/packages/core/scripts/npm/darwin-x64/package.json
index 25c0d7f70c8..5049ed20f5e 100644
--- a/packages/core/scripts/npm/darwin-x64/package.json
+++ b/packages/core/scripts/npm/darwin-x64/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json
index c00fa5f7347..81558b908b3 100644
--- a/packages/core/scripts/npm/linux-arm-gnueabihf/package.json
+++ b/packages/core/scripts/npm/linux-arm-gnueabihf/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/linux-arm64-gnu/package.json b/packages/core/scripts/npm/linux-arm64-gnu/package.json
index 5ad84a89d66..0b6ea1d8ebc 100644
--- a/packages/core/scripts/npm/linux-arm64-gnu/package.json
+++ b/packages/core/scripts/npm/linux-arm64-gnu/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/linux-arm64-musl/package.json b/packages/core/scripts/npm/linux-arm64-musl/package.json
index 18ba4738665..08c85b6ab5c 100644
--- a/packages/core/scripts/npm/linux-arm64-musl/package.json
+++ b/packages/core/scripts/npm/linux-arm64-musl/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/linux-x64-gnu/package.json b/packages/core/scripts/npm/linux-x64-gnu/package.json
index c1ec6896786..b5f259df589 100644
--- a/packages/core/scripts/npm/linux-x64-gnu/package.json
+++ b/packages/core/scripts/npm/linux-x64-gnu/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/linux-x64-musl/package.json b/packages/core/scripts/npm/linux-x64-musl/package.json
index 0d905967e74..9b1a213ddeb 100644
--- a/packages/core/scripts/npm/linux-x64-musl/package.json
+++ b/packages/core/scripts/npm/linux-x64-musl/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/win32-arm64-msvc/package.json b/packages/core/scripts/npm/win32-arm64-msvc/package.json
index b0cdd5541d4..692f8e43cc1 100644
--- a/packages/core/scripts/npm/win32-arm64-msvc/package.json
+++ b/packages/core/scripts/npm/win32-arm64-msvc/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/win32-ia32-msvc/package.json b/packages/core/scripts/npm/win32-ia32-msvc/package.json
index f76c060ec1f..b01e388c8d7 100644
--- a/packages/core/scripts/npm/win32-ia32-msvc/package.json
+++ b/packages/core/scripts/npm/win32-ia32-msvc/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/core/scripts/npm/win32-x64-msvc/package.json b/packages/core/scripts/npm/win32-x64-msvc/package.json
index cc0136ec7bd..be324dad162 100644
--- a/packages/core/scripts/npm/win32-x64-msvc/package.json
+++ b/packages/core/scripts/npm/win32-x64-msvc/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/helpers/esm/_call_super.js b/packages/helpers/esm/_call_super.js
new file mode 100644
index 00000000000..f569d6270c3
--- /dev/null
+++ b/packages/helpers/esm/_call_super.js
@@ -0,0 +1,17 @@
+import { _ as _get_prototype_of } from "./_get_prototype_of.js";
+import { _ as _is_native_reflect_construct } from "./_is_native_reflect_construct.js";
+import { _ as _possible_constructor_return } from "./_possible_constructor_return.js";
+
+function _call_super(_this, derived, args) {
+ // Super
+ derived = _get_prototype_of(derived);
+ return _possible_constructor_return(
+ _this,
+ _is_native_reflect_construct()
+ // NOTE: This doesn't work if this.__proto__.constructor has been modified.
+ ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor)
+ : derived.apply(_this, args)
+ );
+}
+
+export { _call_super as _ };
diff --git a/packages/helpers/esm/_is_native_reflect_construct.js b/packages/helpers/esm/_is_native_reflect_construct.js
index 4be8cf7e90f..af04603219b 100644
--- a/packages/helpers/esm/_is_native_reflect_construct.js
+++ b/packages/helpers/esm/_is_native_reflect_construct.js
@@ -1,14 +1,16 @@
function _is_native_reflect_construct() {
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
- if (Reflect.construct.sham) return false;
- if (typeof Proxy === "function") return true;
-
+ // Since Reflect.construct can't be properly polyfilled, some
+ // implementations (e.g. core-js@2) don't set the correct internal slots.
+ // Those polyfills don't allow us to subclass built-ins, so we need to
+ // use our fallback implementation.
try {
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
-
- return true;
- } catch (e) {
- return false;
- }
+ // If the internal slots aren't set, this throws an error similar to
+ // TypeError: this is not a Boolean object.
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
+ } catch (_) {}
+ return (_is_native_reflect_construct = function() {
+ return !!result;
+ })();
}
+
export { _is_native_reflect_construct as _ };
diff --git a/packages/helpers/esm/index.js b/packages/helpers/esm/index.js
index 773f19606fd..522cc47b463 100644
--- a/packages/helpers/esm/index.js
+++ b/packages/helpers/esm/index.js
@@ -13,6 +13,7 @@ export { _ as _async_iterator } from "./_async_iterator.js";
export { _ as _async_to_generator } from "./_async_to_generator.js";
export { _ as _await_async_generator } from "./_await_async_generator.js";
export { _ as _await_value } from "./_await_value.js";
+export { _ as _call_super } from "./_call_super.js";
export { _ as _check_private_redeclaration } from "./_check_private_redeclaration.js";
export { _ as _class_apply_descriptor_destructure } from "./_class_apply_descriptor_destructure.js";
export { _ as _class_apply_descriptor_get } from "./_class_apply_descriptor_get.js";
diff --git a/packages/helpers/package.json b/packages/helpers/package.json
index 2cff08c3c0a..1590a56bd4d 100644
--- a/packages/helpers/package.json
+++ b/packages/helpers/package.json
@@ -99,6 +99,10 @@
"import": "./esm/_await_value.js",
"default": "./cjs/_await_value.cjs"
},
+ "./_/_call_super": {
+ "import": "./esm/_call_super.js",
+ "default": "./cjs/_call_super.cjs"
+ },
"./_/_check_private_redeclaration": {
"import": "./esm/_check_private_redeclaration.js",
"default": "./cjs/_check_private_redeclaration.cjs"
diff --git a/packages/minifier/scripts/npm/darwin-arm64/package.json b/packages/minifier/scripts/npm/darwin-arm64/package.json
index e110ba3890f..0f0f25d969e 100644
--- a/packages/minifier/scripts/npm/darwin-arm64/package.json
+++ b/packages/minifier/scripts/npm/darwin-arm64/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/darwin-x64/package.json b/packages/minifier/scripts/npm/darwin-x64/package.json
index bb938431914..cdb2fc1593b 100644
--- a/packages/minifier/scripts/npm/darwin-x64/package.json
+++ b/packages/minifier/scripts/npm/darwin-x64/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json
index ce463a53972..d1c70a400ce 100644
--- a/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json
+++ b/packages/minifier/scripts/npm/linux-arm-gnueabihf/package.json
@@ -35,4 +35,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json
index b7afab8053f..2f4afdc097b 100644
--- a/packages/minifier/scripts/npm/linux-arm64-gnu/package.json
+++ b/packages/minifier/scripts/npm/linux-arm64-gnu/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/linux-arm64-musl/package.json b/packages/minifier/scripts/npm/linux-arm64-musl/package.json
index ba221840722..2816a97a963 100644
--- a/packages/minifier/scripts/npm/linux-arm64-musl/package.json
+++ b/packages/minifier/scripts/npm/linux-arm64-musl/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/linux-x64-gnu/package.json b/packages/minifier/scripts/npm/linux-x64-gnu/package.json
index c6d0a7a40ae..aefbb91b0ba 100644
--- a/packages/minifier/scripts/npm/linux-x64-gnu/package.json
+++ b/packages/minifier/scripts/npm/linux-x64-gnu/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/linux-x64-musl/package.json b/packages/minifier/scripts/npm/linux-x64-musl/package.json
index 68a23caa0c6..63132af5255 100644
--- a/packages/minifier/scripts/npm/linux-x64-musl/package.json
+++ b/packages/minifier/scripts/npm/linux-x64-musl/package.json
@@ -42,4 +42,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json
index 1695eea44d4..43dfa01eb12 100644
--- a/packages/minifier/scripts/npm/win32-arm64-msvc/package.json
+++ b/packages/minifier/scripts/npm/win32-arm64-msvc/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json
index 28b7d52f346..41e979785ba 100644
--- a/packages/minifier/scripts/npm/win32-ia32-msvc/package.json
+++ b/packages/minifier/scripts/npm/win32-ia32-msvc/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}
diff --git a/packages/minifier/scripts/npm/win32-x64-msvc/package.json b/packages/minifier/scripts/npm/win32-x64-msvc/package.json
index 327406afbae..709de6a46d2 100644
--- a/packages/minifier/scripts/npm/win32-x64-msvc/package.json
+++ b/packages/minifier/scripts/npm/win32-x64-msvc/package.json
@@ -39,4 +39,4 @@
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
}
-}
\ No newline at end of file
+}