-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
P4featFeature RequestFeature Requestgood first issueRelatively easy, but low priority bugsRelatively easy, but low priority bugshelp wanted
Description
Consider the code:
/** @const {!Array<number>} */
const a = [1];
/** @const {!Array<number>} */
const b = Array(10);
b[0] = 2;
/** @const {!Array<number>} */
const c = [];
c.push(3);
/** @const {!Array<number>} */
const d = Array(10);
d.push(4);
When compiled with
yarn google-closure-compiler -O ADVANCED --js a.js --rewrite_polyfills=false
we get
Array(10)[0]=2;Array(10).push(4);
Arrays created with the Array(len)
constructor are not eliminated.
google-closure-compiler version: v20230103
Metadata
Metadata
Assignees
Labels
P4featFeature RequestFeature Requestgood first issueRelatively easy, but low priority bugsRelatively easy, but low priority bugshelp wanted