source: webkit/trunk/JavaScriptCore/kjs/internal.h@ 14256

Last change on this file since 14256 was 14256, checked in by mjs, 19 years ago

JavaScriptCore:

Rubber stamped by Anders.


  • renamed kxmlcore to wtf


kxmlcore --> wtf
KXMLCore --> WTF
WKC --> WTF

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bindings/c/c_instance.cpp:
  • bindings/objc/WebScriptObject.mm:
  • kjs/JSImmediate.h:
  • kjs/Parser.cpp:
  • kjs/Parser.h:
  • kjs/array_object.cpp:
  • kjs/collector.cpp: (KJS::Collector::registerThread):
  • kjs/collector.h:
  • kjs/config.h:
  • kjs/function.cpp: (KJS::isStrWhiteSpace):
  • kjs/function.h:
  • kjs/identifier.cpp:
  • kjs/internal.cpp:
  • kjs/internal.h:
  • kjs/lexer.cpp: (Lexer::shift): (Lexer::isWhiteSpace): (Lexer::isIdentStart): (Lexer::isIdentPart):
  • kjs/lookup.cpp:
  • kjs/nodes.cpp:
  • kjs/nodes.h:
  • kjs/number_object.cpp:
  • kjs/object.h:
  • kjs/property_map.cpp:
  • kjs/property_map.h:
  • kjs/string_object.cpp: (StringProtoFunc::callAsFunction):
  • kjs/testkjs.cpp: (testIsInteger):
  • kjs/ustring.cpp:
  • kjs/ustring.h:
  • kxmlcore: Removed.
  • kxmlcore/AlwaysInline.h: Removed.
  • kxmlcore/Assertions.cpp: Removed.
  • kxmlcore/Assertions.h: Removed.
  • kxmlcore/FastMalloc.cpp: Removed.
  • kxmlcore/FastMalloc.h: Removed.
  • kxmlcore/FastMallocInternal.h: Removed.
  • kxmlcore/Forward.h: Removed.
  • kxmlcore/HashCountedSet.h: Removed.
  • kxmlcore/HashFunctions.h: Removed.
  • kxmlcore/HashMap.h: Removed.
  • kxmlcore/HashSet.h: Removed.
  • kxmlcore/HashTable.cpp: Removed.
  • kxmlcore/HashTable.h: Removed.
  • kxmlcore/HashTraits.h: Removed.
  • kxmlcore/ListRefPtr.h: Removed.
  • kxmlcore/Noncopyable.h: Removed.
  • kxmlcore/OwnArrayPtr.h: Removed.
  • kxmlcore/OwnPtr.h: Removed.
  • kxmlcore/PassRefPtr.h: Removed.
  • kxmlcore/Platform.h: Removed.
  • kxmlcore/RefPtr.h: Removed.
  • kxmlcore/TCPageMap.h: Removed.
  • kxmlcore/TCSpinLock.h: Removed.
  • kxmlcore/TCSystemAlloc.cpp: Removed.
  • kxmlcore/TCSystemAlloc.h: Removed.
  • kxmlcore/UnusedParam.h: Removed.
  • kxmlcore/Vector.h: Removed.
  • kxmlcore/VectorTraits.h: Removed.
  • kxmlcore/unicode: Removed.
  • kxmlcore/unicode/Unicode.h: Removed.
  • kxmlcore/unicode/UnicodeCategory.h: Removed.
  • kxmlcore/unicode/icu: Removed.
  • kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
  • kxmlcore/unicode/posix: Removed.
  • kxmlcore/unicode/qt3: Removed.
  • kxmlcore/unicode/qt4: Removed.
  • kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
  • pcre/pcre_get.c:
  • wtf: Added.
  • wtf/Assertions.cpp:
  • wtf/Assertions.h:
  • wtf/FastMalloc.cpp: (WTF::TCMalloc_ThreadCache::Scavenge): (WTF::do_malloc): (WTF::do_free): (WTF::TCMallocGuard::TCMallocGuard): (WTF::malloc): (WTF::free): (WTF::calloc): (WTF::cfree): (WTF::realloc):
  • wtf/FastMalloc.h:
  • wtf/FastMallocInternal.h:
  • wtf/Forward.h:
  • wtf/HashCountedSet.h:
  • wtf/HashFunctions.h:
  • wtf/HashMap.h:
  • wtf/HashSet.h:
  • wtf/HashTable.cpp:
  • wtf/HashTable.h:
  • wtf/HashTraits.h:
  • wtf/ListRefPtr.h:
  • wtf/Noncopyable.h:
  • wtf/OwnArrayPtr.h:
  • wtf/OwnPtr.h:
  • wtf/PassRefPtr.h:
  • wtf/RefPtr.h:
  • wtf/TCSystemAlloc.cpp: (TCMalloc_SystemAlloc):
  • wtf/Vector.h:
  • wtf/VectorTraits.h:
  • wtf/unicode/UnicodeCategory.h:
  • wtf/unicode/icu/UnicodeIcu.h:

JavaScriptGlue:

Rubber stamped by Anders.


  • renamed kxmlcore to wtf


kxmlcore --> wtf
KXMLCore --> WTF
WKC --> WTF

  • config.h:
  • kxmlcore: Removed.
  • kxmlcore/AlwaysInline.h: Removed.
  • kxmlcore/Assertions.h: Removed.
  • kxmlcore/FastMalloc.h: Removed.
  • kxmlcore/Forward.h: Removed.
  • kxmlcore/HashCountedSet.h: Removed.
  • kxmlcore/HashSet.h: Removed.
  • kxmlcore/Noncopyable.h: Removed.
  • kxmlcore/OwnArrayPtr.h: Removed.
  • kxmlcore/OwnPtr.h: Removed.
  • kxmlcore/PassRefPtr.h: Removed.
  • kxmlcore/Platform.h: Removed.
  • kxmlcore/RefPtr.h: Removed.
  • kxmlcore/Vector.h: Removed.
  • wtf: Added.

WebCore:

Rubber stamped by Anders.


  • renamed kxmlcore to wtf


kxmlcore --> wtf
KXMLCore --> WTF
WKC --> WTF

  • ForwardingHeaders/kxmlcore: Removed.
  • ForwardingHeaders/kxmlcore/AlwaysInline.h: Removed.
  • ForwardingHeaders/kxmlcore/Assertions.h: Removed.
  • ForwardingHeaders/kxmlcore/FastMalloc.h: Removed.
  • ForwardingHeaders/kxmlcore/Forward.h: Removed.
  • ForwardingHeaders/kxmlcore/HashCountedSet.h: Removed.
  • ForwardingHeaders/kxmlcore/HashMap.h: Removed.
  • ForwardingHeaders/kxmlcore/HashSet.h: Removed.
  • ForwardingHeaders/kxmlcore/HashTraits.h: Removed.
  • ForwardingHeaders/kxmlcore/Noncopyable.h: Removed.
  • ForwardingHeaders/kxmlcore/OwnArrayPtr.h: Removed.
  • ForwardingHeaders/kxmlcore/OwnPtr.h: Removed.
  • ForwardingHeaders/kxmlcore/PassRefPtr.h: Removed.
  • ForwardingHeaders/kxmlcore/Platform.h: Removed.
  • ForwardingHeaders/kxmlcore/RefPtr.h: Removed.
  • ForwardingHeaders/kxmlcore/Vector.h: Removed.
  • ForwardingHeaders/wtf: Added.
  • bindings/js/JSHTMLElementWrapperFactory.h:
  • bindings/js/kjs_binding.cpp:
  • bindings/js/kjs_window.h:
  • bindings/objc/DOMImplementationFront.h:
  • bridge/JavaAppletWidget.h:
  • bridge/mac/WebCoreFrameNamespaces.mm:
  • bridge/mac/WebCorePageBridge.mm: (initializeLogChannel):
  • bridge/mac/WebCoreStringTruncator.mm:
  • bridge/mac/WebCoreViewFactory.m:
  • config.h:
  • css/css_base.h:
  • css/css_valueimpl.h:
  • css/csshelper.cpp:
  • css/cssparser.h:
  • dom/DOMImplementation.h:
  • dom/Document.h:
  • dom/NamedNodeMap.h:
  • dom/Node.h:
  • dom/NodeList.h:
  • dom/QualifiedName.cpp:
  • dom/Range.h:
  • dom/StyledElement.cpp:
  • dom/dom2_traversalimpl.h:
  • dom/xml_tokenizer.h:
  • editing/RebalanceWhitespaceCommand.cpp:
  • editing/RemoveCSSPropertyCommand.cpp:
  • editing/RemoveNodeAttributeCommand.cpp:
  • editing/RemoveNodeCommand.cpp:
  • editing/RemoveNodePreservingChildrenCommand.cpp:
  • editing/ReplaceSelectionCommand.h:
  • editing/Selection.cpp:
  • editing/SetNodeAttributeCommand.cpp:
  • editing/SplitElementCommand.cpp:
  • editing/SplitTextNodeCommand.cpp:
  • editing/SplitTextNodeContainingElementCommand.cpp:
  • editing/TextIterator.h:
  • editing/htmlediting.h:
  • editing/markup.h:
  • html/CanvasGradient.h:
  • html/CanvasRenderingContext2D.h:
  • html/CanvasStyle.cpp:
  • html/HTMLCollection.h:
  • html/HTMLElementFactory.h:
  • kcanvas/KCanvasFilters.cpp:
  • kcanvas/KCanvasPath.h:
  • kcanvas/RenderPath.cpp:
  • kcanvas/RenderSVGImage.cpp:
  • kcanvas/RenderSVGText.cpp:
  • kcanvas/device/quartz/KCanvasItemQuartz.mm:
  • kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
  • kcanvas/device/quartz/QuartzSupport.mm:
  • ksvg2/misc/KSVGTimeScheduler.h:
  • ksvg2/misc/SVGDocumentExtensions.h:
  • ksvg2/scripts/make_names.pl:
  • ksvg2/svg/SVGDOMImplementation.cpp:
  • ksvg2/svg/SVGExternalResourcesRequired.h:
  • ksvg2/svg/SVGFilterPrimitiveStandardAttributes.cpp:
  • ksvg2/svg/SVGForeignObjectElement.cpp:
  • ksvg2/svg/SVGImageElement.cpp:
  • ksvg2/svg/SVGMaskElement.cpp:
  • ksvg2/svg/SVGStyledElement.cpp:
  • ksvg2/svg/SVGTests.h:
  • ksvg2/svg/SVGTransform.h:
  • ksvg2/svg/SVGTransformable.cpp:
  • kwq/AccessibilityObjectCache.h:
  • kwq/KWQCString.cpp:
  • kwq/KWQFormData.mm:
  • kwq/KWQListBox.mm:
  • kwq/KWQResourceLoader.mm:
  • kwq/KWQTextEdit.mm:
  • loader/Cache.h:
  • loader/CachedObject.h:
  • loader/CachedObjectClientWalker.h:
  • loader/Decoder.h:
  • loader/DocLoader.h:
  • loader/loader.cpp:
  • loader/loader.h:
  • page/DOMWindow.h:
  • page/Frame.h:
  • page/FramePrivate.h:
  • page/FrameTree.cpp:
  • page/Page.cpp:
  • page/Page.h:
  • page/Plugin.h:
  • platform/Arena.cpp:
  • platform/ArrayImpl.h:
  • platform/AtomicString.cpp:
  • platform/CharsetNames.cpp:
  • platform/Color.cpp:
  • platform/DeprecatedPtrListImpl.cpp:
  • platform/DeprecatedValueListImpl.h:
  • platform/FontFallbackList.h:
  • platform/GraphicsContext.h:
  • platform/GraphicsTypes.cpp:
  • platform/Image.h:
  • platform/KURL.cpp:
  • platform/Logging.cpp:
  • platform/Logging.h:
  • platform/PlatformString.h:
  • platform/PlugInInfoStore.h:
  • platform/StreamingTextDecoder.cpp:
  • platform/StreamingTextDecoder.h:
  • platform/String.cpp:
  • platform/StringHash.h:
  • platform/StringImpl.cpp:
  • platform/StringImpl.h:
  • platform/TextEncoding.cpp:
  • platform/Timer.cpp:
  • platform/Timer.h:
  • platform/TransferJob.h:
  • platform/TransferJobInternal.h:
  • platform/mac/BlockExceptions.mm:
  • platform/mac/ColorMac.mm:
  • platform/mac/FontData.mm:
  • platform/mac/KURLMac.mm:
  • platform/mac/QStringMac.mm:
  • platform/mac/SharedTimerMac.cpp:
  • platform/mac/TextEncodingMac.cpp:
  • platform/mac/WebCoreImageRendererFactory.m:
  • platform/mac/WebCoreKeyGenerator.m:
  • platform/mac/WebCoreTextArea.mm:
  • platform/mac/WebCoreTextField.mm:
  • platform/mac/WebTextRendererFactory.h:
  • platform/mac/WebTextRendererFactory.mm:
  • platform/win/TemporaryLinkStubs.cpp: (JavaAppletWidget::JavaAppletWidget):
  • rendering/InlineTextBox.cpp:
  • rendering/RenderText.cpp:
  • rendering/RenderTreeAsText.cpp:
  • rendering/bidi.cpp:
  • xml/XSLTProcessor.h:
  • xpath/impl/XPathExpressionNode.h:
  • xpath/impl/XPathParser.h:
  • xpath/impl/XPathPath.h:
  • xpath/impl/XPathUtil.h:

WebKit:

Rubber stamped by Anders.


  • renamed kxmlcore to wtf


kxmlcore --> wtf
KXMLCore --> WTF
WKC --> WTF

  • Misc/WebKitLogging.h:
  • Misc/WebKitLogging.m: (initializeLogChannel):
  • Property svn:eol-style set to native
File size: 11.4 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2001 Harri Porten ([email protected])
5 * Copyright (C) 2001 Peter Kelly ([email protected])
6 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25#ifndef INTERNAL_H
26#define INTERNAL_H
27
28#include "JSType.h"
29#include "interpreter.h"
30#include "object.h"
31#include "protect.h"
32#include "scope_chain.h"
33#include "types.h"
34#include "ustring.h"
35
36#include <wtf/Noncopyable.h>
37
38#define I18N_NOOP(s) s
39
40namespace KJS {
41
42 class Debugger;
43 class FunctionPrototype;
44
45 // ---------------------------------------------------------------------------
46 // Primitive impls
47 // ---------------------------------------------------------------------------
48
49 class StringImp : public JSCell {
50 public:
51 StringImp(const UString& v) : val(v) { }
52 UString value() const { return val; }
53
54 JSType type() const { return StringType; }
55
56 JSValue *toPrimitive(ExecState *exec, JSType preferred = UnspecifiedType) const;
57 bool toBoolean(ExecState *exec) const;
58 double toNumber(ExecState *exec) const;
59 UString toString(ExecState *exec) const;
60 JSObject *toObject(ExecState *exec) const;
61
62 private:
63 UString val;
64 };
65
66 class NumberImp : public JSCell {
67 friend class ConstantValues;
68 friend class InterpreterImp;
69 friend JSValue *jsNumberCell(double);
70 public:
71 double value() const { return val; }
72
73 JSType type() const { return NumberType; }
74
75 JSValue *toPrimitive(ExecState *exec, JSType preferred = UnspecifiedType) const;
76 bool toBoolean(ExecState *exec) const;
77 double toNumber(ExecState *exec) const;
78 UString toString(ExecState *exec) const;
79 JSObject *toObject(ExecState *exec) const;
80
81 private:
82 NumberImp(double v) : val(v) { }
83
84 virtual bool getUInt32(uint32_t&) const;
85
86 double val;
87 };
88
89
90 /**
91 * @short The "label set" in Ecma-262 spec
92 */
93 class LabelStack : Noncopyable {
94 public:
95 LabelStack()
96 : tos(0)
97 {
98 }
99 ~LabelStack();
100
101 /**
102 * If id is not empty and is not in the stack already, puts it on top of
103 * the stack and returns true, otherwise returns false
104 */
105 bool push(const Identifier &id);
106 /**
107 * Is the id in the stack?
108 */
109 bool contains(const Identifier &id) const;
110 /**
111 * Removes from the stack the last pushed id (what else?)
112 */
113 void pop();
114
115 private:
116 struct StackElem {
117 Identifier id;
118 StackElem *prev;
119 };
120
121 StackElem *tos;
122 };
123
124
125 // ---------------------------------------------------------------------------
126 // Evaluation
127 // ---------------------------------------------------------------------------
128
129 enum CodeType { GlobalCode,
130 EvalCode,
131 FunctionCode,
132 AnonymousCode };
133
134 class SavedBuiltinsInternal {
135 friend class InterpreterImp;
136 private:
137 ProtectedPtr<JSObject> b_Object;
138 ProtectedPtr<JSObject> b_Function;
139 ProtectedPtr<JSObject> b_Array;
140 ProtectedPtr<JSObject> b_Boolean;
141 ProtectedPtr<JSObject> b_String;
142 ProtectedPtr<JSObject> b_Number;
143 ProtectedPtr<JSObject> b_Date;
144 ProtectedPtr<JSObject> b_RegExp;
145 ProtectedPtr<JSObject> b_Error;
146
147 ProtectedPtr<JSObject> b_ObjectPrototype;
148 ProtectedPtr<JSObject> b_FunctionPrototype;
149 ProtectedPtr<JSObject> b_ArrayPrototype;
150 ProtectedPtr<JSObject> b_BooleanPrototype;
151 ProtectedPtr<JSObject> b_StringPrototype;
152 ProtectedPtr<JSObject> b_NumberPrototype;
153 ProtectedPtr<JSObject> b_DatePrototype;
154 ProtectedPtr<JSObject> b_RegExpPrototype;
155 ProtectedPtr<JSObject> b_ErrorPrototype;
156
157 ProtectedPtr<JSObject> b_evalError;
158 ProtectedPtr<JSObject> b_rangeError;
159 ProtectedPtr<JSObject> b_referenceError;
160 ProtectedPtr<JSObject> b_syntaxError;
161 ProtectedPtr<JSObject> b_typeError;
162 ProtectedPtr<JSObject> b_uriError;
163
164 ProtectedPtr<JSObject> b_evalErrorPrototype;
165 ProtectedPtr<JSObject> b_rangeErrorPrototype;
166 ProtectedPtr<JSObject> b_referenceErrorPrototype;
167 ProtectedPtr<JSObject> b_syntaxErrorPrototype;
168 ProtectedPtr<JSObject> b_typeErrorPrototype;
169 ProtectedPtr<JSObject> b_uriErrorPrototype;
170 };
171
172 class InterpreterImp {
173 friend class Collector;
174 public:
175 InterpreterImp(Interpreter *interp, JSObject *glob);
176 ~InterpreterImp();
177
178 JSObject *globalObject() { return global; }
179 Interpreter *interpreter() const { return m_interpreter; }
180
181 void initGlobalObject();
182
183 void mark();
184
185 ExecState *globalExec() { return &globExec; }
186 bool checkSyntax(const UString &code);
187 Completion evaluate(const UChar* code, int codeLength, JSValue* thisV, const UString& sourceURL, int startingLineNumber);
188 Debugger *debugger() const { return dbg; }
189 void setDebugger(Debugger *d) { dbg = d; }
190
191 JSObject *builtinObject() const { return b_Object; }
192 JSObject *builtinFunction() const { return b_Function; }
193 JSObject *builtinArray() const { return b_Array; }
194 JSObject *builtinBoolean() const { return b_Boolean; }
195 JSObject *builtinString() const { return b_String; }
196 JSObject *builtinNumber() const { return b_Number; }
197 JSObject *builtinDate() const { return b_Date; }
198 JSObject *builtinRegExp() const { return b_RegExp; }
199 JSObject *builtinError() const { return b_Error; }
200
201 JSObject *builtinObjectPrototype() const { return b_ObjectPrototype; }
202 JSObject *builtinFunctionPrototype() const { return b_FunctionPrototype; }
203 JSObject *builtinArrayPrototype() const { return b_ArrayPrototype; }
204 JSObject *builtinBooleanPrototype() const { return b_BooleanPrototype; }
205 JSObject *builtinStringPrototype() const { return b_StringPrototype; }
206 JSObject *builtinNumberPrototype() const { return b_NumberPrototype; }
207 JSObject *builtinDatePrototype() const { return b_DatePrototype; }
208 JSObject *builtinRegExpPrototype() const { return b_RegExpPrototype; }
209 JSObject *builtinErrorPrototype() const { return b_ErrorPrototype; }
210
211 JSObject *builtinEvalError() const { return b_evalError; }
212 JSObject *builtinRangeError() const { return b_rangeError; }
213 JSObject *builtinReferenceError() const { return b_referenceError; }
214 JSObject *builtinSyntaxError() const { return b_syntaxError; }
215 JSObject *builtinTypeError() const { return b_typeError; }
216 JSObject *builtinURIError() const { return b_uriError; }
217
218 JSObject *builtinEvalErrorPrototype() const { return b_evalErrorPrototype; }
219 JSObject *builtinRangeErrorPrototype() const { return b_rangeErrorPrototype; }
220 JSObject *builtinReferenceErrorPrototype() const { return b_referenceErrorPrototype; }
221 JSObject *builtinSyntaxErrorPrototype() const { return b_syntaxErrorPrototype; }
222 JSObject *builtinTypeErrorPrototype() const { return b_typeErrorPrototype; }
223 JSObject *builtinURIErrorPrototype() const { return b_uriErrorPrototype; }
224
225 void setCompatMode(Interpreter::CompatMode mode) { m_compatMode = mode; }
226 Interpreter::CompatMode compatMode() const { return m_compatMode; }
227
228 // Chained list of interpreters (ring)
229 static InterpreterImp* firstInterpreter() { return s_hook; }
230 InterpreterImp *nextInterpreter() const { return next; }
231 InterpreterImp *prevInterpreter() const { return prev; }
232
233 static InterpreterImp *interpreterWithGlobalObject(JSObject *);
234
235 void setContext(ContextImp *c) { _context = c; }
236 ContextImp *context() const { return _context; }
237
238 void saveBuiltins (SavedBuiltins &builtins) const;
239 void restoreBuiltins (const SavedBuiltins &builtins);
240
241 private:
242 void clear();
243 Interpreter *m_interpreter;
244 JSObject *global;
245 Debugger *dbg;
246
247 // Built-in properties of the object prototype. These are accessible
248 // from here even if they are replaced by js code (e.g. assigning to
249 // Array.prototype)
250
251 ProtectedPtr<JSObject> b_Object;
252 ProtectedPtr<JSObject> b_Function;
253 ProtectedPtr<JSObject> b_Array;
254 ProtectedPtr<JSObject> b_Boolean;
255 ProtectedPtr<JSObject> b_String;
256 ProtectedPtr<JSObject> b_Number;
257 ProtectedPtr<JSObject> b_Date;
258 ProtectedPtr<JSObject> b_RegExp;
259 ProtectedPtr<JSObject> b_Error;
260
261 ProtectedPtr<JSObject> b_ObjectPrototype;
262 ProtectedPtr<JSObject> b_FunctionPrototype;
263 ProtectedPtr<JSObject> b_ArrayPrototype;
264 ProtectedPtr<JSObject> b_BooleanPrototype;
265 ProtectedPtr<JSObject> b_StringPrototype;
266 ProtectedPtr<JSObject> b_NumberPrototype;
267 ProtectedPtr<JSObject> b_DatePrototype;
268 ProtectedPtr<JSObject> b_RegExpPrototype;
269 ProtectedPtr<JSObject> b_ErrorPrototype;
270
271 ProtectedPtr<JSObject> b_evalError;
272 ProtectedPtr<JSObject> b_rangeError;
273 ProtectedPtr<JSObject> b_referenceError;
274 ProtectedPtr<JSObject> b_syntaxError;
275 ProtectedPtr<JSObject> b_typeError;
276 ProtectedPtr<JSObject> b_uriError;
277
278 ProtectedPtr<JSObject> b_evalErrorPrototype;
279 ProtectedPtr<JSObject> b_rangeErrorPrototype;
280 ProtectedPtr<JSObject> b_referenceErrorPrototype;
281 ProtectedPtr<JSObject> b_syntaxErrorPrototype;
282 ProtectedPtr<JSObject> b_typeErrorPrototype;
283 ProtectedPtr<JSObject> b_uriErrorPrototype;
284
285 ExecState globExec;
286 Interpreter::CompatMode m_compatMode;
287
288 // Chained list of interpreters (ring) - for collector
289 static InterpreterImp* s_hook;
290 InterpreterImp *next, *prev;
291
292 ContextImp *_context;
293
294 int recursion;
295 };
296
297 class AttachedInterpreter;
298 class DebuggerImp {
299 public:
300
301 DebuggerImp() {
302 interps = 0;
303 isAborted = false;
304 }
305
306 void abort() { isAborted = true; }
307 bool aborted() const { return isAborted; }
308
309 AttachedInterpreter *interps;
310 bool isAborted;
311 };
312
313 class InternalFunctionImp : public JSObject {
314 public:
315 InternalFunctionImp();
316 InternalFunctionImp(FunctionPrototype*);
317 InternalFunctionImp(FunctionPrototype*, const Identifier&);
318
319 virtual bool implementsCall() const;
320 virtual JSValue* callAsFunction(ExecState*, JSObject* thisObjec, const List& args) = 0;
321 virtual bool implementsHasInstance() const;
322 virtual bool hasInstance(ExecState*, JSValue*);
323
324 virtual const ClassInfo* classInfo() const { return &info; }
325 static const ClassInfo info;
326 const Identifier& functionName() const { return m_name; }
327
328 private:
329 Identifier m_name;
330 };
331
332 // helper function for toInteger, toInt32, toUInt32 and toUInt16
333 double roundValue(ExecState *, JSValue *);
334
335#ifndef NDEBUG
336 void printInfo(ExecState *exec, const char *s, JSValue *, int lineno = -1);
337#endif
338
339inline LabelStack::~LabelStack()
340{
341 StackElem *prev;
342 for (StackElem *e = tos; e; e = prev) {
343 prev = e->prev;
344 delete e;
345 }
346}
347
348inline void LabelStack::pop()
349{
350 if (StackElem *e = tos) {
351 tos = e->prev;
352 delete e;
353 }
354}
355
356} // namespace
357
358#endif // INTERNAL_H
Note: See TracBrowser for help on using the repository browser.