Skip to content

Variable mangling for names with single chars is unnecessary during destruction assignments #1217

Open

Description

@MaxGraey

terser version: 5.14.1

Edit terser options

{
  module: true,
  compress: {},
  ecma: 2020,
  mangle: {},
  output: {},
  parse: {},
  rename: {},
}

original sample:

window.sample = function (value) {
  const { a, b, c, d = 0n, e, f, g, h = 0n, i, j, k, l, m, n, o } = value;
}

terser suboptimal minification

window.sample=function(n){const{a:o,b:c,c:i,d:a=0n,e:d,f:e,g:f,h:l=0n,i:m,j:s,k:t,l:w,m:b,n:g,o:h}=n};

Expected result

window.sample=function(n){const{a,b,c,d=0n,e,f,g,h=0n,i,j,k,l,m,n,o}=n};

Activity

  1. changed the title [-]Variable mangling for single charred names is unnecessary during destruction assignments[/-] [+]Variable mangling for names with single chars is unnecessary during destruction assignments[/+] on Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions