Changeset 160208 in webkit for trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
- Timestamp:
- Dec 5, 2013, 7:03:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r160204 r160208 213 213 } 214 214 215 JSValue JSFunction::argumentsGetter(ExecState* exec, JSValue slotBase, PropertyName)216 { 217 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);215 EncodedJSValue JSFunction::argumentsGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 216 { 217 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 218 218 ASSERT(!thisObj->isHostFunction()); 219 219 220 return retrieveArguments(exec, thisObj);220 return JSValue::encode(retrieveArguments(exec, thisObj)); 221 221 } 222 222 … … 268 268 } 269 269 270 JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, PropertyName)271 { 272 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);270 EncodedJSValue JSFunction::callerGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 271 { 272 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 273 273 ASSERT(!thisObj->isHostFunction()); 274 274 JSValue caller = retrieveCallerFunction(exec, thisObj); … … 276 276 // See ES5.1 15.3.5.4 - Function.caller may not be used to retrieve a strict caller. 277 277 if (!caller.isObject() || !asObject(caller)->inherits(JSFunction::info())) 278 return caller;278 return JSValue::encode(caller); 279 279 JSFunction* function = jsCast<JSFunction*>(caller); 280 280 if (function->isHostFunction() || !function->jsExecutable()->isStrictMode()) 281 return caller;282 return throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller"));283 } 284 285 JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, PropertyName)286 { 287 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);281 return JSValue::encode(caller); 282 return JSValue::encode(throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller"))); 283 } 284 285 EncodedJSValue JSFunction::lengthGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 286 { 287 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 288 288 ASSERT(!thisObj->isHostFunction()); 289 return jsNumber(thisObj->jsExecutable()->parameterCount());290 } 291 292 JSValue JSFunction::nameGetter(ExecState*, JSValue slotBase, PropertyName)293 { 294 JSFunction* thisObj = jsCast<JSFunction*>( slotBase);289 return JSValue::encode(jsNumber(thisObj->jsExecutable()->parameterCount())); 290 } 291 292 EncodedJSValue JSFunction::nameGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) 293 { 294 JSFunction* thisObj = jsCast<JSFunction*>(JSValue::decode(slotBase)); 295 295 ASSERT(!thisObj->isHostFunction()); 296 return thisObj->jsExecutable()->nameValue();296 return JSValue::encode(thisObj->jsExecutable()->nameValue()); 297 297 } 298 298
Note:
See TracChangeset
for help on using the changeset viewer.