[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs
From: Harri Porten <porten () kde ! org>
Date: 2007-04-09 15:14:21
Message-ID: 1176131661.964359.30000.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 651867 by porten:
split function.h to make things compile without having to make nodes.h
public for MSVC. Now we two uses of private API inside of kdelibs ...
M +1 -0 kate/part/katejscript.cpp
M +2 -1 khtml/ecma/kjs_events.cpp
M +7 -6 kjs/Context.cpp
M +2 -0 kjs/context.h
M +1 -1 kjs/function.cpp
M +0 -84 kjs/function.h
M +1 -0 kjs/function_object.cpp
M +1 -0 kjs/nodes.cpp
M +1 -0 kjs/nodes2string.cpp
A kjs/scriptfunction.h [License: LGPL (v2+)]
--- trunk/KDE/kdelibs/kate/part/katejscript.cpp #651866:651867
@@ -45,6 +45,7 @@
#include <kjs/context.h>
#include <kjs/nodes.h>
#include <kjs/function.h>
+#include <kjs/scriptfunction.h> // ### supposed to be private API
#include <kjs/PropertyNameArray.h>
#include <QtCore/QFile>
--- trunk/KDE/kdelibs/khtml/ecma/kjs_events.cpp #651866:651867
@@ -30,6 +30,7 @@
#include "rendering/render_object.h"
#include "rendering/render_canvas.h"
#include "khtml_part.h"
+#include <kjs/scriptfunction.h> // private API
#include <kdebug.h>
@@ -751,7 +752,7 @@
*/
KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(DOMTextEventProto,DOMUIEventProto)//Note: no proto in KeyBase
KJS_IMPLEMENT_PROTOFUNC(DOMTextEventProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE("DOMTextEvent", DOMTextEventProto,DOMTextEventProtoFunc)
+KJS_IMPLEMENT_PROTOTYPE("DOMTextEvent", DOMTextEventProto,DOMTextEventProtoFunc)
DOMTextEvent::DOMTextEvent(ExecState *exec, DOM::TextEventImpl* ke) :
DOMKeyEventBase(DOMTextEventProto::self(exec), ke) {}
--- trunk/KDE/kdelibs/kjs/Context.cpp #651866:651867
@@ -23,23 +23,24 @@
*/
#include "context.h"
+#include "scriptfunction.h"
namespace KJS {
// ECMA 10.2
-Context::Context(JSObject* glob, Interpreter* interpreter, JSObject* thisV,
- FunctionBodyNode* currentBody, CodeType type, Context* callingCon,
+Context::Context(JSObject* glob, Interpreter* interpreter, JSObject* thisV,
+ FunctionBodyNode* currentBody, CodeType type, Context* callingCon,
FunctionImp* func, const List* args)
: m_interpreter(interpreter)
, m_currentBody(currentBody)
, m_function(func)
, m_arguments(args)
, m_iterationDepth(0)
- , m_switchDepth(0)
+ , m_switchDepth(0)
{
m_codeType = type;
m_callingContext = callingCon;
-
+
// create and initialize activation object (ECMA 10.1.6)
if (type == FunctionCode ) {
m_activation = new ActivationImp(func, *args);
@@ -48,7 +49,7 @@
m_activation = 0;
m_variable = glob;
}
-
+
// ECMA 10.2
switch(type) {
case EvalCode:
@@ -70,7 +71,7 @@
m_thisVal = thisV;
break;
}
-
+
m_interpreter->setContext(this);
}
--- trunk/KDE/kdelibs/kjs/context.h #651866:651867
@@ -30,6 +30,8 @@
namespace KJS {
+ class FunctionBodyNode;
+
/**
* @short Execution context.
*
--- trunk/KDE/kdelibs/kjs/function.cpp #651866:651867
@@ -25,7 +25,7 @@
#include "config.h"
#include "function.h"
-
+#include "scriptfunction.h"
#include "internal.h"
#include "function_object.h"
#include "lexer.h"
--- trunk/KDE/kdelibs/kjs/function.h #651866:651867
@@ -31,7 +31,6 @@
class ActivationImp;
class FunctionPrototype;
- class FunctionBodyNode;
enum CodeType { GlobalCode,
EvalCode,
@@ -70,89 +69,6 @@
virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
};
- /**
- * @short Implementation class for internal Functions.
- */
- class KJS_EXPORT FunctionImp : public InternalFunctionImp {
- friend class ActivationImp;
- public:
- FunctionImp(ExecState* exec, const Identifier& n, FunctionBodyNode* b);
- virtual ~FunctionImp();
-
- virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
-
- virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
-
- //Note: unlike body->paramName, this returns Identifier::null for parameters
- //that will never get set, due to later param having the same name
- Identifier getParameterName(int index);
- virtual CodeType codeType() const = 0;
-
- virtual Completion execute(ExecState *exec) = 0;
-
- virtual const ClassInfo *classInfo() const { return &info; }
- static const ClassInfo info;
-
- RefPtr<FunctionBodyNode> body;
-
- /**
- * Returns the scope of this object. This is used when execution declared
- * functions - the execution context for the function is initialized with
- * extra object in it's scope. An example of this is functions declared
- * inside other functions:
- *
- * \code
- * function f() {
- *
- * function b() {
- * return prototype;
- * }
- *
- * var x = 4;
- * // do some stuff
- * }
- * f.prototype = new String();
- * \endcode
- *
- * When the function f.b is executed, its scope will include properties of
- * f. So in the example above the return value of f.b() would be the new
- * String object that was assigned to f.prototype.
- *
- * @param exec The current execution state
- * @return The function's scope
- */
- const ScopeChain &scope() const { return _scope; }
- void setScope(const ScopeChain &s) { _scope = s; }
-
- virtual void mark();
- private:
- ScopeChain _scope;
-
- static JSValue *argumentsGetter(ExecState *, JSObject *, const Identifier &, const PropertySlot&);
- static JSValue *callerGetter(ExecState *, JSObject *, const Identifier &, const PropertySlot&);
- static JSValue *lengthGetter(ExecState *, JSObject *, const Identifier &, const PropertySlot&);
-
- void passInParameters(ExecState *exec, const List &);
- };
-
- class KJS_EXPORT DeclaredFunctionImp : public FunctionImp {
- public:
- DeclaredFunctionImp(ExecState *exec, const Identifier &n,
- FunctionBodyNode *b, const ScopeChain &sc);
-
- bool implementsConstruct() const;
- JSObject *construct(ExecState *exec, const List &args);
-
- virtual Completion execute(ExecState *exec);
- CodeType codeType() const { return FunctionCode; }
- UString toSource() const;
-
- virtual const ClassInfo *classInfo() const { return &info; }
- static const ClassInfo info;
- };
-
class IndexToNameMap {
public:
IndexToNameMap(FunctionImp *func, const List &args);
--- trunk/KDE/kdelibs/kjs/function_object.cpp #651866:651867
@@ -24,6 +24,7 @@
#include "function_object.h"
#include "internal.h"
#include "function.h"
+#include "scriptfunction.h"
#include "array_object.h"
#include "nodes.h"
#include "lexer.h"
--- trunk/KDE/kdelibs/kjs/nodes.cpp #651866:651867
@@ -24,6 +24,7 @@
#include "config.h"
#include "nodes.h"
+#include "scriptfunction.h"
#include <math.h>
#ifdef KJS_DEBUG_MEM
--- trunk/KDE/kdelibs/kjs/nodes2string.cpp #651866:651867
@@ -24,6 +24,7 @@
#include "config.h"
#include "nodes.h"
#include "function.h"
+#include "scriptfunction.h"
#define NOINLINE
#if COMPILER(CWP)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic