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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart

Issue 2739863003: Add option to suppress type-check whitelisting (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart ('k') | pkg/dev_compiler/tool/run.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart b/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart
index fbd78955a3c88fda5f10aa861f4068666233ac60..a8fb4ccc17f549d5c7b62a05d90b24a49e0533fc 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/regexp_helper.dart
@@ -7,6 +7,8 @@ part of dart._js_helper;
// Helper method used by internal libraries.
regExpGetNative(JSSyntaxRegExp regexp) => regexp._nativeRegExp;
+List<String> _stringList(List l) => l == null ? l : JS('', 'dart.list(#, #)', l, String);
+
/**
* Returns a native version of the RegExp with the global flag set.
*
@@ -105,12 +107,12 @@ class JSSyntaxRegExp implements RegExp {
}
Match firstMatch(String string) {
- List<String> m = JS('JSExtendableArray|Null',
+ List m = JS('JSExtendableArray|Null',
r'#.exec(#)',
_nativeRegExp,
checkString(string));
if (m == null) return null;
- return new _MatchImplementation(this, m);
+ return new _MatchImplementation(this, _stringList(m));
}
bool hasMatch(String string) {
@@ -137,7 +139,7 @@ class JSSyntaxRegExp implements RegExp {
JS("void", "#.lastIndex = #", regexp, start);
List match = JS("JSExtendableArray|Null", "#.exec(#)", regexp, string);
if (match == null) return null;
- return new _MatchImplementation(this, match);
+ return new _MatchImplementation(this, _stringList(match));
}
Match _execAnchored(String string, int start) {
@@ -149,7 +151,7 @@ class JSSyntaxRegExp implements RegExp {
// match at the start position.
if (match[match.length - 1] != null) return null;
match.length -= 1;
- return new _MatchImplementation(this, match);
+ return new _MatchImplementation(this, _stringList(match));
}
Match matchAsPrefix(String string, [int start = 0]) {
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart ('k') | pkg/dev_compiler/tool/run.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698