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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 643 // If the method is in an interceptor class, we need to also pass | 643 // If the method is in an interceptor class, we need to also pass |
| 644 // the actual receiver. | 644 // the actual receiver. |
| 645 int extraArgumentCount = isInterceptorClass ? 1 : 0; | 645 int extraArgumentCount = isInterceptorClass ? 1 : 0; |
| 646 // Use '$receiver' to avoid clashes with other parameter names. Using | 646 // Use '$receiver' to avoid clashes with other parameter names. Using |
| 647 // '$receiver' works because [:namer.safeName:] used for getting parameter | 647 // '$receiver' works because [:namer.safeName:] used for getting parameter |
| 648 // names never returns a name beginning with a single '$'. | 648 // names never returns a name beginning with a single '$'. |
| 649 String receiverArgumentName = r'$receiver'; | 649 String receiverArgumentName = r'$receiver'; |
| 650 | 650 |
| 651 // The parameters that this stub takes. | 651 // The parameters that this stub takes. |
| 652 List<jsAst.Parameter> parametersBuffer = | 652 List<jsAst.Parameter> parametersBuffer = |
| 653 new List<jsAst.Parameter>.fixedLength( | 653 new List<jsAst.Parameter>( |
|
floitsch
2013/02/26 13:54:19
probably fits on one line.
Lasse Reichstein Nielsen
2013/02/26 15:26:00
Done.
| |
| 654 selector.argumentCount + extraArgumentCount); | 654 selector.argumentCount + extraArgumentCount); |
| 655 // The arguments that will be passed to the real method. | 655 // The arguments that will be passed to the real method. |
| 656 List<jsAst.Expression> argumentsBuffer = | 656 List<jsAst.Expression> argumentsBuffer = |
| 657 new List<jsAst.Expression>.fixedLength( | 657 new List<jsAst.Expression>( |
|
floitsch
2013/02/26 13:54:19
ditto.
Lasse Reichstein Nielsen
2013/02/26 15:26:00
Doesn't fit.
| |
| 658 parameters.parameterCount + extraArgumentCount); | 658 parameters.parameterCount + extraArgumentCount); |
| 659 | 659 |
| 660 int count = 0; | 660 int count = 0; |
| 661 if (isInterceptorClass) { | 661 if (isInterceptorClass) { |
| 662 count++; | 662 count++; |
| 663 parametersBuffer[0] = new jsAst.Parameter(receiverArgumentName); | 663 parametersBuffer[0] = new jsAst.Parameter(receiverArgumentName); |
| 664 argumentsBuffer[0] = js[receiverArgumentName]; | 664 argumentsBuffer[0] = js[receiverArgumentName]; |
| 665 } | 665 } |
| 666 | 666 |
| 667 int indexOfLastOptionalArgumentInParameters = positionalArgumentCount - 1; | 667 int indexOfLastOptionalArgumentInParameters = positionalArgumentCount - 1; |
| (...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2706 """; | 2706 """; |
| 2707 const String HOOKS_API_USAGE = """ | 2707 const String HOOKS_API_USAGE = """ |
| 2708 // The code supports the following hooks: | 2708 // The code supports the following hooks: |
| 2709 // dartPrint(message) - if this function is defined it is called | 2709 // dartPrint(message) - if this function is defined it is called |
| 2710 // instead of the Dart [print] method. | 2710 // instead of the Dart [print] method. |
| 2711 // dartMainRunner(main) - if this function is defined, the Dart [main] | 2711 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 2712 // method will not be invoked directly. | 2712 // method will not be invoked directly. |
| 2713 // Instead, a closure that will invoke [main] is | 2713 // Instead, a closure that will invoke [main] is |
| 2714 // passed to [dartMainRunner]. | 2714 // passed to [dartMainRunner]. |
| 2715 """; | 2715 """; |
| OLD | NEW |