ecma262 icon indicating copy to clipboard operation
ecma262 copied to clipboard

Editorial: Simplify the algorithms for Array and TypedArray constructors

Open gibson042 opened this issue 10 months ago • 2 comments

Remove some unnecessary condition nesting and a trivial assertion. The small scope of the changes is most obvious while ignoring whitespace.

gibson042 avatar Feb 26 '25 19:02 gibson042

I'm fine removing the assertion, but the elses I am less sure about. The early returns are technically the same, but I think the else if/else branches are easier to scan.

michaelficarra avatar Feb 27 '25 00:02 michaelficarra

FWIW, I feel more strongly about the TypedArray changes than the Array ones, because for me the excessive indentation (not to mention vertical expansion) makes it hard to follow.

gibson042 avatar Feb 27 '25 17:02 gibson042