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

Unified Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 11369210: Make RegExp constructor non-const. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up status files. Created 8 years, 1 month 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
Index: sdk/lib/_internal/compiler/implementation/native_handler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 06596d22b71663bf284c2ec7960436f4767806ac..db579d390c26495a605b23c06d6d02738e870184 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -176,6 +176,8 @@ bool isOverriddenMethod(FunctionElement element,
return false;
}
+final RegExp nativeRedirectionRegExp = new RegExp(r'^[a-zA-Z][a-zA-Z_$0-9]*$');
+
void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
Compiler compiler = builder.compiler;
FunctionElement element = builder.work.element;
@@ -212,7 +214,6 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
// 1) foo() native; hasBody = false, isRedirecting = false
// 2) foo() native "bar"; hasBody = false, isRedirecting = true
// 3) foo() native "return 42"; hasBody = true, isRedirecting = false
- RegExp nativeRedirectionRegExp = const RegExp(r'^[a-zA-Z][a-zA-Z_$0-9]*$');
bool hasBody = false;
bool isRedirecting = false;
String nativeMethodName = element.name.slowToString();

Powered by Google App Engine
This is Rietveld 408576698