| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 namer.instanceMethodInvocationName(member.getLibrary(), member.name, | 356 namer.instanceMethodInvocationName(member.getLibrary(), member.name, |
| 357 selector); | 357 selector); |
| 358 CodeBuffer buffer = new CodeBuffer(); | 358 CodeBuffer buffer = new CodeBuffer(); |
| 359 buffer.add('function('); | 359 buffer.add('function('); |
| 360 | 360 |
| 361 // The parameters that this stub takes. | 361 // The parameters that this stub takes. |
| 362 List<String> parametersBuffer = new List<String>(selector.argumentCount); | 362 List<String> parametersBuffer = new List<String>(selector.argumentCount); |
| 363 // The arguments that will be passed to the real method. | 363 // The arguments that will be passed to the real method. |
| 364 List<String> argumentsBuffer = new List<String>(parameters.parameterCount); | 364 List<String> argumentsBuffer = new List<String>(parameters.parameterCount); |
| 365 | 365 |
| 366 // TODO(5074): Update this comment once we remove support for |
| 367 // the deprecated parameter specification. |
| 366 // We fill the lists depending on the selector. For example, | 368 // We fill the lists depending on the selector. For example, |
| 367 // take method foo: | 369 // take method foo: |
| 368 // foo(a, b, [c, d]); | 370 // foo(a, b, [c, d]); |
| 369 // | 371 // |
| 370 // We may have multiple ways of calling foo: | 372 // We may have multiple ways of calling foo: |
| 371 // (1) foo(1, 2, 3, 4) | 373 // (1) foo(1, 2, 3, 4) |
| 372 // (2) foo(1, 2); | 374 // (2) foo(1, 2); |
| 373 // (3) foo(1, 2, 3); | 375 // (3) foo(1, 2, 3); |
| 374 // (4) foo(1, 2, c: 3); | 376 // (4) foo(1, 2, c: 3); |
| 375 // (5) foo(1, 2, d: 4); | 377 // (5) foo(1, 2, d: 4); |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 const String HOOKS_API_USAGE = """ | 1339 const String HOOKS_API_USAGE = """ |
| 1338 // Generated by dart2js, the Dart to JavaScript compiler. | 1340 // Generated by dart2js, the Dart to JavaScript compiler. |
| 1339 // The code supports the following hooks: | 1341 // The code supports the following hooks: |
| 1340 // dartPrint(message) - if this function is defined it is called | 1342 // dartPrint(message) - if this function is defined it is called |
| 1341 // instead of the Dart [print] method. | 1343 // instead of the Dart [print] method. |
| 1342 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1344 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 1343 // method will not be invoked directly. | 1345 // method will not be invoked directly. |
| 1344 // Instead, a closure that will invoke [main] is | 1346 // Instead, a closure that will invoke [main] is |
| 1345 // passed to [dartMainRunner]. | 1347 // passed to [dartMainRunner]. |
| 1346 """; | 1348 """; |
| OLD | NEW |