mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
73 lines
1.2 KiB
Text
73 lines
1.2 KiB
Text
---
|
|
source: crates/oxc_transformer/tests/integrations/es_target.rs
|
|
snapshot_kind: text
|
|
---
|
|
########## 0 es5
|
|
() => {}
|
|
----------
|
|
(function() {});
|
|
|
|
########## 1 es2015
|
|
a ** b
|
|
----------
|
|
Math.pow(a, b);
|
|
|
|
########## 2 es2016
|
|
async function foo() {}
|
|
----------
|
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
function foo() {
|
|
return _foo.apply(this, arguments);
|
|
}
|
|
function _foo() {
|
|
_foo = _asyncToGenerator(function* () {});
|
|
return _foo.apply(this, arguments);
|
|
}
|
|
|
|
########## 3 es2017
|
|
({ ...x })
|
|
----------
|
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
_objectSpread({}, x);
|
|
|
|
########## 4 es2018
|
|
try {} catch {}
|
|
----------
|
|
try {} catch (_unused) {}
|
|
|
|
########## 5 es2019
|
|
a ?? b
|
|
----------
|
|
var _a;
|
|
(_a = a) !== null && _a !== void 0 ? _a : b;
|
|
|
|
########## 6 es2020
|
|
a ||= b
|
|
----------
|
|
a || (a = b);
|
|
|
|
########## 7 es2019
|
|
1n ** 2n
|
|
----------
|
|
|
|
! Big integer literals are not available in the configured target
|
|
| environment.
|
|
,----
|
|
1 | 1n ** 2n
|
|
: ^^
|
|
`----
|
|
|
|
|
|
! Big integer literals are not available in the configured target
|
|
| environment.
|
|
,----
|
|
1 | 1n ** 2n
|
|
: ^^
|
|
`----
|
|
|
|
########## 8 es2021
|
|
class foo { static {} }
|
|
----------
|
|
class foo {
|
|
static #_ = (() => {})();
|
|
}
|