Changeset 15846 in webkit for trunk/JavaScriptCore/kjs/function.h
- Timestamp:
- Aug 13, 2006, 8:06:14 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function.h
r15526 r15846 62 62 RefPtr<FunctionBodyNode> body; 63 63 64 /** 65 * Returns the scope of this object. This is used when execution declared 66 * functions - the execution context for the function is initialized with 67 * extra object in it's scope. An example of this is functions declared 68 * inside other functions: 69 * 70 * \code 71 * function f() { 72 * 73 * function b() { 74 * return prototype; 75 * } 76 * 77 * var x = 4; 78 * // do some stuff 79 * } 80 * f.prototype = new String(); 81 * \endcode 82 * 83 * When the function f.b is executed, its scope will include properties of 84 * f. So in the example above the return value of f.b() would be the new 85 * String object that was assigned to f.prototype. 86 * 87 * @param exec The current execution state 88 * @return The function's scope 89 */ 90 const ScopeChain &scope() const { return _scope; } 91 void setScope(const ScopeChain &s) { _scope = s; } 92 93 virtual void mark(); 64 94 protected: 65 95 OwnPtr<Parameter> param; 66 96 67 97 private: 98 ScopeChain _scope; 99 68 100 static JSValue *argumentsGetter(ExecState *, JSObject *, const Identifier &, const PropertySlot&); 69 101 static JSValue *lengthGetter(ExecState *, JSObject *, const Identifier &, const PropertySlot&);
Note:
See TracChangeset
for help on using the changeset viewer.