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

Unified Diff: runtime/lib/simd128.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
« no previous file with comments | « runtime/lib/growable_array.cc ('k') | runtime/lib/string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/simd128.cc
diff --git a/runtime/lib/simd128.cc b/runtime/lib/simd128.cc
index e21655597fe97ca7d54b1a5ee47dc6826b0b2fa1..b9bf55cd37210e16148c286210e5c57a1eeffb00 100644
--- a/runtime/lib/simd128.cc
+++ b/runtime/lib/simd128.cc
@@ -13,12 +13,8 @@ namespace dart {
static void ThrowMaskRangeException(int64_t m) {
if ((m < 0) || (m > 255)) {
- const String& error = String::Handle(
- String::NewFormatted("mask (%" Pd64 ") must be in the range [0..256)",
- m));
- const Array& args = Array::Handle(Array::New(1));
- args.SetAt(0, error);
- Exceptions::ThrowByType(Exceptions::kRange, args);
+ Exceptions::ThrowRangeError(
+ "mask", Integer::Handle(Integer::New(m)), 0, 256);
}
}
« no previous file with comments | « runtime/lib/growable_array.cc ('k') | runtime/lib/string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698