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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 const String HOOKS_API_USAGE = """ | 1349 const String HOOKS_API_USAGE = """ |
1348 // Generated by dart2js, the Dart to JavaScript compiler. | 1350 // Generated by dart2js, the Dart to JavaScript compiler. |
1349 // The code supports the following hooks: | 1351 // The code supports the following hooks: |
1350 // dartPrint(message) - if this function is defined it is called | 1352 // dartPrint(message) - if this function is defined it is called |
1351 // instead of the Dart [print] method. | 1353 // instead of the Dart [print] method. |
1352 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1354 // dartMainRunner(main) - if this function is defined, the Dart [main] |
1353 // method will not be invoked directly. | 1355 // method will not be invoked directly. |
1354 // Instead, a closure that will invoke [main] is | 1356 // Instead, a closure that will invoke [main] is |
1355 // passed to [dartMainRunner]. | 1357 // passed to [dartMainRunner]. |
1356 """; | 1358 """; |
OLD | NEW |