Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| index 91537ca0f93c9c6a7e6cfc60524f06e2290b9013..673e8b1b722a70743d20383d8adf64d5ac28a0dd 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| @@ -1294,6 +1294,24 @@ class JavaScriptBackend extends Backend { |
| } |
| } |
| + Element getDartClass(Element element) { |
|
Johnni Winther
2013/11/14 19:14:19
We have the reverse relation encoded somewhere in
karlklose
2013/11/15 08:44:52
It just below ;-)
Done.
|
| + if (element == jsIntClass) { |
| + return compiler.intClass; |
| + } else if (element == jsBoolClass) { |
| + return compiler.boolClass; |
| + } else if (element == jsNumberClass) { |
| + return compiler.numClass; |
| + } else if (element == jsDoubleClass) { |
| + return compiler.doubleClass; |
| + } else if (element == jsStringClass) { |
| + return compiler.stringClass; |
| + } else if (element == jsArrayClass) { |
| + return compiler.listClass; |
| + } else { |
| + return element; |
| + } |
| + } |
| + |
| Element getImplementationClass(Element element) { |
| if (element == compiler.intClass) { |
| return jsIntClass; |
| @@ -1737,6 +1755,7 @@ class JavaScriptBackend extends Backend { |
| * need to access it. |
| */ |
| bool isNeededForReflection(Element element) { |
| + element = getDartClass(element); |
| if (hasInsufficientMirrorsUsed) return isTreeShakingDisabled; |
| /// Record the name of [element] in [symbolsUsed]. Return true for |
| /// convenience. |