This repository was archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
length doesn't need an extension method #139
Comments
Funny, although now that I look, the setter is a bit different. Nevermind :) |
well, we could generate the reads as fyi setter is: void set length(int newLength) {
if (newLength is !int) throw new ArgumentError(newLength);
if (newLength < 0) throw new RangeError.value(newLength);
checkGrowable('set length');
JS('void', r'#.length = #', this, newLength);
} The is! int checks and <0 checks probably we don't need, but the checkGrowable seems needed. That said, Arrays can be subclassed in ES6 so maybe we could implement non-growable that way. |
related: #138 |
fyi @rakudrama just hit this. maybe we regressed .length special case at some point? |
going to close this out, if we hit again in perf investigations we can reopen |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The JS impl is exactly same signature/result as Dart.
(source: JSArray in dart2js)
The text was updated successfully, but these errors were encountered: