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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 20 additions & 0 deletions crates/swc/tests/fixture/issues-110xx/11167/input/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"jsx": false
},
"target": "es2015",
"loose": false,
"minify": {
"compress": false,
"mangle": true
},
"preserveAllComments": true,
"externalHelpers": true
},
"module": {
"type": "es6"
},
"isModule": true
}
5 changes: 5 additions & 0 deletions crates/swc/tests/fixture/issues-110xx/11167/input/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* @ngInject */
class TestClass {
constructor (private testField) {}
}
console.log(123)
8 changes: 8 additions & 0 deletions crates/swc/tests/fixture/issues-110xx/11167/output/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { _ as s } from "@swc/helpers/_/_define_property";
/* @ngInject */ class e {
constructor(e){
s(this, "testField", void 0);
this.testField = e;
}
}
console.log(123);
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
* Copyright (c) 2020. MeLike2D All Rights Reserved.
* Neo is licensed under the MIT License.
* See the LICENSE file in the project root for more details.
*/ "use strict";
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** 등록된 계좌+회원의 정보 */ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata";
export var AccountMemberView = function AccountMemberView() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// not work
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _ts_decorate = require("@swc/helpers/_/_ts_decorate");
const _ts_metadata = require("@swc/helpers/_/_ts_metadata");
const _ts_param = require("@swc/helpers/_/_ts_param");
// not work
class MyClass1 {
constructor(param1){
this.param1 = param1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// work
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _ts_decorate = require("@swc/helpers/_/_ts_decorate");
const _ts_metadata = require("@swc/helpers/_/_ts_metadata");
const _ts_param = require("@swc/helpers/_/_ts_param");
// work
class MyClass1 {
constructor(param1){}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/swc/tests/fixture/issues-2xxx/2056/1/output/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
import { _ as _type_of } from "@swc/helpers/_/_type_of";
/*
Copyright (c) 2018-2020 Xiamen Yaji Software Co., Ltd.

Expand All @@ -24,9 +26,7 @@
*/ /**
* @packageDocumentation
* @module core/math
*/ import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
import { _ as _type_of } from "@swc/helpers/_/_type_of";
import { CCClass } from "../data/class";
*/ import { CCClass } from "../data/class";
import { Mat3 } from "./mat3";
import { Quat } from "./quat";
import { enumerableProps, EPSILON } from "./utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// single line comment
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _object_without_properties = require("@swc/helpers/_/_object_without_properties");
// single line comment
const x = (_param)=>/*todo: refactor any type*/ {
var { y } = _param, rest = _object_without_properties._(_param, [
"y"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Simulate accessing a .js file in a third party package that shouldn't be edited
define([
"require",
"exports",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Simulate accessing a .js file in a third party package that shouldn't be edited
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Simulate accessing a .js file in a third party package that shouldn't be edited
System.register([
"lodash/dist/something.js"
], function(_export, _context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Simulate accessing a .js file in a third party package that shouldn't be edited
(function(global, factory) {
if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("@swc/helpers/_/_interop_require_default"), require("lodash/dist/something.js"));
else if (typeof define === "function" && define.amd) define([
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mappings": "AAAA,WAAW;;;;;;;;;QAKEA;eAAAA;;QAJDC;;;;qBAAS;AAId,MAAMD,OAAO,CAACE;IACjB,sBAAsB;IACtB,OAAO,IAAIC,QAAQ,CAACC,UAChBC,WAAW;YACPD,QAAQ;QACZ,GAAG;AAEX",
"mappings": ";;;;;;;;QAKaA;eAAAA;;QAJDC;;;;qBAAS;AAId,MAAMD,OAAO,CAACE;IACjB,sBAAsB;IACtB,OAAO,IAAIC,QAAQ,CAACC,UAChBC,WAAW;YACPD,QAAQ;QACZ,GAAG;AAEX",
"names": [
"byID",
"get",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// index.ts
"use strict";
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mappings": "AAAA,4DAA4D;AAC5D,kCAAkC;;;;;+BACJ;AAE9BA,SAAS,mBAAmB;IACxBC,GAAG,4DAA4D;QAC3D,IAAIC;QACJ,SAASC;YACLD,QAAQE,IAAAA,4BAAa;QACzB;QACAD;QAEAE,OAAOH,KAAK,CAAC,EAAE,EAAEI,SAAS,CAAC;IAC/B;AACJ",
"mappings": ";;;;+BAE8B;AAE9BA,SAAS,mBAAmB;IACxBC,GAAG,4DAA4D;QAC3D,IAAIC;QACJ,SAASC;YACLD,QAAQE,IAAAA,4BAAa;QACzB;QACAD;QAEAE,OAAOH,KAAK,CAAC,EAAE,EAAEI,SAAS,CAAC;IAC/B;AACJ",
"names": [
"describe",
"it",
Expand Down
2 changes: 0 additions & 2 deletions crates/swc/tests/fixture/jest/issue-7506/output/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
Expand Down
2 changes: 1 addition & 1 deletion crates/swc/tests/fixture/jest/issue-7506/output/util.map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mappings": "AAAA,4DAA4D;AAC5D,kCAAkC;;;;;+BAElBA;;;eAAAA;;;AAAT,SAASA;IACZ,MAAMC,WAAW,IAAIC,QAAQC,KAAK;IAElC,OAAOF,SAASG,KAAK,CAAC;AAC1B",
"mappings": ";;;;+BAGgBA;;;eAAAA;;;AAAT,SAASA;IACZ,MAAMC,WAAW,IAAIC,QAAQC,KAAK;IAElC,OAAOF,SAASG,KAAK,CAAC;AAC1B",
"names": [
"getStackTrace",
"rawStack",
Expand Down
2 changes: 0 additions & 2 deletions crates/swc/tests/fixture/jest/issue-7506/output/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/swc/tests/fixture/sourcemap/009/output/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
/**
* This is a
* long
* license
* header
*/ "use strict";
console.log(new Error().stack);
*/ console.log(new Error().stack);
2 changes: 1 addition & 1 deletion crates/swc/tests/fixture/sourcemap/009/output/index.map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mappings": "AAAA;;;;;CAKC;AACDA,QAAQC,GAAG,CAAC,IAAIC,QAAQC,KAAK",
"mappings": ";AAAA;;;;;CAKC,GACDA,QAAQC,GAAG,CAAC,IAAIC,QAAQC,KAAK",
"names": [
"console",
"log",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//// [ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts]
// all expected to be errors
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
// all expected to be errors
var clodule1 = function clodule1() {
"use strict";
_class_call_check(this, clodule1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//// [ES5For-ofTypeCheck10.ts]
// In ES3/5, you cannot for...of over an arbitrary iterable.
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
// In ES3/5, you cannot for...of over an arbitrary iterable.
var StringIterator = /*#__PURE__*/ function() {
"use strict";
function StringIterator() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//// [accessorsAreNotContextuallyTyped.ts]
// accessors are not contextually typed
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import { _ as _create_class } from "@swc/helpers/_/_create_class";
// accessors are not contextually typed
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//// [accessorsOverrideProperty9.ts]
// #41347, based on microsoft/rushstack
// Mixin utilities
// Base class
class ApiItem {
get members() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//// [ambientAccessors.ts]
// ok to use accessors in ambient class in ES3
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//// [ambientDeclarations.ts]
// Ambient variable without type annotation
var x = E3.B;
// Ambient module members are always exported with or without export keyword
var p = M1.x;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//// [ambientDeclarationsExternal.ts]
//// [decls.ts]
// Ambient external module with export assignment
// Ambient external import declaration referencing ambient external module using top level module name
//// [consumer.ts]
//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//// [ambientEnumDeclaration1.ts]
// In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions.
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
//// [ambientEnumDeclaration2.ts]
// In ambient enum declarations that specify no const modifier, enum member declarations
// that omit a value are considered computed members (as opposed to having auto- incremented values assigned).
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//// [Compilation.js]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
// from webpack/lib/Compilation.js and filed at #26427
/** @param {{ [s: string]: number }} map */ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
function mappy(map) {}
/** @param {{ [s: string]: number }} map */ function mappy(map) {}
export var C = /*#__PURE__*/ function() {
"use strict";
function C() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//// [anyAsGenericFunctionCall.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
// any is considered an untyped function call
// can be called except with type arguments which is an error
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var x;
var a = x();
var b = x('hello');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//// [anyAssignabilityInInheritance.ts]
// any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var a;
var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//// [anyAssignableToEveryType2.ts]
// any is not a subtype of any other types, but is assignable, all the below should work
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var A = function A() {
"use strict";
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
// 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:
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
// 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:
var Base = function Base() {
"use strict";
_class_call_check(this, Base);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//// [argumentExpressionContextualTyping.ts]
// In a typed function call, argument expressions are contextually typed by their corresponding parameter types.
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
// In a typed function call, argument expressions are contextually typed by their corresponding parameter types.
function foo(param) {
var _param_x = _sliced_to_array(param.x, 2), a = _param_x[0], b = _param_x[1], _param_y = param.y, c = _param_y.c, d = _param_y.d, e = _param_y.e;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//// [arrayLiteralExpressionContextualTyping.ts]
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
// In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by
// the type of the property with the numeric name N in the contextual type, if any, or otherwise
// the numeric index type of the contextual type, if any.
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
var array = [
1,
2,
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
// Empty array literal with no contextual type has type Undefined[]
var arr1 = [
[],
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//// [arrayLiterals2ES5.ts]
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
// ElementList: ( Modified )
// Elisionopt AssignmentExpression
// Elisionopt SpreadElement
// ElementList, Elisionopt AssignmentExpression
// ElementList, Elisionopt SpreadElement
// SpreadElement:
// ... AssignmentExpression
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
var a0 = [
,
,
Expand Down
Loading
Loading