Changeset 10084 in webkit for trunk/JavaScriptCore/kjs/interpreter.h
- Timestamp:
- Aug 7, 2005, 9:07:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/interpreter.h
r10076 r10084 26 26 #define _KJS_INTERPRETER_H_ 27 27 28 #include "object_wrapper.h"29 28 #include "value.h" 30 29 #include "types.h" … … 35 34 class InterpreterImp; 36 35 class RuntimeMethodImp; 36 class ScopeChain; 37 37 38 38 namespace Bindings { … … 79 79 * @return The execution context's variable object 80 80 */ 81 Object 81 ObjectImp *variableObject() const; 82 82 83 83 /** … … 96 96 * @return The execution context's "this" value 97 97 */ 98 Object 98 ObjectImp *thisValue() const; 99 99 100 100 /** … … 153 153 * @param global The object to use as the global object for this interpreter 154 154 */ 155 Interpreter( const Object &global);155 Interpreter(ObjectImp *global); 156 156 /** 157 157 * Creates a new interpreter. A global object will be created and … … 165 165 * execution performed by this interpreter 166 166 */ 167 Object &globalObject() const;167 ObjectImp *globalObject() const; 168 168 169 169 void initGlobalObject(); … … 209 209 * @return A completion object representing the result of the execution. 210 210 */ 211 Completion evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, const Value &thisV = Value());211 Completion evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, ValueImp *thisV = NULL); 212 212 213 213 // Overload of evaluate to keep JavaScriptGlue both source and binary compatible. 214 Completion evaluate(const UString &code, const Value &thisV = Value(), const UString &sourceFilename = UString());214 Completion evaluate(const UString &code, ValueImp *thisV = NULL, const UString &sourceFilename = UString()); 215 215 216 216 /** … … 230 230 * @return The builtin "Object" object 231 231 */ 232 Object 232 ObjectImp *builtinObject() const; 233 233 234 234 /** 235 235 * Returns the builtin "Function" object. 236 236 */ 237 Object 237 ObjectImp *builtinFunction() const; 238 238 239 239 /** 240 240 * Returns the builtin "Array" object. 241 241 */ 242 Object 242 ObjectImp *builtinArray() const; 243 243 244 244 /** 245 245 * Returns the builtin "Boolean" object. 246 246 */ 247 Object 247 ObjectImp *builtinBoolean() const; 248 248 249 249 /** 250 250 * Returns the builtin "String" object. 251 251 */ 252 Object 252 ObjectImp *builtinString() const; 253 253 254 254 /** 255 255 * Returns the builtin "Number" object. 256 256 */ 257 Object 257 ObjectImp *builtinNumber() const; 258 258 259 259 /** 260 260 * Returns the builtin "Date" object. 261 261 */ 262 Object 262 ObjectImp *builtinDate() const; 263 263 264 264 /** 265 265 * Returns the builtin "RegExp" object. 266 266 */ 267 Object 267 ObjectImp *builtinRegExp() const; 268 268 269 269 /** 270 270 * Returns the builtin "Error" object. 271 271 */ 272 Object 272 ObjectImp *builtinError() const; 273 273 274 274 /** 275 275 * Returns the builtin "Object.prototype" object. 276 276 */ 277 Object 277 ObjectImp *builtinObjectPrototype() const; 278 278 279 279 /** 280 280 * Returns the builtin "Function.prototype" object. 281 281 */ 282 Object 282 ObjectImp *builtinFunctionPrototype() const; 283 283 284 284 /** 285 285 * Returns the builtin "Array.prototype" object. 286 286 */ 287 Object 287 ObjectImp *builtinArrayPrototype() const; 288 288 289 289 /** 290 290 * Returns the builtin "Boolean.prototype" object. 291 291 */ 292 Object 292 ObjectImp *builtinBooleanPrototype() const; 293 293 294 294 /** 295 295 * Returns the builtin "String.prototype" object. 296 296 */ 297 Object 297 ObjectImp *builtinStringPrototype() const; 298 298 299 299 /** 300 300 * Returns the builtin "Number.prototype" object. 301 301 */ 302 Object 302 ObjectImp *builtinNumberPrototype() const; 303 303 304 304 /** 305 305 * Returns the builtin "Date.prototype" object. 306 306 */ 307 Object 307 ObjectImp *builtinDatePrototype() const; 308 308 309 309 /** 310 310 * Returns the builtin "RegExp.prototype" object. 311 311 */ 312 Object 312 ObjectImp *builtinRegExpPrototype() const; 313 313 314 314 /** 315 315 * Returns the builtin "Error.prototype" object. 316 316 */ 317 Object 317 ObjectImp *builtinErrorPrototype() const; 318 318 319 319 /** 320 320 * The initial value of "Error" global property 321 321 */ 322 Object 323 Object 324 Object 325 Object 326 Object 327 Object 328 329 Object 330 Object 331 Object 332 Object 333 Object 334 Object 322 ObjectImp *builtinEvalError() const; 323 ObjectImp *builtinRangeError() const; 324 ObjectImp *builtinReferenceError() const; 325 ObjectImp *builtinSyntaxError() const; 326 ObjectImp *builtinTypeError() const; 327 ObjectImp *builtinURIError() const; 328 329 ObjectImp *builtinEvalErrorPrototype() const; 330 ObjectImp *builtinRangeErrorPrototype() const; 331 ObjectImp *builtinReferenceErrorPrototype() const; 332 ObjectImp *builtinSyntaxErrorPrototype() const; 333 ObjectImp *builtinTypeErrorPrototype() const; 334 ObjectImp *builtinURIErrorPrototype() const; 335 335 336 336 enum CompatMode { NativeMode, IECompat, NetscapeCompat }; … … 381 381 * security checks. 382 382 */ 383 virtual bool isGlobalObject( const Value &v) { return false; }383 virtual bool isGlobalObject(ValueImp *v) { return false; } 384 384 385 385 /** … … 400 400 virtual bool isSafeScript (const Interpreter *target) { return true; } 401 401 402 virtual void *createLanguageInstanceForValue (ExecState *exec, int language, const Object &value, const Bindings::RootObject *origin, const Bindings::RootObject *current);402 virtual void *createLanguageInstanceForValue (ExecState *exec, int language, ObjectImp *value, const Bindings::RootObject *origin, const Bindings::RootObject *current); 403 403 #endif 404 404 … … 471 471 Context context() const { return _context; } 472 472 473 void setException( const Value &e) { _exception = e; }474 void clearException() { _exception = Value(); }475 Value 476 bool hadException() const { return !_exception.isNull(); }473 void setException(ValueImp *e) { _exception = e; } 474 void clearException() { _exception = NULL; } 475 ValueImp *exception() const { return _exception; } 476 bool hadException() const { return _exception; } 477 477 478 478 private: 479 479 ExecState(Interpreter *interp, ContextImp *con) 480 : _interpreter(interp), _context(con) { }480 : _interpreter(interp), _context(con), _exception(NULL) { } 481 481 Interpreter *_interpreter; 482 482 ContextImp *_context; 483 Value 483 ValueImp *_exception; 484 484 }; 485 485
Note:
See TracChangeset
for help on using the changeset viewer.