Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
30 additions
and
173 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/fixture/issues-1xxx/1402/case1/output/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
var e = 1; | ||
try { | ||
throw 2; | ||
} catch (e1) { | ||
} catch { | ||
console.log(e); | ||
} |
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/fixture/issues-1xxx/1448/case1/output/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { createRequire as _createRequire } from "module"; | ||
var __require = _createRequire(import.meta.url); | ||
var F = __require("yaml"); | ||
const __require = _createRequire(import.meta.url); | ||
const F = __require("yaml"); | ||
console.log(F); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 8 additions & 127 deletions
135
crates/swc/tests/fixture/issues-1xxx/1721/case1/output/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,10 @@ | ||
import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; | ||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; | ||
import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; | ||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; | ||
function lol() { | ||
return _lol.apply(this, arguments); | ||
} | ||
function _lol() { | ||
_lol = _wrap_async_generator(function() { | ||
return _ts_generator(this, function(_state) { | ||
switch(_state.label){ | ||
case 0: | ||
return [ | ||
4, | ||
1 | ||
]; | ||
case 1: | ||
_state.sent(); | ||
return [ | ||
4, | ||
2 | ||
]; | ||
case 2: | ||
_state.sent(); | ||
return [ | ||
2 | ||
]; | ||
} | ||
}); | ||
}); | ||
return _lol.apply(this, arguments); | ||
} | ||
function main() { | ||
return _main.apply(this, arguments); | ||
} | ||
function _main() { | ||
_main = _async_to_generator(function() { | ||
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, x, err; | ||
return _ts_generator(this, function(_state) { | ||
switch(_state.label){ | ||
case 0: | ||
_iteratorAbruptCompletion = false, _didIteratorError = false; | ||
_state.label = 1; | ||
case 1: | ||
_state.trys.push([ | ||
1, | ||
6, | ||
7, | ||
12 | ||
]); | ||
_iterator = _async_iterator(lol()); | ||
_state.label = 2; | ||
case 2: | ||
return [ | ||
4, | ||
_iterator.next() | ||
]; | ||
case 3: | ||
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [ | ||
3, | ||
5 | ||
]; | ||
_value = _step.value; | ||
x = _value; | ||
console.log(x); | ||
_state.label = 4; | ||
case 4: | ||
_iteratorAbruptCompletion = false; | ||
return [ | ||
3, | ||
2 | ||
]; | ||
case 5: | ||
return [ | ||
3, | ||
12 | ||
]; | ||
case 6: | ||
err = _state.sent(); | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
return [ | ||
3, | ||
12 | ||
]; | ||
case 7: | ||
_state.trys.push([ | ||
7, | ||
, | ||
10, | ||
11 | ||
]); | ||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [ | ||
3, | ||
9 | ||
]; | ||
return [ | ||
4, | ||
_iterator.return() | ||
]; | ||
case 8: | ||
_state.sent(); | ||
_state.label = 9; | ||
case 9: | ||
return [ | ||
3, | ||
11 | ||
]; | ||
case 10: | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
return [ | ||
7 | ||
]; | ||
case 11: | ||
return [ | ||
7 | ||
]; | ||
case 12: | ||
return [ | ||
2 | ||
]; | ||
} | ||
}); | ||
}); | ||
return _main.apply(this, arguments); | ||
async function* lol() { | ||
yield 1; | ||
yield 2; | ||
} | ||
async function main() { | ||
for await (const x of lol()){ | ||
console.log(x); | ||
} | ||
} | ||
main(); |
19 changes: 3 additions & 16 deletions
19
crates/swc/tests/fixture/issues-1xxx/1722/case1/output/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,3 @@ | ||
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; | ||
import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; | ||
(function() { | ||
var _main = _async_to_generator(function() { | ||
return _ts_generator(this, function(_state) { | ||
console.log(1); | ||
return [ | ||
2 | ||
]; | ||
}); | ||
}); | ||
function main() { | ||
return _main.apply(this, arguments); | ||
} | ||
return main; | ||
})()(); | ||
(async function main() { | ||
console.log(1); | ||
})(); |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/fixture/issues-2xxx/2154/case1/output/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
var c = /*#__PURE__*/ React.createElement("img", { | ||
const c = /*#__PURE__*/ React.createElement("img", { | ||
alt: "caf\xe9" | ||
}).props.alt; | ||
console.log(c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
crates/swc/tests/fixture/shopify/005-no-module/output/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs"; | ||
import React from "react"; | ||
import { useI18n } from "@shopify/react-i18n"; | ||
export function App() { | ||
var _useI18n = _sliced_to_array(useI18n(), 1), i18n = _useI18n[0]; | ||
const [i18n] = useI18n(); | ||
return /*#__PURE__*/ React.createElement("h1", null, i18n.translate("foo")); | ||
} |