2262eaa5ed
Review URL: https://codereview.chromium.org//11035069 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13335 260f80e4-7a28-3924-810f-c04153c831b5
34 lines
1.3 KiB
Dart
34 lines
1.3 KiB
Dart
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// Dart core library.
|
|
|
|
/**
|
|
* Super-type of all function types.
|
|
*
|
|
* A function value, or an instance of a class with a "call" method, is a
|
|
* subtype of a function type, and as such, a subtype of [Function].
|
|
*/
|
|
abstract class Function {
|
|
/**
|
|
* Dynamically call [function] with the specified arguments.
|
|
*
|
|
* Acts the same as calling function with positional arguments
|
|
* corresponding to the elements of [positionalArguments] and
|
|
* named arguments corresponding to the elements of [namedArguments].
|
|
*
|
|
* This includes giving the same errors if [function] isn't callable or
|
|
* if it expects different parameters.
|
|
*
|
|
* Example: [: Function.apply(foo, [1,2,3], {"f": 4, "g": 5}) :] gives
|
|
* exactly the same result as [: foo(1, 2, 3, f: 4, g: 5) :].
|
|
*
|
|
* If [positionalArguments] is null, it's considered an empty list.
|
|
* If [namedArguments] is omitted or null, it is considered an empty map.
|
|
*/
|
|
external static apply(Function function,
|
|
List positionalArguments,
|
|
[Map<String,Dynamic> namedArguments]);
|
|
}
|