Changeset 127191 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Aug 30, 2012, 2:23:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r123417 r127191 81 81 using namespace WTF; 82 82 83 static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer);83 static bool fillBufferWithContentsOfFile(const String& fileName, Vector<char>& buffer); 84 84 85 85 static EncodedJSValue JSC_HOST_CALL functionPrint(ExecState*); … … 130 130 bool m_exitCode; 131 131 Vector<Script> m_scripts; 132 Vector< UString> m_arguments;132 Vector<String> m_arguments; 133 133 134 134 void parseArguments(int, char**); … … 170 170 typedef JSGlobalObject Base; 171 171 172 static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector< UString>& arguments)172 static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<String>& arguments) 173 173 { 174 174 GlobalObject* object = new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure); … … 188 188 189 189 protected: 190 void finishCreation(JSGlobalData& globalData, const Vector< UString>& arguments)190 void finishCreation(JSGlobalData& globalData, const Vector<String>& arguments) 191 191 { 192 192 Base::finishCreation(globalData); … … 253 253 } 254 254 255 static inline SourceCode jscSource(const char* utf8, const UString& filename)255 static inline SourceCode jscSource(const char* utf8, const String& filename) 256 256 { 257 257 // Find the the first non-ascii character, or nul. … … 263 263 // Fast case - string is all ascii. 264 264 if (!*pos) 265 return makeSource( UString(utf8, asciiLength), filename);265 return makeSource(String(utf8, asciiLength), filename); 266 266 267 267 // Slow case - contains non-ascii characters, use fromUTF8WithLatin1Fallback. … … 348 348 EncodedJSValue JSC_HOST_CALL functionRun(ExecState* exec) 349 349 { 350 UString fileName = exec->argument(0).toString(exec)->value(exec);350 String fileName = exec->argument(0).toString(exec)->value(exec); 351 351 Vector<char> script; 352 352 if (!fillBufferWithContentsOfFile(fileName, script)) 353 353 return JSValue::encode(throwError(exec, createError(exec, "Could not open file."))); 354 354 355 GlobalObject* globalObject = GlobalObject::create(exec->globalData(), GlobalObject::createStructure(exec->globalData(), jsNull()), Vector< UString>());355 GlobalObject* globalObject = GlobalObject::create(exec->globalData(), GlobalObject::createStructure(exec->globalData(), jsNull()), Vector<String>()); 356 356 357 357 JSValue exception; … … 371 371 EncodedJSValue JSC_HOST_CALL functionLoad(ExecState* exec) 372 372 { 373 UString fileName = exec->argument(0).toString(exec)->value(exec);373 String fileName = exec->argument(0).toString(exec)->value(exec); 374 374 Vector<char> script; 375 375 if (!fillBufferWithContentsOfFile(fileName, script)) … … 387 387 EncodedJSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec) 388 388 { 389 UString fileName = exec->argument(0).toString(exec)->value(exec);389 String fileName = exec->argument(0).toString(exec)->value(exec); 390 390 Vector<char> script; 391 391 if (!fillBufferWithContentsOfFile(fileName, script)) … … 524 524 { 525 525 const char* script; 526 UString fileName;526 String fileName; 527 527 Vector<char> scriptBuffer; 528 528 … … 587 587 static void runInteractive(GlobalObject* globalObject) 588 588 { 589 UString interpreterName("Interpreter");589 String interpreterName("Interpreter"); 590 590 591 591 while (true) { … … 751 751 } 752 752 753 static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer)753 static bool fillBufferWithContentsOfFile(const String& fileName, Vector<char>& buffer) 754 754 { 755 755 FILE* f = fopen(fileName.utf8().data(), "r");
Note:
See TracChangeset
for help on using the changeset viewer.