ecma262
ecma262 copied to clipboard
Editorial: Simplify the algorithms for Array and TypedArray constructors
Remove some unnecessary condition nesting and a trivial assertion. The small scope of the changes is most obvious while ignoring whitespace.
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.
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.