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

Unified Diff: runtime/lib/typed_data.cc

Issue 533483003: Cleanup throwing of the RangeError in the runtime to remove duplicated code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: runtime/lib/typed_data.cc
diff --git a/runtime/lib/typed_data.cc b/runtime/lib/typed_data.cc
index 2ff65d7c2a0c42e0ac7d21ca58320ef0e00952a8..d7843df679ac7f5f276dfc3671ad8ca2d773ecff 100644
--- a/runtime/lib/typed_data.cc
+++ b/runtime/lib/typed_data.cc
@@ -25,9 +25,7 @@ static void RangeCheck(intptr_t offset_in_bytes,
"index (%" Pd ") must be in the range [0..%" Pd ")",
(offset_in_bytes + access_size) / element_size_in_bytes,
(length_in_bytes / element_size_in_bytes)));
- const Array& args = Array::Handle(Array::New(1));
- args.SetAt(0, error);
- Exceptions::ThrowByType(Exceptions::kRange, args);
+ Exceptions::ThrowRangeError(error);
}
}

Powered by Google App Engine
This is Rietveld 408576698