Skip to content

Evaluate "foo".length ==> 3#501

Closed
Skalman wants to merge 1 commit intomishoo:masterfrom
Skalman:evaluate_length
Closed

Evaluate "foo".length ==> 3#501
Skalman wants to merge 1 commit intomishoo:masterfrom
Skalman:evaluate_length

Conversation

@Skalman
Copy link
Copy Markdown
Contributor

@Skalman Skalman commented Jun 30, 2014

This patch evaluates "foo".length into just 3, i.e. {string literal}.length into a {number}.

The evaluation is done only when options evaluate and unsafe are on.

@mishoo
Copy link
Copy Markdown
Owner

mishoo commented Jul 1, 2014

Merged, thanks.

@mishoo mishoo closed this Jul 1, 2014
0b10011 pushed a commit to 0b10011/UglifyJS2 that referenced this pull request Jul 13, 2014
@Skalman Skalman deleted the evaluate_length branch February 4, 2018 18:53
@Skalman Skalman restored the evaluate_length branch February 4, 2018 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants