| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.js_emitter.full_emitter; | 5 library dart2js.js_emitter.full_emitter; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:collection' show HashMap; | 8 import 'dart:collection' show HashMap; |
| 9 | 9 |
| 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 return ''' | 1826 return ''' |
| 1827 | 1827 |
| 1828 //# sourceMappingURL=$sourceMapFileName | 1828 //# sourceMappingURL=$sourceMapFileName |
| 1829 '''; | 1829 '''; |
| 1830 } | 1830 } |
| 1831 return ''; | 1831 return ''; |
| 1832 } | 1832 } |
| 1833 | 1833 |
| 1834 ClassBuilder getElementDescriptor(Element element, Fragment fragment) { | 1834 ClassBuilder getElementDescriptor(Element element, Fragment fragment) { |
| 1835 Element owner = element.library; | 1835 Element owner = element.library; |
| 1836 if (!element.isLibrary && !element.isTopLevel && !element.isNative) { | 1836 if (!element.isLibrary && |
| 1837 !element.isTopLevel && |
| 1838 !backend.isNative(element)) { |
| 1837 // For static (not top level) elements, record their code in a buffer | 1839 // For static (not top level) elements, record their code in a buffer |
| 1838 // specific to the class. For now, not supported for native classes and | 1840 // specific to the class. For now, not supported for native classes and |
| 1839 // native elements. | 1841 // native elements. |
| 1840 ClassElement cls = | 1842 ClassElement cls = |
| 1841 element.enclosingClassOrCompilationUnit.declaration; | 1843 element.enclosingClassOrCompilationUnit.declaration; |
| 1842 if (compiler.codegenWorld.directlyInstantiatedClasses.contains(cls) && | 1844 if (compiler.codegenWorld.directlyInstantiatedClasses.contains(cls) && |
| 1843 !cls.isNative && | 1845 !backend.isNative(cls) && |
| 1844 compiler.deferredLoadTask.outputUnitForElement(element) == | 1846 compiler.deferredLoadTask.outputUnitForElement(element) == |
| 1845 compiler.deferredLoadTask.outputUnitForElement(cls)) { | 1847 compiler.deferredLoadTask.outputUnitForElement(cls)) { |
| 1846 owner = cls; | 1848 owner = cls; |
| 1847 } | 1849 } |
| 1848 } | 1850 } |
| 1849 if (owner == null) { | 1851 if (owner == null) { |
| 1850 reporter.internalError(element, 'Owner is null.'); | 1852 reporter.internalError(element, 'Owner is null.'); |
| 1851 } | 1853 } |
| 1852 return elementDescriptors | 1854 return elementDescriptors |
| 1853 .putIfAbsent(fragment, () => new Map<Element, ClassBuilder>()) | 1855 .putIfAbsent(fragment, () => new Map<Element, ClassBuilder>()) |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2122 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2121 if (element.isInstanceMember) { | 2123 if (element.isInstanceMember) { |
| 2122 cachedClassBuilders.remove(element.enclosingClass); | 2124 cachedClassBuilders.remove(element.enclosingClass); |
| 2123 | 2125 |
| 2124 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2126 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2125 | 2127 |
| 2126 } | 2128 } |
| 2127 } | 2129 } |
| 2128 } | 2130 } |
| 2129 } | 2131 } |
| OLD | NEW |