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

Side by Side Diff: dart/frog/leg/lib/regexp_helper.dart

Issue 9605009: Don't stringify unmatched groups and throw IllegalArgumentException for bad date strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Mention co19 issue number. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/frog/leg/lib/mockimpl.dart ('k') | dart/tests/co19/co19-leg.status » ('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 class RegExpWrapper { 5 class RegExpWrapper {
6 final re; 6 final re;
7 7
8 // TODO(ahe): This constructor is clearly not const. We need some 8 // TODO(ahe): This constructor is clearly not const. We need some
9 // better way to handle constant regular expressions. One might 9 // better way to handle constant regular expressions. One might
10 // question if regular expressions are really constant as we have 10 // question if regular expressions are really constant as we have
(...skipping 22 matching lines...) Expand all
33 static makeRegExp(pattern, flags) { 33 static makeRegExp(pattern, flags) {
34 checkString(pattern); 34 checkString(pattern);
35 try { 35 try {
36 return JS('Object', @'new RegExp($0, $1)', pattern, flags); 36 return JS('Object', @'new RegExp($0, $1)', pattern, flags);
37 } catch (var e) { 37 } catch (var e) {
38 throw new IllegalJSRegExpException(pattern, 38 throw new IllegalJSRegExpException(pattern,
39 JS('String', @'String($0)', e)); 39 JS('String', @'String($0)', e));
40 } 40 }
41 } 41 }
42 } 42 }
43
44 stringify(x) => x === null ? "" : x.toString();
OLDNEW
« no previous file with comments | « dart/frog/leg/lib/mockimpl.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698