Chromium Code Reviews| Index: dart/frog/leg/lib/regexp_helper.dart |
| diff --git a/dart/frog/leg/lib/regexp_helper.dart b/dart/frog/leg/lib/regexp_helper.dart |
| index 32fae10e31d655d23a8bb644efdd82669d7773b6..5cdd9d9f0e613e2ba17bb7155ab8ed63edd36899 100644 |
| --- a/dart/frog/leg/lib/regexp_helper.dart |
| +++ b/dart/frog/leg/lib/regexp_helper.dart |
| @@ -14,15 +14,19 @@ class RegExpWrapper { |
| ignoreCase == true ? 'i' : ''}${ |
| global == true ? 'g' : ''}"); |
| + RegExpWrapper.fromRegExp(other, global) |
| + // TODO(ahe): Use redirection. |
|
ngeoffray
2012/02/21 12:15:53
Should be supported now.
|
| + : re = makeRegExp(other.pattern, "${other.multiLine == true ? 'm' : ''}${ |
| + other.ignoreCase == true ? 'i' : ''}${ |
| + global == true ? 'g' : ''}"); |
| + |
| exec(str) { |
| var result = JS('List', @'$0.exec($1)', re, checkString(str)); |
| if (JS('bool', @'$0 === null', result)) return null; |
| return result; |
| } |
| - lastIndex() => JS('List', @'$0.lastIndex', re); |
| - |
| - test(str) => JS('List', @'$0.test($1)', re, checkString(str)); |
| + test(str) => JS('bool', @'$0.test($1)', re, checkString(str)); |
| static matchStart(m) => JS('int', @'$0.index', m); |
| @@ -36,3 +40,5 @@ class RegExpWrapper { |
| } |
| } |
| } |
| + |
| +stringify(x) => x === null ? "" : x.toString(); |