Changeset 40169 in webkit for trunk/JavaScriptCore/runtime/ExceptionHelpers.cpp
- Timestamp:
- Jan 23, 2009, 11:40:56 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ExceptionHelpers.cpp
r40046 r40169 32 32 #include "CodeBlock.h" 33 33 #include "CallFrame.h" 34 #include "JSGlobalObjectFunctions.h" 34 35 #include "JSObject.h" 35 36 #include "JSNotAnObject.h" … … 38 39 39 40 namespace JSC { 40 41 static void substitute(UString& string, const UString& substring)42 {43 int position = string.find("%s");44 ASSERT(position != -1);45 UString newString = string.substr(0, position);46 newString.append(substring);47 newString.append(string.substr(position + 2));48 string = newString;49 }50 41 51 42 class InterruptedExecutionError : public JSObject { … … 64 55 } 65 56 66 JSValuePtr createError(ExecState* exec, ErrorType e, const char* msg)57 static JSValuePtr createError(ExecState* exec, ErrorType e, const char* msg) 67 58 { 68 59 return Error::create(exec, e, msg, -1, -1, 0); 69 }70 71 JSValuePtr createError(ExecState* exec, ErrorType e, const char* msg, const Identifier& label)72 {73 UString message = msg;74 substitute(message, label.ustring());75 return Error::create(exec, e, message, -1, -1, 0);76 }77 78 JSValuePtr createError(ExecState* exec, ErrorType e, const char* msg, JSValuePtr v)79 {80 UString message = msg;81 substitute(message, v.toString(exec));82 return Error::create(exec, e, message, -1, -1, 0);83 60 } 84 61 … … 103 80 } 104 81 105 bool isStrWhiteSpace(UChar c);106 107 82 static UString createErrorMessage(ExecState* exec, CodeBlock* codeBlock, int, int expressionStart, int expressionStop, JSValuePtr value, UString error) 108 83 {
Note:
See TracChangeset
for help on using the changeset viewer.