]> git.saurik.com Git - apple/javascriptcore.git/blame - kjs/function_object.h
JavaScriptCore-461.tar.gz
[apple/javascriptcore.git] / kjs / function_object.h
CommitLineData
b37bf2e1
A
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
5 * Copyright (C) 2006 Apple Computer, Inc.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 */
22
23#ifndef FUNCTION_OBJECT_H_
24#define FUNCTION_OBJECT_H_
25
26#include "object_object.h"
27#include "function.h"
28
29namespace KJS {
30
31 /**
32 * @internal
33 *
34 * The initial value of Function.prototype (and thus all objects created
35 * with the Function constructor)
36 */
37 class FunctionPrototype : public InternalFunctionImp {
38 public:
39 FunctionPrototype(ExecState*);
40
41 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
42 };
43
44 /**
45 * @internal
46 *
47 * The initial value of the the global variable's "Function" property
48 */
49 class FunctionObjectImp : public InternalFunctionImp {
50 public:
51 FunctionObjectImp(ExecState*, FunctionPrototype*);
52
53 virtual bool implementsConstruct() const;
54 virtual JSObject* construct(ExecState*, const List&);
55 virtual JSObject* construct(ExecState*, const List&, const Identifier& functionName, const UString& sourceURL, int lineNumber);
56 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
57 };
58
59} // namespace KJS
60
61#endif // _FUNCTION_OBJECT_H_