| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Generates the code for all used classes in the program. Static fields (even | 8 * Generates the code for all used classes in the program. Static fields (even |
| 9 * in classes) are ignored, since they can be treated as non-class elements. | 9 * in classes) are ignored, since they can be treated as non-class elements. |
| 10 * | 10 * |
| (...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 if (backend.requiresPreamble && | 1663 if (backend.requiresPreamble && |
| 1664 !backend.htmlLibraryIsLoaded) { | 1664 !backend.htmlLibraryIsLoaded) { |
| 1665 compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE); | 1665 compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE); |
| 1666 } | 1666 } |
| 1667 }); | 1667 }); |
| 1668 return compiler.assembledCode; | 1668 return compiler.assembledCode; |
| 1669 } | 1669 } |
| 1670 | 1670 |
| 1671 String generateSourceMapTag(Uri sourceMapUri, Uri fileUri) { | 1671 String generateSourceMapTag(Uri sourceMapUri, Uri fileUri) { |
| 1672 if (sourceMapUri != null && fileUri != null) { | 1672 if (sourceMapUri != null && fileUri != null) { |
| 1673 // Using # is the new proposed standard. @ caused problems in Internet | |
| 1674 // Explorer due to "Conditional Compilation Statements" in JScript, | |
| 1675 // see: | |
| 1676 // http://msdn.microsoft.com/en-us/library/7kx09ct1(v=vs.80).aspx | |
| 1677 // About source maps, see: | |
| 1678 // https://docs.google.com/a/google.com/document/d/1U1RGAehQwRypUTovF1KRlp
iOFze0b-_2gc6fAH0KY0k/edit | |
| 1679 // TODO(http://dartbug.com/11914): Remove @ line. | |
| 1680 String sourceMapFileName = relativize(fileUri, sourceMapUri, false); | 1673 String sourceMapFileName = relativize(fileUri, sourceMapUri, false); |
| 1681 return ''' | 1674 return ''' |
| 1682 | 1675 |
| 1683 //# sourceMappingURL=$sourceMapFileName | 1676 //# sourceMappingURL=$sourceMapFileName |
| 1684 //@ sourceMappingURL=$sourceMapFileName | |
| 1685 '''; | 1677 '''; |
| 1686 } | 1678 } |
| 1687 return ''; | 1679 return ''; |
| 1688 } | 1680 } |
| 1689 | 1681 |
| 1690 ClassBuilder getElementDescriptorForOutputUnit(Element element, | 1682 ClassBuilder getElementDescriptorForOutputUnit(Element element, |
| 1691 OutputUnit outputUnit) { | 1683 OutputUnit outputUnit) { |
| 1692 Map<OutputUnit, ClassBuilder> descriptors = | 1684 Map<OutputUnit, ClassBuilder> descriptors = |
| 1693 elementDescriptors.putIfAbsent( | 1685 elementDescriptors.putIfAbsent( |
| 1694 element, () => new Map<OutputUnit, ClassBuilder>()); | 1686 element, () => new Map<OutputUnit, ClassBuilder>()); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 1796 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 1805 if (element.isInstanceMember) { | 1797 if (element.isInstanceMember) { |
| 1806 cachedClassBuilders.remove(element.enclosingClass); | 1798 cachedClassBuilders.remove(element.enclosingClass); |
| 1807 | 1799 |
| 1808 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 1800 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 1809 | 1801 |
| 1810 } | 1802 } |
| 1811 } | 1803 } |
| 1812 } | 1804 } |
| 1813 } | 1805 } |
| OLD | NEW |