babel / babel/minify

minify-constant-folding: splitting a string may result in longer code

Open
#621 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

Expanding the example given in the readme (without extra space shown there) gives:

```js
"a,b,c,d,e,f,g".split(",");
["a","b","c","d","e","f","g"];
```

Contributor guide

Open the contributing guide

Research direction

Start with the expanded example in the README and trace the constant-folding behavior for String.prototype.split. Compare the minified output length with the original expression, then verify that folding is retained only when it does not produce longer code. The payload does not name a source file or test, so those must be located in the repository.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.