Changeset 26914 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Oct 23, 2007, 12:00:37 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r26832 r26914 1 1 /* 2 * This file is part of the KDE libraries3 2 * Copyright (C) 1999-2002 Harri Porten ([email protected]) 4 3 * Copyright (C) 2001 Peter Kelly ([email protected]) … … 26 25 #include "nodes.h" 27 26 28 #include <math.h> 29 #ifdef KJS_DEBUG_MEM 30 #include <stdio.h> 31 #include <typeinfo> 32 #endif 33 27 #include "PropertyNameArray.h" 34 28 #include "context.h" 35 29 #include "debugger.h" … … 37 31 #include "lexer.h" 38 32 #include "operations.h" 39 #include "PropertyNameArray.h"33 #include <math.h> 40 34 #include <wtf/Assertions.h> 35 #include <wtf/HashCountedSet.h> 41 36 #include <wtf/HashSet.h> 42 #include <wtf/HashCountedSet.h>43 37 #include <wtf/MathExtras.h> 44 38 45 using namespace KJS; 39 namespace KJS { 46 40 47 41 #define KJS_BREAKPOINT \ … … 49 43 return Completion(Normal); 50 44 51 #define KJS_ABORTPOINT \52 if (Debugger::debuggersPresent > 0 && \53 exec->dynamicInterpreter()->imp()->debugger() && \54 exec->dynamicInterpreter()->imp()->debugger()->imp()->aborted()) \55 return Completion(Normal);56 57 45 #define KJS_CHECKEXCEPTION \ 58 if (exec->hadException()) { \ 59 JSValue *ex = exec->exception(); \ 60 exec->clearException(); \ 61 handleException(exec, ex); \ 62 return Completion(Throw, ex); \ 63 } \ 46 if (exec->hadException()) \ 47 return rethrowException(exec); \ 64 48 if (Collector::isOutOfMemory()) \ 65 return Completion(Throw, Error::create(exec, GeneralError, "Out of memory"));49 return createOutOfMemoryCompletion(exec); 66 50 67 51 #define KJS_CHECKEXCEPTIONVALUE \ … … 80 64 if (Collector::isOutOfMemory()) \ 81 65 return List(); // will be picked up by KJS_CHECKEXCEPTION 66 67 static Completion createOutOfMemoryCompletion(ExecState* exec) 68 { 69 return Completion(Throw, Error::create(exec, GeneralError, "Out of memory")); 70 } 82 71 83 72 // ------------------------------ Node ----------------------------------------- … … 193 182 int position = string.find("%s"); 194 183 ASSERT(position != -1); 195 string = string.substr(0, position) + substring + string.substr(position + 2); 184 UString newString = string.substr(0, position); 185 newString.append(substring); 186 newString.append(string.substr(position + 2)); 187 string = newString; 196 188 } 197 189 … … 299 291 dbg->imp()->abort(); 300 292 } 293 } 294 295 Completion Node::rethrowException(ExecState* exec) 296 { 297 JSValue* exception = exec->exception(); 298 exec->clearException(); 299 handleException(exec, exception); 300 return Completion(Throw, exception); 301 301 } 302 302 … … 2616 2616 { 2617 2617 } 2618 2619 }
Note:
See TracChangeset
for help on using the changeset viewer.