1/* function.asc -- written by Alexis WILKE for Made to Order Software Corp. (c) 2005-2009 */
2
3/*
4
5Copyright (c) 2005-2009 Made to Order Software Corp.
6
7Permission is hereby granted, free of charge, to any
8person obtaining a copy of this software and
9associated documentation files (the "Software"), to
10deal in the Software without restriction, including
11without limitation the rights to use, copy, modify,
12merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom
14the Software is furnished to do so, subject to the
15following conditions:
16
17The above copyright notice and this permission notice
18shall be included in all copies or substantial
19portions of the Software.
20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
22ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
23LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
24FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
25EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
27WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30SOFTWARE.
31
32*/
33
34intrinsic package Global
35{
36	dynamic class Function
37	{
38		// a function has 0 or more parameters and it ends with a body string
39		// TODO: make sure the constructor (dynamic function creation) is
40		//	 supported... [ie. that we could do new Function(...)]
41		//	 [most certainly not because they would then need the parser
42		//	 in the Flash plug-in and then the eval() function would work]
43		function Function(pb : String, ...) : Void;
44
45		function apply(obj : Object, arguments : Array) : Object;
46		function call(obj : Object, ...) : Object;
47
48		// TODO: make sure the length parameter is available
49		var length : Integer;		// # of arguments
50	}
51
52	// TODO: we need to know whether arguments
53	//	 is an array or just replicates some
54	//	 of the Array class features
55	class arguments extends Array
56	{
57		function get callee() : Function;
58		function get caller() : Function;
59	}
60}
61
62
63