Changeset 15846 in webkit for trunk/JavaScriptCore/kjs/object.h
- Timestamp:
- Aug 13, 2006, 8:06:14 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/object.h
r15557 r15846 413 413 virtual bool hasInstance(ExecState *exec, JSValue *value); 414 414 415 /**416 * Returns the scope of this object. This is used when execution declared417 * functions - the execution context for the function is initialized with418 * extra object in it's scope. An example of this is functions declared419 * inside other functions:420 *421 * \code422 * function f() {423 *424 * function b() {425 * return prototype;426 * }427 *428 * var x = 4;429 * // do some stuff430 * }431 * f.prototype = new String();432 * \endcode433 *434 * When the function f.b is executed, its scope will include properties of435 * f. So in the example above the return value of f.b() would be the new436 * String object that was assigned to f.prototype.437 *438 * @param exec The current execution state439 * @return The function's scope440 */441 const ScopeChain &scope() const { return _scope; }442 void setScope(const ScopeChain &s) { _scope = s; }443 444 415 virtual void getPropertyNames(ExecState*, PropertyNameArray&); 445 446 /**447 * Returns the internal value of the object. This is used for objects such448 * as String and Boolean which are wrappers for native types. The interal449 * value is the actual value represented by the wrapper objects.450 *451 * @see ECMA 8.6.2452 * @return The internal value of the object453 */454 JSValue *internalValue() const;455 456 /**457 * Sets the internal value of the object458 *459 * @see internalValue()460 *461 * @param v The new internal value462 */463 void setInternalValue(JSValue *v);464 416 465 417 virtual JSValue *toPrimitive(ExecState *exec, JSType preferredType = UnspecifiedType) const; … … 508 460 const HashEntry* findPropertyHashEntry( const Identifier& propertyName ) const; 509 461 JSValue *_proto; 510 JSValue *_internalValue;511 ScopeChain _scope;512 462 }; 513 463 … … 556 506 : JSCell(destructorIsThreadSafe) 557 507 , _proto(proto) 558 , _internalValue(0)559 508 { 560 509 assert(proto); … … 564 513 : JSCell(destructorIsThreadSafe) 565 514 , _proto(jsNull()) 566 , _internalValue(0) 567 { 568 } 569 570 inline JSValue *JSObject::internalValue() const 571 { 572 return _internalValue; 573 } 574 575 inline void JSObject::setInternalValue(JSValue *v) 576 { 577 _internalValue = v; 515 { 578 516 } 579 517 … … 647 585 return false; 648 586 } 587 649 588 650 589 // FIXME: Put this function in a separate file named something like scope_chain_mark.h -- can't put it in scope_chain.h since it depends on JSObject.
Note:
See TracChangeset
for help on using the changeset viewer.