| Index: frog/lib/string_implementation.dart
|
| diff --git a/frog/lib/string_implementation.dart b/frog/lib/string_implementation.dart
|
| index 9d483d145ba632c2adfe7f69569e3b61bad3b534..b42409e2418a8e4b9fe483d5aea5acc691e42097 100644
|
| --- a/frog/lib/string_implementation.dart
|
| +++ b/frog/lib/string_implementation.dart
|
| @@ -79,10 +79,18 @@ return this.replace(from, to);""";
|
| }
|
|
|
| // TODO(jimhug): Get correct reified generic list here.
|
| - List<String> split(Pattern pattern) native {
|
| - return []; // tell the compiler an array is created
|
| + List<String> split(Pattern pattern) {
|
| + if (pattern is String) return _split(pattern);
|
| + if (pattern is RegExp) return _splitRegExp(pattern);
|
| + throw "String.split(Pattern) unimplemented.";
|
| }
|
|
|
| + List<String> _split(String pattern) native
|
| + "'use strict'; return this.split(pattern);";
|
| +
|
| + List<String> _splitRegExp(RegExp pattern) native
|
| + "'use strict'; return this.split(pattern.re);";
|
| +
|
| /*
|
| Iterable<Match> allMatches(String str) {
|
| List<Match> result = [];
|
|
|