Chromium Code Reviews| 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 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3410 return globalMetadataMap.putIfAbsent(string, () { | 3410 return globalMetadataMap.putIfAbsent(string, () { |
| 3411 globalMetadata.add(string); | 3411 globalMetadata.add(string); |
| 3412 return globalMetadata.length - 1; | 3412 return globalMetadata.length - 1; |
| 3413 }); | 3413 }); |
| 3414 } | 3414 } |
| 3415 | 3415 |
| 3416 jsAst.Fun extendWithMetadata(FunctionElement element, jsAst.Fun code) { | 3416 jsAst.Fun extendWithMetadata(FunctionElement element, jsAst.Fun code) { |
| 3417 if (!backend.retainMetadataOf(element)) return code; | 3417 if (!backend.retainMetadataOf(element)) return code; |
| 3418 return compiler.withCurrentElement(element, () { | 3418 return compiler.withCurrentElement(element, () { |
| 3419 List<int> metadata = <int>[]; | 3419 List<int> metadata = <int>[]; |
| 3420 FunctionSignature signature = element.functionSignature; | 3420 FunctionSignature signature = element.computeSignature(compiler); |
|
ahe
2013/07/18 09:59:32
Why this change?
ngeoffray
2013/07/18 15:25:14
Apparently, it's not ensured that functionSignatur
ahe
2013/07/19 09:10:44
That is a bug. It must be non-null. Calling compu
ngeoffray
2013/08/15 08:23:19
Done in: https://codereview.chromium.org/22874003/
| |
| 3421 if (element.isConstructor()) { | 3421 if (element.isConstructor()) { |
| 3422 metadata.add(reifyType(element.getEnclosingClass().thisType)); | 3422 metadata.add(reifyType(element.getEnclosingClass().thisType)); |
| 3423 } else { | 3423 } else { |
| 3424 metadata.add(reifyType(signature.returnType)); | 3424 metadata.add(reifyType(signature.returnType)); |
| 3425 } | 3425 } |
| 3426 signature.forEachParameter((Element parameter) { | 3426 signature.forEachParameter((Element parameter) { |
| 3427 metadata | 3427 metadata |
| 3428 ..add(reifyName(parameter.name)) | 3428 ..add(reifyName(parameter.name)) |
| 3429 ..add(reifyType(parameter.computeType(compiler))); | 3429 ..add(reifyType(parameter.computeType(compiler))); |
| 3430 }); | 3430 }); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3887 | 3887 |
| 3888 const String HOOKS_API_USAGE = """ | 3888 const String HOOKS_API_USAGE = """ |
| 3889 // The code supports the following hooks: | 3889 // The code supports the following hooks: |
| 3890 // dartPrint(message) - if this function is defined it is called | 3890 // dartPrint(message) - if this function is defined it is called |
| 3891 // instead of the Dart [print] method. | 3891 // instead of the Dart [print] method. |
| 3892 // dartMainRunner(main) - if this function is defined, the Dart [main] | 3892 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 3893 // method will not be invoked directly. | 3893 // method will not be invoked directly. |
| 3894 // Instead, a closure that will invoke [main] is | 3894 // Instead, a closure that will invoke [main] is |
| 3895 // passed to [dartMainRunner]. | 3895 // passed to [dartMainRunner]. |
| 3896 """; | 3896 """; |
| OLD | NEW |