Changeset 3342 in webkit for trunk/JavaScriptCore/kjs/testkjs.cpp
- Timestamp:
- Jan 16, 2003, 5:18:19 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/testkjs.cpp
r2772 r3342 22 22 23 23 #include <stdio.h> 24 #include <string.h> 24 25 25 26 #include "value.h" … … 40 41 { 41 42 fprintf(stderr,"--> %s\n",args[0].toString(exec).ascii()); 43 return Undefined(); 44 } 45 46 class VersionFunctionImp : public ObjectImp { 47 public: 48 VersionFunctionImp() : ObjectImp() {} 49 virtual bool implementsCall() const { return true; } 50 virtual Value call(ExecState *exec, Object &thisObj, const List &args); 51 }; 52 53 Value VersionFunctionImp::call(ExecState *exec, Object &/*thisObj*/, const List &args) 54 { 55 // We need this function for compatibility with the Mozilla JS tests but for now 56 // we don't actually do any version-specific handling 42 57 return Undefined(); 43 58 } … … 66 81 // add "print" for compatibility with the mozilla js shell 67 82 global.put(interp.globalExec(), Identifier("print"), Object(new TestFunctionImp())); 83 // add "version" for compatibility with the mozilla js shell 84 global.put(interp.globalExec(), Identifier("version"), Object(new VersionFunctionImp())); 68 85 69 86 const int BufferSize = 200000; … … 72 89 for (int i = 1; i < argc; i++) { 73 90 const char *file = argv[i]; 91 if (strcmp(file, "-f") == 0) 92 continue; 74 93 FILE *f = fopen(file, "r"); 75 94 if (!f) { … … 117 136 Interpreter::finalCheck(); 118 137 #endif 119 return ret ? 0 : 1;138 return ret ? 0 : 3; 120 139 }
Note:
See TracChangeset
for help on using the changeset viewer.