-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/compat): Fix handling of objects in generator (#5861)
- Loading branch information
1 parent
b972c7a
commit 006c7fb
Showing
27 changed files
with
396 additions
and
141 deletions.
There are no files selected for viewing
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,25 @@ | ||
const result = []; | ||
async function* foo() { | ||
const input = ["hello", "swc"]; | ||
|
||
for (i of input) { | ||
result.push({ x: i }); | ||
result.push({ y: await i }); | ||
result.push({ | ||
a: 1, | ||
b: yield i, | ||
}); | ||
} | ||
} | ||
|
||
const iter = foo(); | ||
|
||
async function main() { | ||
let state; | ||
for (let x = await iter.next(); !x.done; x = await iter.next(state)) { | ||
state = `[${x.value}]`; | ||
} | ||
console.log(result); | ||
} | ||
|
||
main(); |
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
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
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
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
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
Oops, something went wrong.
006c7fb
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/minify/libraries/antd
2297059795
ns/iter (± 74760727
)2543061911
ns/iter (± 93729760
)0.90
es/full/minify/libraries/d3
412497519
ns/iter (± 28634860
)476860001
ns/iter (± 21167008
)0.87
es/full/minify/libraries/echarts
1743320496
ns/iter (± 44812295
)1990129563
ns/iter (± 111055023
)0.88
es/full/minify/libraries/jquery
101974170
ns/iter (± 3114699
)119154090
ns/iter (± 7768331
)0.86
es/full/minify/libraries/lodash
147975267
ns/iter (± 16310459
)148338265
ns/iter (± 24435256
)1.00
es/full/minify/libraries/moment
75471888
ns/iter (± 9863422
)69263290
ns/iter (± 1602318
)1.09
es/full/minify/libraries/react
26390890
ns/iter (± 3035475
)26022245
ns/iter (± 1106336
)1.01
es/full/minify/libraries/terser
342470191
ns/iter (± 4256364
)407622600
ns/iter (± 18400690
)0.84
es/full/minify/libraries/three
584648748
ns/iter (± 13266096
)664445128
ns/iter (± 83566893
)0.88
es/full/minify/libraries/typescript
4608632258
ns/iter (± 152264376
)6304686446
ns/iter (± 473009593
)0.73
es/full/minify/libraries/victory
914330618
ns/iter (± 37657028
)1168125874
ns/iter (± 125089883
)0.78
es/full/minify/libraries/vue
157794540
ns/iter (± 13855059
)217963624
ns/iter (± 45302083
)0.72
es/full/codegen/es3
33826
ns/iter (± 2285
)45383
ns/iter (± 7645
)0.75
es/full/codegen/es5
33814
ns/iter (± 1112
)47380
ns/iter (± 11698
)0.71
es/full/codegen/es2015
33749
ns/iter (± 710
)42718
ns/iter (± 11464
)0.79
es/full/codegen/es2016
34002
ns/iter (± 792
)42635
ns/iter (± 10012
)0.80
es/full/codegen/es2017
33816
ns/iter (± 619
)46418
ns/iter (± 7757
)0.73
es/full/codegen/es2018
37571
ns/iter (± 13644
)42417
ns/iter (± 7318
)0.89
es/full/codegen/es2019
34196
ns/iter (± 1937
)41999
ns/iter (± 7101
)0.81
es/full/codegen/es2020
33988
ns/iter (± 1313
)41359
ns/iter (± 5842
)0.82
es/full/all/es3
234900318
ns/iter (± 24204226
)261399151
ns/iter (± 31584831
)0.90
es/full/all/es5
212086010
ns/iter (± 24359944
)249904085
ns/iter (± 42449817
)0.85
es/full/all/es2015
169848596
ns/iter (± 14306371
)187161057
ns/iter (± 47491756
)0.91
es/full/all/es2016
170218866
ns/iter (± 17090428
)208658496
ns/iter (± 141930703
)0.82
es/full/all/es2017
168928720
ns/iter (± 14401327
)193286661
ns/iter (± 35309013
)0.87
es/full/all/es2018
168340245
ns/iter (± 20437957
)186475971
ns/iter (± 28501583
)0.90
es/full/all/es2019
164304591
ns/iter (± 19897878
)185289414
ns/iter (± 26777268
)0.89
es/full/all/es2020
158187137
ns/iter (± 13473992
)182706317
ns/iter (± 29698631
)0.87
es/full/parser
784267
ns/iter (± 62833
)891559
ns/iter (± 171113
)0.88
es/full/base/fixer
30858
ns/iter (± 5073
)37222
ns/iter (± 4178
)0.83
es/full/base/resolver_and_hygiene
104331
ns/iter (± 21551
)122893
ns/iter (± 17769
)0.85
serialization of ast node
222
ns/iter (± 5
)269
ns/iter (± 49
)0.83
serialization of serde
226
ns/iter (± 3
)275
ns/iter (± 70
)0.82
This comment was automatically generated by workflow using github-action-benchmark.