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

Unified Diff: pkg/compiler/lib/src/kernel/kelements.dart

Issue 2969013002: Support creating elements from IR nodes in JsKernelToElementMap (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 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/compiler/lib/src/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kelements.dart
diff --git a/pkg/compiler/lib/src/kernel/kelements.dart b/pkg/compiler/lib/src/kernel/kelements.dart
index 4015af636ae2aff382b40b7d2706076a90210759..30d6f9e83ed615cbdbfa8f5098df4bfea0f4a3c8 100644
--- a/pkg/compiler/lib/src/kernel/kelements.dart
+++ b/pkg/compiler/lib/src/kernel/kelements.dart
@@ -9,6 +9,8 @@ import '../elements/names.dart';
import '../elements/types.dart';
import 'elements.dart';
+const String kElementPrefix = 'k';
+
class KLibrary implements IndexedLibrary {
/// Library index used for fast lookup in [KernelWorldBuilder].
final int libraryIndex;
@@ -17,7 +19,7 @@ class KLibrary implements IndexedLibrary {
KLibrary(this.libraryIndex, this.name, this.canonicalUri);
- String toString() => 'library($name)';
+ String toString() => '${kElementPrefix}library($name)';
}
class KClass implements IndexedClass {
@@ -34,7 +36,7 @@ class KClass implements IndexedClass {
@override
bool get isClosure => false;
- String toString() => 'class($name)';
+ String toString() => '${kElementPrefix}class($name)';
}
abstract class KMember implements IndexedMember {
@@ -88,8 +90,8 @@ abstract class KMember implements IndexedMember {
String get _kind;
- String toString() =>
- '$_kind(${enclosingClass != null ? '${enclosingClass.name}.' : ''}$name)';
+ String toString() => '${kElementPrefix}$_kind'
+ '(${enclosingClass != null ? '${enclosingClass.name}.' : ''}$name)';
}
abstract class KFunction extends KMember
@@ -233,7 +235,8 @@ class KTypeVariable implements TypeVariableEntity {
KTypeVariable(this.typeDeclaration, this.name, this.index);
- String toString() => 'type_variable(${typeDeclaration.name}.$name)';
+ String toString() =>
+ '${kElementPrefix}type_variable(${typeDeclaration.name}.$name)';
}
class KLocalFunction implements Local {
@@ -246,5 +249,5 @@ class KLocalFunction implements Local {
this.name, this.memberContext, this.executableContext, this.functionType);
String toString() =>
- 'local_function(${memberContext.name}.${name ?? '<anonymous>'})';
+ '${kElementPrefix}local_function(${memberContext.name}.${name ?? '<anonymous>'})';
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698