Changeset 32807 in webkit for trunk/JavaScriptCore/kjs/testkjs.cpp
- Timestamp:
- May 2, 2008, 3:07:53 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/testkjs.cpp
r31404 r32807 132 132 GlobalObject::GlobalObject(Vector<UString>& arguments) 133 133 { 134 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "debug", functionDebug));135 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "print", functionPrint));136 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 0, "quit", functionQuit));137 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 0, "gc", functionGC));138 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "version", functionVersion));139 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "run", functionRun));140 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 1, "load", functionLoad));141 putDirectFunction(new PrototypeFunction(globalExec(), functionPrototype(), 0, "readline", functionReadline));134 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "debug", functionDebug)); 135 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "print", functionPrint)); 136 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, "quit", functionQuit)); 137 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, "gc", functionGC)); 138 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "version", functionVersion)); 139 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "run", functionRun)); 140 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, "load", functionLoad)); 141 putDirectFunction(new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, "readline", functionReadline)); 142 142 143 143 JSObject* array = arrayConstructor()->construct(globalExec(), globalExec()->emptyList()); 144 144 for (size_t i = 0; i < arguments.size(); ++i) 145 array->put(globalExec(), i, jsString( arguments[i]));145 array->put(globalExec(), i, jsString(globalExec(), arguments[i])); 146 146 putDirect("arguments", array); 147 147 … … 162 162 } 163 163 164 JSValue* functionGC(ExecState* , JSObject*, const List&)164 JSValue* functionGC(ExecState* exec, JSObject*, const List&) 165 165 { 166 166 JSLock lock; 167 Collector::collect();167 exec->heap()->collect(); 168 168 return jsUndefined(); 169 169 } … … 188 188 stopWatch.stop(); 189 189 190 return jsNumber( stopWatch.getElapsedMS());190 return jsNumber(exec, stopWatch.getElapsedMS()); 191 191 } 192 192 … … 203 203 } 204 204 205 JSValue* functionReadline(ExecState* , JSObject*, const List&)205 JSValue* functionReadline(ExecState* exec, JSObject*, const List&) 206 206 { 207 207 Vector<char, 256> line; … … 214 214 } 215 215 line.append('\0'); 216 return jsString( line.data());216 return jsString(exec, line.data()); 217 217 } 218 218 … … 346 346 347 347 #ifndef NDEBUG 348 Collector::collect();348 Heap::threadHeap()->collect(); 349 349 #endif 350 350
Note:
See TracChangeset
for help on using the changeset viewer.