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

Side by Side Diff: dart/lib/compiler/implementation/lib/regexp_helper.dart

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
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 part of js_helper;
6
7 List regExpExec(JSSyntaxRegExp regExp, String str) { 5 List regExpExec(JSSyntaxRegExp regExp, String str) {
8 var nativeRegExp = regExpGetNative(regExp); 6 var nativeRegExp = regExpGetNative(regExp);
9 var result = JS('List', r'#.exec(#)', nativeRegExp, str); 7 var result = JS('List', r'#.exec(#)', nativeRegExp, str);
10 if (JS('bool', r'# === null', result)) return null; 8 if (JS('bool', r'# === null', result)) return null;
11 return result; 9 return result;
12 } 10 }
13 11
14 bool regExpTest(JSSyntaxRegExp regExp, String str) { 12 bool regExpTest(JSSyntaxRegExp regExp, String str) {
15 var nativeRegExp = regExpGetNative(regExp); 13 var nativeRegExp = regExpGetNative(regExp);
16 return JS('bool', r'#.test(#)', nativeRegExp, str); 14 return JS('bool', r'#.test(#)', nativeRegExp, str);
(...skipping 22 matching lines...) Expand all
39 if (global) sb.add('g'); 37 if (global) sb.add('g');
40 try { 38 try {
41 return JS('Object', r'new RegExp(#, #)', pattern, sb.toString()); 39 return JS('Object', r'new RegExp(#, #)', pattern, sb.toString());
42 } catch (e) { 40 } catch (e) {
43 throw new IllegalJSRegExpException(pattern, 41 throw new IllegalJSRegExpException(pattern,
44 JS('String', r'String(#)', e)); 42 JS('String', r'String(#)', e));
45 } 43 }
46 } 44 }
47 45
48 int regExpMatchStart(m) => JS('int', r'#.index', m); 46 int regExpMatchStart(m) => JS('int', r'#.index', m);
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/lib/native_helper.dart ('k') | dart/lib/compiler/implementation/lib/string_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698