Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ts/compat): Migrate inline tests to fixture testing (#6475)
- Loading branch information
Showing
62 changed files
with
389 additions
and
618 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/arguments-fn-expr/input.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function test() { | ||
return function () { | ||
return arguments[0]; | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/arguments-fn-expr/output.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function test() { | ||
return function() { | ||
return arguments[0]; | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/arguments-member/input.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function test() { | ||
return (foo) => { | ||
return foo.arguments; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/arguments-member/output.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function test() { | ||
return function(foo) { | ||
return foo.arguments; | ||
}; | ||
} |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/arguments/input.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function test() { | ||
return () => arguments[0]; | ||
} |
6 changes: 6 additions & 0 deletions
6
crates/swc_ecma_transforms_compat/tests/arrow/arguments/output.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
function test() { | ||
var _arguments = arguments; | ||
return function() { | ||
return _arguments[0]; | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
let echo = (bar) => bar |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/basic/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let echo = function(bar) { | ||
return bar; | ||
}; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/chrome-46/input.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function foo() { | ||
const a = (a) => new.target | ||
} |
6 changes: 6 additions & 0 deletions
6
crates/swc_ecma_transforms_compat/tests/arrow/chrome-46/output.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
function foo() { | ||
var _newtarget = new.target; | ||
const a = function(a) { | ||
return _newtarget; | ||
}; | ||
} |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/computed-props/input.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var a = { | ||
[(() => this)()]: 123 | ||
} |
6 changes: 6 additions & 0 deletions
6
crates/swc_ecma_transforms_compat/tests/arrow/computed-props/output.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var _this = this; | ||
var a = { | ||
[function() { | ||
return _this; | ||
}()]: 123 | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/destructuring/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
let foo = ({ bar }) => undefined; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/destructuring/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let foo = function({ bar }) { | ||
return undefined; | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/empty-arguments/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
var t = () => 5 + 5; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/empty-arguments/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var t = function() { | ||
return 5 + 5; | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/expression/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
arr.map(x => x * x); |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/expression/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
arr.map(function(x) { | ||
return x * x; | ||
}); |
9 changes: 9 additions & 0 deletions
9
crates/swc_ecma_transforms_compat/tests/arrow/fixture-arguments/input.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function fn() { | ||
var foo = () => { | ||
return arguments; | ||
}; | ||
} | ||
|
||
var bar = () => arguments; | ||
|
||
var baz = () => () => arguments; |
15 changes: 15 additions & 0 deletions
15
crates/swc_ecma_transforms_compat/tests/arrow/fixture-arguments/output.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var _arguments = arguments; | ||
function fn() { | ||
var _arguments = arguments; | ||
var foo = function() { | ||
return _arguments; | ||
}; | ||
} | ||
var bar = function() { | ||
return _arguments; | ||
}; | ||
var baz = function() { | ||
return function() { | ||
return _arguments; | ||
}; | ||
}; |
16 changes: 16 additions & 0 deletions
16
crates/swc_ecma_transforms_compat/tests/arrow/fixture-this/input.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function b() { | ||
var t = x => this.x + x; | ||
} | ||
|
||
class Foo extends (function () { }) { | ||
constructor() { | ||
var foo = () => this; | ||
|
||
if (true) { | ||
console.log(super(), foo()); | ||
} else { | ||
super(); | ||
console.log(foo()); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
crates/swc_ecma_transforms_compat/tests/arrow/fixture-this/output.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function b() { | ||
var _this = this; | ||
var t = function(x) { | ||
return _this.x + x; | ||
}; | ||
} | ||
class Foo extends function() {} { | ||
constructor(){ | ||
var _this; | ||
var foo = function() { | ||
return _this; | ||
}; | ||
if (true) { | ||
console.log((super(), _this = this), foo()); | ||
} else { | ||
super(), _this = this; | ||
console.log(foo()); | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/getter-setter/input.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const a = () => ({ | ||
get this() { this; arguments }, | ||
set arguments(a = this) { this; arguments }, | ||
get [this]() { this; arguments }, | ||
}) |
17 changes: 17 additions & 0 deletions
17
crates/swc_ecma_transforms_compat/tests/arrow/getter-setter/output.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var _this = this; | ||
const a1 = function() { | ||
return { | ||
get this () { | ||
this; | ||
arguments; | ||
}, | ||
set arguments (a = this){ | ||
this; | ||
arguments; | ||
}, | ||
get [_this] () { | ||
this; | ||
arguments; | ||
} | ||
}; | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/inside-call/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
arr.map(i => i + 1); |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/inside-call/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
arr.map(function(i) { | ||
return i + 1; | ||
}); |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-1/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
const foo = () => this |
4 changes: 4 additions & 0 deletions
4
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-1/output.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var _this = this; | ||
const foo = function() { | ||
return _this; | ||
}; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-2/input.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const foo = function () { | ||
() => () => () => this | ||
} |
10 changes: 10 additions & 0 deletions
10
crates/swc_ecma_transforms_compat/tests/arrow/issue-2212-2/output.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const foo = function() { | ||
var _this = this; | ||
(function() { | ||
return function() { | ||
return function() { | ||
return _this; | ||
}; | ||
}; | ||
}); | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/issue-233/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
const foo = () => ({ x, ...y }) => y |
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/issue-233/output.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const foo = function() { | ||
return function({ x , ...y }) { | ||
return y; | ||
}; | ||
}; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/issue-413/input.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const getBadgeBorderRadius = (text, color) => { | ||
return (text && style) || {} | ||
} |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/issue-413/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const getBadgeBorderRadius = function(text, color) { | ||
return text && style || {}; | ||
}; |
7 changes: 7 additions & 0 deletions
7
crates/swc_ecma_transforms_compat/tests/arrow/method-captured/input.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const a = () => ({ | ||
[this](a = this) { this; arguments }, | ||
}) | ||
const b = () => class { | ||
static [this]() { } | ||
[arguments]() { } | ||
} |
15 changes: 15 additions & 0 deletions
15
crates/swc_ecma_transforms_compat/tests/arrow/method-captured/output.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var _this = this; | ||
const a = function() { | ||
return { | ||
[_this] (a = this) { | ||
this; | ||
arguments; | ||
} | ||
}; | ||
}; | ||
const b = function() { | ||
return class { | ||
static [this]() {} | ||
[arguments]() {} | ||
}; | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/multiple-arguments/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
var t = (i, x) => i * x; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/multiple-arguments/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var t = function(i, x) { | ||
return i * x; | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/paren-insertion/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
var t = i => i * 5; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/paren-insertion/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var t = function(i) { | ||
return i * 5; | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_transforms_compat/tests/arrow/single-argument/input.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
var t = (i) => i * 5; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/single-argument/output.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var t = function(i) { | ||
return i * 5; | ||
}; |
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/statement/input.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
nums.forEach(v => { | ||
if (v % 5 === 0) { | ||
fives.push(v); | ||
} | ||
}); |
5 changes: 5 additions & 0 deletions
5
crates/swc_ecma_transforms_compat/tests/arrow/statement/output.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
nums.forEach(function(v) { | ||
if (v % 5 === 0) { | ||
fives.push(v); | ||
} | ||
}); |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_compat/tests/arrow/this-in-params/input.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const getBadgeBorderRadius = (text = this, color = arguments) => { | ||
return (text && style) || {} | ||
} |
4 changes: 4 additions & 0 deletions
4
crates/swc_ecma_transforms_compat/tests/arrow/this-in-params/output.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var _this = this, _arguments = arguments; | ||
export const getBadgeBorderRadius = function(text = _this, color = _arguments) { | ||
return text && style || {}; | ||
}; |
4 changes: 4 additions & 0 deletions
4
crates/swc_ecma_transforms_compat/tests/arrow/two-arrow/input.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let foo = () => this; | ||
let bar = () => this; | ||
let foo1 = () => arguments; | ||
let bar1 = () => arguments; |
13 changes: 13 additions & 0 deletions
13
crates/swc_ecma_transforms_compat/tests/arrow/two-arrow/output.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var _this = this, _arguments = arguments; | ||
let foo = function() { | ||
return _this; | ||
}; | ||
let bar = function() { | ||
return _this; | ||
}; | ||
let foo1 = function() { | ||
return _arguments; | ||
}; | ||
let bar1 = function() { | ||
return _arguments; | ||
}; |
Oops, something went wrong.
cc4646a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/bugs-1
427490
ns/iter (± 25483
)350392
ns/iter (± 19448
)1.22
es/full/minify/libraries/antd
2164778769
ns/iter (± 55831870
)1898511211
ns/iter (± 581464156
)1.14
es/full/minify/libraries/d3
455095668
ns/iter (± 37006585
)450979526
ns/iter (± 31006042
)1.01
es/full/minify/libraries/echarts
1834002752
ns/iter (± 56534552
)1601978219
ns/iter (± 28667172
)1.14
es/full/minify/libraries/jquery
120434670
ns/iter (± 3281561
)109828185
ns/iter (± 8901921
)1.10
es/full/minify/libraries/lodash
140268580
ns/iter (± 1341221
)132062228
ns/iter (± 11987289
)1.06
es/full/minify/libraries/moment
72196287
ns/iter (± 1747121
)63197456
ns/iter (± 2657598
)1.14
es/full/minify/libraries/react
24877755
ns/iter (± 672562
)21380738
ns/iter (± 527387
)1.16
es/full/minify/libraries/terser
324432633
ns/iter (± 22916747
)319114361
ns/iter (± 7801194
)1.02
es/full/minify/libraries/three
572280794
ns/iter (± 4147844
)572366211
ns/iter (± 12902778
)1.00
es/full/minify/libraries/typescript
3874189984
ns/iter (± 32924844
)3441050260
ns/iter (± 56977796
)1.13
es/full/minify/libraries/victory
878293545
ns/iter (± 45104561
)835860228
ns/iter (± 18617795
)1.05
es/full/minify/libraries/vue
179530844
ns/iter (± 7878381
)163406160
ns/iter (± 5170809
)1.10
es/full/codegen/es3
41604
ns/iter (± 2580
)33511
ns/iter (± 1034
)1.24
es/full/codegen/es5
39992
ns/iter (± 1763
)33534
ns/iter (± 1548
)1.19
es/full/codegen/es2015
39806
ns/iter (± 2689
)33559
ns/iter (± 472
)1.19
es/full/codegen/es2016
40047
ns/iter (± 1196
)33518
ns/iter (± 454
)1.19
es/full/codegen/es2017
40196
ns/iter (± 1112
)33557
ns/iter (± 1231
)1.20
es/full/codegen/es2018
40634
ns/iter (± 1292
)33591
ns/iter (± 1481
)1.21
es/full/codegen/es2019
40004
ns/iter (± 2293
)33485
ns/iter (± 1177
)1.19
es/full/codegen/es2020
40044
ns/iter (± 1370
)33625
ns/iter (± 1815
)1.19
es/full/all/es3
228574475
ns/iter (± 5720904
)206664286
ns/iter (± 12498926
)1.11
es/full/all/es5
219641587
ns/iter (± 9513814
)191500411
ns/iter (± 8490814
)1.15
es/full/all/es2015
175799988
ns/iter (± 8346251
)149312992
ns/iter (± 8069408
)1.18
es/full/all/es2016
176330961
ns/iter (± 7668247
)146712111
ns/iter (± 8617454
)1.20
es/full/all/es2017
172756372
ns/iter (± 4678786
)144623997
ns/iter (± 6551101
)1.19
es/full/all/es2018
171356401
ns/iter (± 4282540
)161296009
ns/iter (± 12676782
)1.06
es/full/all/es2019
170071991
ns/iter (± 5781264
)162354383
ns/iter (± 14501329
)1.05
es/full/all/es2020
163614586
ns/iter (± 10585798
)143815449
ns/iter (± 8530965
)1.14
es/full/parser
873173
ns/iter (± 28562
)710623
ns/iter (± 36070
)1.23
es/full/base/fixer
31921
ns/iter (± 498
)26710
ns/iter (± 690
)1.20
es/full/base/resolver_and_hygiene
113116
ns/iter (± 4782
)92088
ns/iter (± 3149
)1.23
serialization of ast node
247
ns/iter (± 7
)205
ns/iter (± 4
)1.20
serialization of serde
255
ns/iter (± 9
)213
ns/iter (± 5
)1.20
This comment was automatically generated by workflow using github-action-benchmark.