Changeset 3009 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Dec 11, 2002, 7:59:24 PM (22 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function.cpp
r2883 r3009 545 545 break; 546 546 } 547 #if !NDEBUG 548 case KJSPrint: { 549 UString str = args[0].toString(exec); 550 puts(str.ascii()); 551 } 552 #endif 547 553 } 548 554 -
trunk/JavaScriptCore/kjs/function.h
r2883 r3009 127 127 virtual Value call(ExecState *exec, Object &thisObj, const List &args); 128 128 virtual CodeType codeType() const; 129 enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape }; 129 enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape 130 #if !NDEBUG 131 , KJSPrint 132 #endif 133 }; 130 134 private: 131 135 int id; -
trunk/JavaScriptCore/kjs/internal.cpp
r2935 r3009 648 648 global.put(globExec,"escape", Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::Escape, 1)), DontEnum); 649 649 global.put(globExec,"unescape", Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::UnEscape, 1)), DontEnum); 650 #if !NDEBUG 651 global.put(globExec,"kjsprint", Object(new GlobalFuncImp(globExec,funcProto,GlobalFuncImp::KJSPrint, 1)), DontEnum); 652 #endif 650 653 651 654 // built-in objects -
trunk/JavaScriptCore/kjs/interpreter.cpp
r2935 r3009 112 112 Completion Interpreter::evaluate(const UString &code, const Value &thisV) 113 113 { 114 return rep->evaluate(code,thisV); 114 Completion comp = rep->evaluate(code,thisV); 115 #if !NDEBUG 116 if (comp.complType() == Throw) { 117 lock(); 118 ExecState *exec = rep->globalExec(); 119 printf("Uncaught exception: %s\n", comp.value().toObject(exec).toString(exec).ascii()); 120 unlock(); 121 } 122 #endif 123 return comp; 115 124 } 116 125 -
trunk/JavaScriptCore/kjs/nodes.cpp
r2974 r3009 694 694 695 695 if (v.type() != ObjectType) { 696 return throwError(exec, TypeError, " Expression is no object. Cannot be new'ed");696 return throwError(exec, TypeError, "Value used with new is not object."); 697 697 } 698 698 699 699 Object constr = Object(static_cast<ObjectImp*>(v.imp())); 700 700 if (!constr.implementsConstruct()) { 701 return throwError(exec, TypeError, " Expression is noconstructor.");701 return throwError(exec, TypeError, "Value asked to construct is not a constructor."); 702 702 } 703 703 … … 743 743 printInfo(exec, "WARNING: Failed function call attempt on", v, line); 744 744 #endif 745 return throwError(exec, TypeError, " Expression is noobject. Cannot be called.");745 return throwError(exec, TypeError, "Value is not object. Cannot be called."); 746 746 } 747 747 … … 752 752 printInfo(exec, "Failed function call attempt on", v, line); 753 753 #endif 754 return throwError(exec, TypeError, " Expressiondoes not allow calls.");754 return throwError(exec, TypeError, "Object does not allow calls."); 755 755 } 756 756 … … 761 761 printInfo(exec, "Exceeded maximum function call depth", v, line); 762 762 #endif 763 return throwError(exec, RangeError, "Exceeded maximum call stack size.");763 return throwError(exec, RangeError, "Exceeded maximum function call depth."); 764 764 } 765 765 #endif … … 1230 1230 if (v2.type() != ObjectType) 1231 1231 return throwError(exec, TypeError, 1232 " Shift expression not an object into IN expression." );1232 "Used IN expression with non-object." ); 1233 1233 Object o2(static_cast<ObjectImp*>(v2.imp())); 1234 1234 b = o2.hasProperty(exec, Identifier(v1.toString(exec))); … … 1236 1236 if (v2.type() != ObjectType) 1237 1237 return throwError(exec, TypeError, 1238 " Called instanceof operator on non-object." );1238 "Used instanceof operator on non-object." ); 1239 1239 1240 1240 Object o2(static_cast<ObjectImp*>(v2.imp()));
Note:
See TracChangeset
for help on using the changeset viewer.