| 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 /** | 5 /** |
| 6 * A function element that represents a closure call. The signature is copied | 6 * A function element that represents a closure call. The signature is copied |
| 7 * from the given element. | 7 * from the given element. |
| 8 */ | 8 */ |
| 9 class ClosureInvocationElement extends FunctionElement { | 9 class ClosureInvocationElement extends FunctionElement { |
| 10 ClosureInvocationElement(SourceString name, | 10 ClosureInvocationElement(SourceString name, |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 emitStaticFunctions(mainBuffer); | 1305 emitStaticFunctions(mainBuffer); |
| 1306 emitStaticFunctionGetters(mainBuffer); | 1306 emitStaticFunctionGetters(mainBuffer); |
| 1307 // We need to finish the classes before we construct compile time | 1307 // We need to finish the classes before we construct compile time |
| 1308 // constants. | 1308 // constants. |
| 1309 emitFinishClassesInvocationIfNecessary(mainBuffer); | 1309 emitFinishClassesInvocationIfNecessary(mainBuffer); |
| 1310 emitCompileTimeConstants(mainBuffer); | 1310 emitCompileTimeConstants(mainBuffer); |
| 1311 // Static field initializations require the classes and compile-time | 1311 // Static field initializations require the classes and compile-time |
| 1312 // constants to be set up. | 1312 // constants to be set up. |
| 1313 emitStaticNonFinalFieldInitializations(mainBuffer); | 1313 emitStaticNonFinalFieldInitializations(mainBuffer); |
| 1314 emitLazilyInitializedStaticFields(mainBuffer); | 1314 emitLazilyInitializedStaticFields(mainBuffer); |
| 1315 if (compiler.enabledRuntimeType) { |
| 1316 mainBuffer.add('$isolateProperties.runtimeTypeCache = {};\n'); |
| 1317 } |
| 1315 | 1318 |
| 1316 isolateProperties = isolatePropertiesName; | 1319 isolateProperties = isolatePropertiesName; |
| 1317 // The following code should not use the short-hand for the | 1320 // The following code should not use the short-hand for the |
| 1318 // initialStatics. | 1321 // initialStatics. |
| 1319 mainBuffer.add('var ${namer.CURRENT_ISOLATE} = null;\n'); | 1322 mainBuffer.add('var ${namer.CURRENT_ISOLATE} = null;\n'); |
| 1320 mainBuffer.add(boundClosureBuffer); | 1323 mainBuffer.add(boundClosureBuffer); |
| 1321 emitFinishClassesInvocationIfNecessary(mainBuffer); | 1324 emitFinishClassesInvocationIfNecessary(mainBuffer); |
| 1322 // After this assignment we will produce invalid JavaScript code if we use | 1325 // After this assignment we will produce invalid JavaScript code if we use |
| 1323 // the classesCollector variable. | 1326 // the classesCollector variable. |
| 1324 classesCollector = 'classesCollector should not be used from now on'; | 1327 classesCollector = 'classesCollector should not be used from now on'; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 const String HOOKS_API_USAGE = """ | 1365 const String HOOKS_API_USAGE = """ |
| 1363 // Generated by dart2js, the Dart to JavaScript compiler. | 1366 // Generated by dart2js, the Dart to JavaScript compiler. |
| 1364 // The code supports the following hooks: | 1367 // The code supports the following hooks: |
| 1365 // dartPrint(message) - if this function is defined it is called | 1368 // dartPrint(message) - if this function is defined it is called |
| 1366 // instead of the Dart [print] method. | 1369 // instead of the Dart [print] method. |
| 1367 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1370 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 1368 // method will not be invoked directly. | 1371 // method will not be invoked directly. |
| 1369 // Instead, a closure that will invoke [main] is | 1372 // Instead, a closure that will invoke [main] is |
| 1370 // passed to [dartMainRunner]. | 1373 // passed to [dartMainRunner]. |
| 1371 """; | 1374 """; |
| OLD | NEW |