Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
index b3778465137137e10f9fc1613555cea6f6bc4da3..f1dde53d7f0f36950030d67d6dd4abf95f95b3b9 100644 |
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
@@ -1722,7 +1722,7 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
// property should not be mangled. |
push(new js.PropertyAccess.field(pop(), 'length'), node); |
} else { |
- String name = backend.namer.getName(node.element); |
+ String name = _fieldPropertyName(node.element); |
push(new js.PropertyAccess.field(pop(), name), node); |
HType receiverHType = types[node.receiver]; |
DartType type = receiverHType.computeType(compiler); |
@@ -1734,7 +1734,7 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
} |
visitFieldSet(HFieldSet node) { |
- String name = backend.namer.getName(node.element); |
+ String name = _fieldPropertyName(node.element); |
DartType type = types[node.receiver].computeType(compiler); |
if (type != null) { |
// Field setters in the generative constructor body are handled in a |
@@ -1750,9 +1750,13 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
js.Expression receiver = pop(); |
use(node.value); |
push(new js.Assignment(new js.PropertyAccess.field(receiver, name), pop()), |
- node); |
+ node); |
} |
+ String _fieldPropertyName(Element element) => element.isNative() |
+ ? element.nativeName() |
+ : backend.namer.getName(element); |
+ |
visitLocalGet(HLocalGet node) { |
use(node.receiver); |
} |