Changeset 164970 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Mar 2, 2014, 9:42:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r164812 r164970 219 219 static EncodedJSValue JSC_HOST_CALL functionDebug(ExecState*); 220 220 static EncodedJSValue JSC_HOST_CALL functionDescribe(ExecState*); 221 static EncodedJSValue JSC_HOST_CALL functionDescribeArray(ExecState*); 221 222 static EncodedJSValue JSC_HOST_CALL functionJSCStack(ExecState*); 222 223 static EncodedJSValue JSC_HOST_CALL functionGCAndSweep(ExecState*); … … 344 345 addFunction(vm, "debug", functionDebug, 1); 345 346 addFunction(vm, "describe", functionDescribe, 1); 347 addFunction(vm, "describeArray", functionDescribeArray, 1); 346 348 addFunction(vm, "print", functionPrint, 1); 347 349 addFunction(vm, "quit", functionQuit, 0); … … 463 465 EncodedJSValue JSC_HOST_CALL functionDescribe(ExecState* exec) 464 466 { 465 fprintf(stderr, "--> %s\n", toCString(exec->argument(0)).data()); 466 return JSValue::encode(jsUndefined()); 467 if (exec->argumentCount() < 1) 468 return JSValue::encode(jsUndefined()); 469 return JSValue::encode(jsString(exec, toString(exec->argument(0)))); 470 } 471 472 EncodedJSValue JSC_HOST_CALL functionDescribeArray(ExecState* exec) 473 { 474 if (exec->argumentCount() < 1) 475 return JSValue::encode(jsUndefined()); 476 JSObject* object = jsDynamicCast<JSObject*>(exec->argument(0)); 477 if (!object) 478 return JSValue::encode(jsString(exec, "<not object>")); 479 return JSValue::encode(jsString(exec, toString("<Public length: ", object->getArrayLength(), "; vector length: ", object->getVectorLength(), ">"))); 467 480 } 468 481
Note:
See TracChangeset
for help on using the changeset viewer.