| Index: sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
|
| index 3a60f41ebf84c907dcb19a17fc5c6c04ae5bce93..e2e9e83dfb9e04f24c78c3fd99cf2dd69317f7b6 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
|
| @@ -636,12 +636,26 @@ class Namer implements ClosureNamer {
|
|
|
| /// Returns the runtime name for [element]. The result is not safe as an id.
|
| String getRuntimeTypeName(Element element) {
|
| - if (element == compiler.intClass) {
|
| + JavaScriptBackend backend = compiler.backend;
|
| + element = backend.getImplementationClass(element);
|
| + String name = getNativeName(element);
|
| + return name != null ? name : getName(element);
|
| + }
|
| +
|
| + String getNativeName(ClassElement cls) {
|
| + JavaScriptBackend backend = compiler.backend;
|
| + if (cls == backend.jsIntClass) {
|
| return 'int';
|
| - } else if (element == compiler.doubleClass) {
|
| + } else if (cls == backend.jsNumberClass) {
|
| + return 'num';
|
| + } else if (cls == backend.jsBoolClass) {
|
| + return 'bool';
|
| + } else if (cls == backend.jsDoubleClass) {
|
| return 'double';
|
| - } else {
|
| - return getName(element);
|
| + } else if (cls == backend.jsStringClass) {
|
| + return 'String';
|
| + } else if (cls == backend.jsArrayClass) {
|
| + return 'List';
|
| }
|
| }
|
|
|
|
|