| 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 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 void generateFunctionTypeSignature(Element method, FunctionType type) { | 1360 void generateFunctionTypeSignature(Element method, FunctionType type) { |
| 1361 assert(method.isImplementation); | 1361 assert(method.isImplementation); |
| 1362 String thisAccess = 'this'; | 1362 String thisAccess = 'this'; |
| 1363 Node node = method.parseNode(compiler); | 1363 Node node = method.parseNode(compiler); |
| 1364 ClosureClassMap closureData = | 1364 ClosureClassMap closureData = |
| 1365 compiler.closureToClassMapper.closureMappingCache[node]; | 1365 compiler.closureToClassMapper.closureMappingCache[node]; |
| 1366 if (closureData != null) { | 1366 if (closureData != null) { |
| 1367 Element thisElement = | 1367 Element thisElement = |
| 1368 closureData.freeVariableMapping[closureData.thisElement]; | 1368 closureData.freeVariableMapping[closureData.thisElement]; |
| 1369 if (thisElement != null) { | 1369 if (thisElement != null) { |
| 1370 String thisName = backend.namer.getName(thisElement); | 1370 assert(thisElement.hasFixedBackendName()); |
| 1371 String thisName = thisElement.fixedBackendName(); |
| 1371 thisAccess = 'this.$thisName'; | 1372 thisAccess = 'this.$thisName'; |
| 1372 } | 1373 } |
| 1373 } | 1374 } |
| 1374 RuntimeTypes rti = backend.rti; | 1375 RuntimeTypes rti = backend.rti; |
| 1375 String encoding = rti.getSignatureEncoding(type, () => '$thisAccess'); | 1376 String encoding = rti.getSignatureEncoding(type, () => '$thisAccess'); |
| 1376 String operatorSignature = namer.operatorSignature(); | 1377 String operatorSignature = namer.operatorSignature(); |
| 1377 builder.addProperty(operatorSignature, | 1378 builder.addProperty(operatorSignature, |
| 1378 new jsAst.LiteralExpression(encoding)); | 1379 new jsAst.LiteralExpression(encoding)); |
| 1379 } | 1380 } |
| 1380 | 1381 |
| (...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3700 | 3701 |
| 3701 const String HOOKS_API_USAGE = """ | 3702 const String HOOKS_API_USAGE = """ |
| 3702 // The code supports the following hooks: | 3703 // The code supports the following hooks: |
| 3703 // dartPrint(message) - if this function is defined it is called | 3704 // dartPrint(message) - if this function is defined it is called |
| 3704 // instead of the Dart [print] method. | 3705 // instead of the Dart [print] method. |
| 3705 // dartMainRunner(main) - if this function is defined, the Dart [main] | 3706 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 3706 // method will not be invoked directly. | 3707 // method will not be invoked directly. |
| 3707 // Instead, a closure that will invoke [main] is | 3708 // Instead, a closure that will invoke [main] is |
| 3708 // passed to [dartMainRunner]. | 3709 // passed to [dartMainRunner]. |
| 3709 """; | 3710 """; |
| OLD | NEW |