Changeset 44870 in webkit for trunk/JavaScriptCore/jsc.cpp
- Timestamp:
- Jun 19, 2009, 1:57:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jsc.cpp
r44766 r44870 76 76 static JSValue JSC_HOST_CALL functionRun(ExecState*, JSObject*, JSValue, const ArgList&); 77 77 static JSValue JSC_HOST_CALL functionLoad(ExecState*, JSObject*, JSValue, const ArgList&); 78 static JSValue JSC_HOST_CALL functionCheckSyntax(ExecState*, JSObject*, JSValue, const ArgList&); 78 79 static JSValue JSC_HOST_CALL functionReadline(ExecState*, JSObject*, JSValue, const ArgList&); 79 80 static NO_RETURN JSValue JSC_HOST_CALL functionQuit(ExecState*, JSObject*, JSValue, const ArgList&); … … 185 186 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "run"), functionRun)); 186 187 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "load"), functionLoad)); 188 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax)); 187 189 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline)); 188 190 … … 260 262 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 261 263 Completion result = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName)); 264 if (result.complType() == Throw) 265 exec->setException(result.value()); 266 return result.value(); 267 } 268 269 JSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec, JSObject* o, JSValue v, const ArgList& args) 270 { 271 UNUSED_PARAM(o); 272 UNUSED_PARAM(v); 273 UString fileName = args.at(0).toString(exec); 274 Vector<char> script; 275 if (!fillBufferWithContentsOfFile(fileName, script)) 276 return throwError(exec, GeneralError, "Could not open file."); 277 278 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 279 Completion result = checkSyntax(globalObject->globalExec(), makeSource(script.data(), fileName)); 262 280 if (result.complType() == Throw) 263 281 exec->setException(result.value());
Note:
See TracChangeset
for help on using the changeset viewer.