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

Unified Diff: runtime/lib/regexp.cc

Issue 11415028: Remove NullPointerException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed VM bugs. Created 8 years, 1 month 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/regexp.cc
diff --git a/runtime/lib/regexp.cc b/runtime/lib/regexp.cc
index 00088b5b0253c38e8962eabf9b607e61080b9ba1..969d5ffe39db4368d21f7446678f6867e82c0353 100644
--- a/runtime/lib/regexp.cc
+++ b/runtime/lib/regexp.cc
@@ -12,19 +12,9 @@
namespace dart {
-static void CheckAndThrowExceptionIfNull(const Instance& obj) {
- if (obj.IsNull()) {
- GrowableArray<const Object*> args;
- Exceptions::ThrowByType(Exceptions::kNullPointer, args);
- }
-}
-
-
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_factory, 4) {
ASSERT(AbstractTypeArguments::CheckedHandle(
arguments->NativeArgAt(0)).IsNull());
- const Instance& arg1 = Instance::CheckedHandle(arguments->NativeArgAt(1));
- CheckAndThrowExceptionIfNull(arg1);
GET_NATIVE_ARGUMENT(String, pattern, arguments->NativeArgAt(1));
GET_NATIVE_ARGUMENT(Instance, handle_multi_line, arguments->NativeArgAt(2));
GET_NATIVE_ARGUMENT(Instance, handle_ignore_case, arguments->NativeArgAt(3));
@@ -75,8 +65,6 @@ DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_getGroupCount, 1) {
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_ExecuteMatch, 3) {
const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!regexp.IsNull());
- const Instance& arg1 = Instance::CheckedHandle(arguments->NativeArgAt(1));
- CheckAndThrowExceptionIfNull(arg1);
GET_NATIVE_ARGUMENT(String, str, arguments->NativeArgAt(1));
GET_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2));
return Jscre::Execute(regexp, str, start_index.Value());

Powered by Google App Engine
This is Rietveld 408576698