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

Side by Side Diff: runtime/lib/regexp.cc

Issue 12317130: Remove deprecated IllegalJSRegExpException class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/test/matchers_test.dart ('k') | runtime/lib/regexp_jsc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/bootstrap_natives.h" 6 #include "vm/bootstrap_natives.h"
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/native_entry.h" 8 #include "vm/native_entry.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 49
50 DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_getGroupCount, 1) { 50 DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_getGroupCount, 1) {
51 const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0)); 51 const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
52 ASSERT(!regexp.IsNull()); 52 ASSERT(!regexp.IsNull());
53 if (regexp.is_initialized()) { 53 if (regexp.is_initialized()) {
54 return regexp.num_bracket_expressions(); 54 return regexp.num_bracket_expressions();
55 } 55 }
56 const String& pattern = String::Handle(regexp.pattern()); 56 const String& pattern = String::Handle(regexp.pattern());
57 const String& errmsg = 57 const String& errmsg = String::Handle(
58 String::Handle(String::New("Regular expression is not initialized yet")); 58 String::New("Regular expression is not initialized yet. "));
59 const Array& args = Array::Handle(Array::New(2)); 59 const String& message = String::Handle(String::Concat(errmsg, pattern));
60 args.SetAt(0, pattern); 60 const Array& args = Array::Handle(Array::New(1));
61 args.SetAt(1, errmsg); 61 args.SetAt(0, message);
62 Exceptions::ThrowByType(Exceptions::kIllegalJSRegExp, args); 62 Exceptions::ThrowByType(Exceptions::kFormat, args);
63 return Object::null(); 63 return Object::null();
64 } 64 }
65 65
66 66
67 DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_ExecuteMatch, 3) { 67 DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_ExecuteMatch, 3) {
68 const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0)); 68 const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
69 ASSERT(!regexp.IsNull()); 69 ASSERT(!regexp.IsNull());
70 GET_NON_NULL_NATIVE_ARGUMENT(String, str, arguments->NativeArgAt(1)); 70 GET_NON_NULL_NATIVE_ARGUMENT(String, str, arguments->NativeArgAt(1));
71 GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2)); 71 GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2));
72 return Jscre::Execute(regexp, str, start_index.Value()); 72 return Jscre::Execute(regexp, str, start_index.Value());
73 } 73 }
74 74
75 } // namespace dart 75 } // namespace dart
OLDNEW
« no previous file with comments | « pkg/unittest/test/matchers_test.dart ('k') | runtime/lib/regexp_jsc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698