Skip to content

Fix emit for nested object rest in assignment pattern - #52922

Merged
Ron Buckton (rbuckton) merged 3 commits into
mainfrom
fix-nested-object-rest
Feb 23, 2023
Merged

Ron Buckton (rbuckton) merged 3 commits into
mainfrom
fix-nested-object-rest

Conversation

@rbuckton

@rbuckton Ron Buckton (rbuckton) commented Feb 22, 2023 •

Copy link
Copy Markdown
Contributor

This fixes the downlevel emit for object rest destructuring when nested in an array destructuring, or in the ForInitializer of a for..of loop. This does not fix the emit for for..in, however, as we currently report an error for that cases.

Fixes #43400

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) perf test faster

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 22, 2023 •

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the abridged perf test suite on this PR at 773caf5. You can monitor the build here.

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..52922

Metric main 52922 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 358,876k (± 0.00%) 358,868k (± 0.01%) ~ 358,827k 358,916k p=0.575 n=6
Parse Time 3.72s (± 0.53%) 3.72s (± 0.28%) ~ 3.71s 3.74s p=0.802 n=6
Bind Time 1.19s (± 0.92%) 1.19s (± 0.83%) ~ 1.17s 1.20s p=0.929 n=6
Check Time 9.46s (± 0.33%) 9.45s (± 0.48%) ~ 9.41s 9.52s p=0.872 n=6
Emit Time 7.94s (± 0.97%) 7.90s (± 0.63%) ~ 7.83s 7.96s p=0.296 n=6
Total Time 22.32s (± 0.43%) 22.26s (± 0.32%) ~ 22.15s 22.37s p=0.261 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 191,955k (± 0.71%) 191,919k (± 0.67%) ~ 191,290k 194,531k p=1.000 n=6
Parse Time 1.57s (± 0.87%) 1.56s (± 0.77%) ~ 1.54s 1.57s p=0.145 n=6
Bind Time 0.82s (± 0.50%) 0.82s (± 0.50%) ~ 0.82s 0.83s p=0.218 n=6
Check Time 10.11s (± 0.27%) 10.06s (± 0.89%) ~ 9.99s 10.23s p=0.090 n=6
Emit Time 3.00s (± 1.01%) 3.00s (± 0.84%) ~ 2.97s 3.03s p=1.000 n=6
Total Time 15.50s (± 0.34%) 15.44s (± 0.50%) ~ 15.34s 15.57s p=0.147 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,080k (± 0.00%) 343,091k (± 0.00%) ~ 343,077k 343,103k p=0.172 n=6
Parse Time 2.80s (± 0.32%) 2.79s (± 0.15%) -0.01s (- 0.42%) 2.78s 2.79s p=0.025 n=6
Bind Time 1.08s (± 0.50%) 1.08s (± 0.00%) ~ 1.08s 1.08s p=0.071 n=6
Check Time 7.70s (± 0.42%) 7.66s (± 0.32%) -0.05s (- 0.61%) 7.62s 7.69s p=0.036 n=6
Emit Time 4.44s (± 0.63%) 4.43s (± 0.90%) ~ 4.38s 4.50s p=0.808 n=6
Total Time 16.02s (± 0.32%) 15.96s (± 0.26%) ~ 15.91s 16.02s p=0.064 n=6
TFS - node (v16.17.1, x64)
Memory used 299,214k (± 0.01%) 299,237k (± 0.01%) ~ 299,200k 299,261k p=0.199 n=6
Parse Time 2.18s (± 0.69%) 2.20s (± 0.60%) ~ 2.18s 2.22s p=0.103 n=6
Bind Time 1.23s (± 1.22%) 1.24s (± 0.83%) ~ 1.22s 1.25s p=0.864 n=6
Check Time 7.18s (± 0.53%) 7.19s (± 0.55%) ~ 7.13s 7.25s p=0.418 n=6
Emit Time 4.37s (± 0.77%) 4.34s (± 0.40%) ~ 4.32s 4.37s p=0.167 n=6
Total Time 14.96s (± 0.41%) 14.97s (± 0.39%) ~ 14.89s 15.05s p=0.871 n=6
material-ui - node (v16.17.1, x64)
Memory used 475,754k (± 0.01%) 475,760k (± 0.02%) ~ 475,670k 475,906k p=0.936 n=6
Parse Time 3.33s (± 0.41%) 3.32s (± 0.31%) ~ 3.31s 3.34s p=0.190 n=6
Bind Time 0.96s (± 0.42%) 0.96s (± 0.00%) ~ 0.96s 0.96s p=0.405 n=6
Check Time 18.14s (± 0.83%) 18.05s (± 0.31%) ~ 17.98s 18.15s p=0.228 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.44s (± 0.61%) 22.33s (± 0.23%) ~ 22.27s 22.42s p=0.065 n=6
xstate - node (v16.17.1, x64)
Memory used 545,746k (± 0.02%) 545,756k (± 0.02%) ~ 545,635k 545,890k p=0.689 n=6
Parse Time 4.25s (± 0.33%) 4.26s (± 0.50%) ~ 4.24s 4.30s p=0.413 n=6
Bind Time 1.74s (± 0.43%) 1.74s (± 0.96%) ~ 1.72s 1.76s p=0.742 n=6
Check Time 3.00s (± 0.54%) 2.98s (± 0.28%) ~ 2.98s 3.00s p=0.198 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 4.45%) ~ 0.09s 0.10s p=0.405 n=6
Total Time 9.08s (± 0.31%) 9.08s (± 0.34%) ~ 9.05s 9.13s p=0.934 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52922 6
Baseline main 6

Developer Information:

Download Benchmark

Comment thread src/compiler/factory/utilities.ts Resolved
@rbuckton
Ron Buckton (rbuckton) merged commit 8becdf2 into main Feb 23, 2023
@rbuckton
Ron Buckton (rbuckton) deleted the fix-nested-object-rest branch February 23, 2023 01:41
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested object rest in destructuring results in code with a syntax error

3 participants