Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_array.dart

Issue 1315523012: dart2js ssa: Open coding of removeLast should use -1 as index (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/js_runtime/lib/js_array.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_array.dart b/sdk/lib/_internal/js_runtime/lib/js_array.dart
index 51a8fb4dc1ee4eb3eeac3bff547ed79dace4ab5e..e3951e74406005f507578fa9ff33aa20af4e9d82 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_array.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_array.dart
@@ -150,7 +150,7 @@ class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
E removeLast() {
checkGrowable('removeLast');
- if (length == 0) throw new RangeError.value(-1);
+ if (length == 0) throw diagnoseIndexError(this, -1);
return JS('var', r'#.pop()', this);
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | tests/compiler/dart2js_extra/js_array_removeLast_error_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698