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

Unified Diff: runtime/lib/regexp.cc

Issue 9669054: Fox issue 2108: throw illegal argument exception for RegExp natives. Continue throwin NPE where exp… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/regexp.cc
===================================================================
--- runtime/lib/regexp.cc (revision 5328)
+++ runtime/lib/regexp.cc (working copy)
@@ -22,11 +22,11 @@
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_factory, 4) {
ASSERT(AbstractTypeArguments::CheckedHandle(arguments->At(0)).IsNull());
- const String& pattern = String::CheckedHandle(arguments->At(1));
- CheckAndThrowExceptionIfNull(pattern);
- const Instance& handle_multi_line = Instance::CheckedHandle(arguments->At(2));
- const Instance& handle_ignore_case =
- Instance::CheckedHandle(arguments->At(3));
+ const Instance& arg1 = Instance::CheckedHandle(arguments->At(1));
+ CheckAndThrowExceptionIfNull(arg1);
siva 2012/03/12 18:49:01 Not sure how many times this comes up where we hav
srdjan 2012/03/12 19:01:13 JSSyntaxRegExp are the only place where an illegal
+ GET_NATIVE_ARGUMENT(String, pattern, arguments->At(1));
siva 2012/03/12 18:49:01 Another unrelated question, the macro GET_NATIVE_A
srdjan 2012/03/12 19:01:13 Generated code can never pass a non-Instance objec
+ GET_NATIVE_ARGUMENT(Instance, handle_multi_line, arguments->At(2));
+ GET_NATIVE_ARGUMENT(Instance, handle_ignore_case, arguments->At(3));
bool ignore_case = handle_ignore_case.raw() == Bool::True();
bool multi_line = handle_multi_line.raw() == Bool::True();
const JSRegExp& new_regex = JSRegExp::Handle(
@@ -80,9 +80,10 @@
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_ExecuteMatch, 3) {
const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->At(0));
ASSERT(!regexp.IsNull());
- const String& str = String::CheckedHandle(arguments->At(1));
- CheckAndThrowExceptionIfNull(str);
- const Smi& start_index = Smi::CheckedHandle(arguments->At(2));
+ const Instance& arg1 = Instance::CheckedHandle(arguments->At(1));
+ CheckAndThrowExceptionIfNull(arg1);
+ GET_NATIVE_ARGUMENT(String, str, arguments->At(1));
+ GET_NATIVE_ARGUMENT(Smi, start_index, arguments->At(2));
const Array& result =
Array::Handle(Jscre::Execute(regexp, str, start_index.Value()));
arguments->SetReturn(result);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698