internal.h
来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· C头文件 代码 · 共 509 行 · 第 1/2 页
H
509 行
static void unlock(); void mark(); ExecState *globalExec() { return globExec; } bool checkSyntax(const UString &code,int *errLine, UString *errMsg); bool checkSyntax(const UString &code); Completion evaluate(const UString &code, const Value &thisV); Debugger *debugger() const { return dbg; } void setDebugger(Debugger *d); Object builtinObject() const { return b_Object; } Object builtinFunction() const { return b_Function; } Object builtinArray() const { return b_Array; } Object builtinBoolean() const { return b_Boolean; } Object builtinString() const { return b_String; } Object builtinNumber() const { return b_Number; } Object builtinDate() const { return b_Date; } Object builtinRegExp() const { return b_RegExp; } Object builtinError() const { return b_Error; } Object builtinObjectPrototype() const { return b_ObjectPrototype; } Object builtinFunctionPrototype() const { return b_FunctionPrototype; } Object builtinArrayPrototype() const { return b_ArrayPrototype; } Object builtinBooleanPrototype() const { return b_BooleanPrototype; } Object builtinStringPrototype() const { return b_StringPrototype; } Object builtinNumberPrototype() const { return b_NumberPrototype; } Object builtinDatePrototype() const { return b_DatePrototype; } Object builtinRegExpPrototype() const { return b_RegExpPrototype; } Object builtinErrorPrototype() const { return b_ErrorPrototype; } Object builtinEvalError() const { return b_evalError; } Object builtinRangeError() const { return b_rangeError; } Object builtinReferenceError() const { return b_referenceError; } Object builtinSyntaxError() const { return b_syntaxError; } Object builtinTypeError() const { return b_typeError; } Object builtinURIError() const { return b_uriError; } Object builtinEvalErrorPrototype() const { return b_evalErrorPrototype; } Object builtinRangeErrorPrototype() const { return b_rangeErrorPrototype; } Object builtinReferenceErrorPrototype() const { return b_referenceErrorPrototype; } Object builtinSyntaxErrorPrototype() const { return b_syntaxErrorPrototype; } Object builtinTypeErrorPrototype() const { return b_typeErrorPrototype; } Object builtinURIErrorPrototype() const { return b_uriErrorPrototype; } void setCompatMode(Interpreter::CompatMode mode) { m_compatMode = mode; } Interpreter::CompatMode compatMode() const { return m_compatMode; } // Chained list of interpreters (ring) static InterpreterImp* firstInterpreter() { return s_hook; } InterpreterImp *nextInterpreter() const { return next; } InterpreterImp *prevInterpreter() const { return prev; } void addSourceCode(SourceCode *code); void removeSourceCode(SourceCode *code); void setContext(ContextImp *c) { _context = c; } private: void clear(); Interpreter *m_interpreter; Object global; Debugger *dbg; // Built-in properties of the object prototype. These are accessible // from here even if they are replaced by js code (e.g. assigning to // Array.prototype) Object b_Object; Object b_Function; Object b_Array; Object b_Boolean; Object b_String; Object b_Number; Object b_Date; Object b_RegExp; Object b_Error; Object b_ObjectPrototype; Object b_FunctionPrototype; Object b_ArrayPrototype; Object b_BooleanPrototype; Object b_StringPrototype; Object b_NumberPrototype; Object b_DatePrototype; Object b_RegExpPrototype; Object b_ErrorPrototype; Object b_evalError; Object b_rangeError; Object b_referenceError; Object b_syntaxError; Object b_typeError; Object b_uriError; Object b_evalErrorPrototype; Object b_rangeErrorPrototype; Object b_referenceErrorPrototype; Object b_syntaxErrorPrototype; Object b_typeErrorPrototype; Object b_uriErrorPrototype; ExecState *globExec; Interpreter::CompatMode m_compatMode; // Chained list of interpreters (ring) - for collector static InterpreterImp* s_hook; InterpreterImp *next, *prev; ContextImp *_context; int recursion; SourceCode *sources; }; class AttachedInterpreter; class DebuggerImp { public: DebuggerImp() { interps = 0; isAborted = false; } void abort() { isAborted = true; } bool aborted() const { return isAborted; } AttachedInterpreter *interps; bool isAborted; }; /** * @short Implementation class for functions implemented in JS. */ class FunctionImp : public InternalFunctionImp { friend class ActivationImp; public: FunctionImp(ExecState *exec, const Identifier &n = Identifier::null()); virtual ~FunctionImp(); virtual Value get(ExecState *exec, const Identifier &propertyName) const; virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None); virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const; virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName); virtual bool implementsCall() const; virtual Value call(ExecState *exec, Object &thisObj, const List &args); void addParameter(const Identifier &n); Identifier parameterProperty(int index) const; // parameters in string representation, e.g. (a, b, c) UString parameterString() const; virtual CodeType codeType() const = 0; virtual Completion execute(ExecState *exec) = 0; int firstLine() const { return line0; } int lastLine() const { return line1; } int sourceId() const { return sid; } virtual const ClassInfo *classInfo() const { return &info; } static const ClassInfo info; protected: Parameter *param; int line0; int line1; int sid; private: void processParameters(ExecState *exec, const List &); virtual void processVarDecls(ExecState *exec); }; class DeclaredFunctionImp : public FunctionImp { public: DeclaredFunctionImp(ExecState *exec, const Identifier &n, FunctionBodyNode *b, const ScopeChain &sc); ~DeclaredFunctionImp(); bool implementsConstruct() const; Object construct(ExecState *exec, const List &args); virtual Completion execute(ExecState *exec); CodeType codeType() const { return FunctionCode; } FunctionBodyNode *body; virtual const ClassInfo *classInfo() const { return &info; } KJS_EXPORT static const ClassInfo info; private: virtual void processVarDecls(ExecState *exec); }; class ActivationImp; class ArgumentsImp : public ObjectImp { public: ArgumentsImp(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act); virtual void mark(); virtual Value get(ExecState *exec, const Identifier &propertyName) const; virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None); virtual const ClassInfo *classInfo() const { return &info; } static const ClassInfo info; private: ActivationImp *activation; }; class ActivationImp : public ObjectImp { public: ActivationImp(FunctionImp *function, const List &arguments); virtual Value get(ExecState *exec, const Identifier &propertyName) const; virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const; virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName); virtual const ClassInfo *classInfo() const { return &info; } static const ClassInfo info; virtual void mark(); private: FunctionImp *_function; List _arguments; mutable ArgumentsImp *_argumentsObject; }; class GlobalFuncImp : public InternalFunctionImp { public: GlobalFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len, const Identifier &_ident); virtual bool implementsCall() const; virtual Value call(ExecState *exec, Object &thisObj, const List &args); virtual CodeType codeType() const; enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, DecodeURI, DecodeURIComponent, EncodeURI, EncodeURIComponent, Escape, UnEscape, KJSPrint }; private: int id; }; // helper function for toInteger, toInt32, toUInt32 and toUInt16 double roundValue(ExecState *exec, const Value &v);#ifndef NDEBUG void printInfo(ExecState *exec, const char *s, const Value &o, int lineno = -1);#endif} // namespace#endif // _INTERNAL_H_
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?