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

Unified Diff: pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart

Issue 1198293002: dart2js: Use an abstract Name class for names in the generated JavaScript ast. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix tests Created 5 years, 6 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
Index: pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
diff --git a/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart b/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
index a781cebbbb0fa9f452a1fa951ab891c4d4ea77bb..003ab69a94c572fc130ca6a0aa6612b2fd8d58b2 100644
--- a/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
+++ b/pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart
@@ -88,8 +88,8 @@ class PropertyCheckedModeHelper extends CheckedModeHelper {
HTypeConversion node,
List<jsAst.Expression> arguments) {
DartType type = node.typeExpression;
- String additionalArgument = codegen.backend.namer.operatorIsType(type);
- arguments.add(js.string(additionalArgument));
+ jsAst.Name additionalArgument = codegen.backend.namer.operatorIsType(type);
+ arguments.add(js.quoteName(additionalArgument));
}
}
@@ -113,11 +113,11 @@ class SubtypeCheckedModeHelper extends CheckedModeHelper {
List<jsAst.Expression> arguments) {
DartType type = node.typeExpression;
Element element = type.element;
- String isField = codegen.backend.namer.operatorIs(element);
- arguments.add(js.string(isField));
+ jsAst.Name isField = codegen.backend.namer.operatorIs(element);
+ arguments.add(js.quoteName(isField));
codegen.use(node.typeRepresentation);
arguments.add(codegen.pop());
- String asField = codegen.backend.namer.substitutionName(element);
- arguments.add(js.string(asField));
+ jsAst.Name asField = codegen.backend.namer.substitutionName(element);
+ arguments.add(js.quoteName(asField));
}
}

Powered by Google App Engine
This is Rietveld 408576698