| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
| 9 * from the given element. | 9 * from the given element. |
| 10 */ | 10 */ |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 CodeBuffer getterBuffer = new CodeBuffer(); | 1222 CodeBuffer getterBuffer = new CodeBuffer(); |
| 1223 getterBuffer.add( | 1223 getterBuffer.add( |
| 1224 "function($joined) { return $getter.$closureCallName($joined); }"); | 1224 "function($joined) { return $getter.$closureCallName($joined); }"); |
| 1225 defineInstanceMember(invocationName, getterBuffer); | 1225 defineInstanceMember(invocationName, getterBuffer); |
| 1226 } | 1226 } |
| 1227 } | 1227 } |
| 1228 } | 1228 } |
| 1229 | 1229 |
| 1230 void emitStaticNonFinalFieldInitializations(CodeBuffer buffer) { | 1230 void emitStaticNonFinalFieldInitializations(CodeBuffer buffer) { |
| 1231 ConstantHandler handler = compiler.constantHandler; | 1231 ConstantHandler handler = compiler.constantHandler; |
| 1232 List<VariableElement> staticNonFinalFields = | 1232 Iterable<VariableElement> staticNonFinalFields = |
| 1233 handler.getStaticNonFinalFieldsForEmission(); | 1233 handler.getStaticNonFinalFieldsForEmission(); |
| 1234 for (Element element in staticNonFinalFields) { | 1234 for (Element element in staticNonFinalFields) { |
| 1235 buffer.add('$isolateProperties.${namer.getName(element)} = '); | 1235 buffer.add('$isolateProperties.${namer.getName(element)} = '); |
| 1236 compiler.withCurrentElement(element, () { | 1236 compiler.withCurrentElement(element, () { |
| 1237 Constant initialValue = handler.getInitialValueFor(element); | 1237 Constant initialValue = handler.getInitialValueFor(element); |
| 1238 writeConstantToBuffer(initialValue, buffer); | 1238 writeConstantToBuffer(initialValue, buffer); |
| 1239 }); | 1239 }); |
| 1240 buffer.add(';\n'); | 1240 buffer.add(';\n'); |
| 1241 } | 1241 } |
| 1242 } | 1242 } |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 const String HOOKS_API_USAGE = """ | 1661 const String HOOKS_API_USAGE = """ |
| 1662 // Generated by dart2js, the Dart to JavaScript compiler. | 1662 // Generated by dart2js, the Dart to JavaScript compiler. |
| 1663 // The code supports the following hooks: | 1663 // The code supports the following hooks: |
| 1664 // dartPrint(message) - if this function is defined it is called | 1664 // dartPrint(message) - if this function is defined it is called |
| 1665 // instead of the Dart [print] method. | 1665 // instead of the Dart [print] method. |
| 1666 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1666 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 1667 // method will not be invoked directly. | 1667 // method will not be invoked directly. |
| 1668 // Instead, a closure that will invoke [main] is | 1668 // Instead, a closure that will invoke [main] is |
| 1669 // passed to [dartMainRunner]. | 1669 // passed to [dartMainRunner]. |
| 1670 """; | 1670 """; |
| OLD | NEW |