Commit 01106a97 authored by mjs's avatar mjs

Reviewed by Darin.

	- made minor tweaks to work better with Mozilla's JavaScript tests.

        * kjs/testkjs.cpp:
        (VersionFunctionImp::call): Implemented
        (main): Ignore files named -f (hack to match -f <filename syntax
	that moz JavaScript tests expect). Also use return code 3 instead
	of 1 for uncaught exception.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 69a82b6b
2003-01-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- made minor tweaks to work better with Mozilla's JavaScript tests.
* kjs/testkjs.cpp:
(VersionFunctionImp::call): Implemented
(main): Ignore files named -f (hack to match -f <filename syntax
that moz JavaScript tests expect). Also use return code 3 instead
of 1 for uncaught exception.
2003-01-16 Darin Adler <darin@apple.com>
* kjs/number_object.cpp: (NumberObjectImp::construct):
......
2003-01-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- made minor tweaks to work better with Mozilla's JavaScript tests.
* kjs/testkjs.cpp:
(VersionFunctionImp::call): Implemented
(main): Ignore files named -f (hack to match -f <filename syntax
that moz JavaScript tests expect). Also use return code 3 instead
of 1 for uncaught exception.
2003-01-16 Darin Adler <darin@apple.com>
* kjs/number_object.cpp: (NumberObjectImp::construct):
......
......@@ -21,6 +21,7 @@
*/
#include <stdio.h>
#include <string.h>
#include "value.h"
#include "object.h"
......@@ -42,6 +43,20 @@ Value TestFunctionImp::call(ExecState *exec, Object &/*thisObj*/, const List &ar
return Undefined();
}
class VersionFunctionImp : public ObjectImp {
public:
VersionFunctionImp() : ObjectImp() {}
virtual bool implementsCall() const { return true; }
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
};
Value VersionFunctionImp::call(ExecState *exec, Object &/*thisObj*/, const List &args)
{
// We need this function for compatibility with the Mozilla JS tests but for now
// we don't actually do any version-specific handling
return Undefined();
}
class GlobalImp : public ObjectImp {
public:
virtual UString className() const { return "global"; }
......@@ -65,12 +80,16 @@ int main(int argc, char **argv)
global.put(interp.globalExec(), Identifier("debug"), Object(new TestFunctionImp()));
// add "print" for compatibility with the mozilla js shell
global.put(interp.globalExec(), Identifier("print"), Object(new TestFunctionImp()));
// add "version" for compatibility with the mozilla js shell
global.put(interp.globalExec(), Identifier("version"), Object(new VersionFunctionImp()));
const int BufferSize = 200000;
char code[BufferSize];
for (int i = 1; i < argc; i++) {
const char *file = argv[i];
if (strcmp(file, "-f") == 0)
continue;
FILE *f = fopen(file, "r");
if (!f) {
fprintf(stderr, "Error opening %s.\n", file);
......@@ -116,5 +135,5 @@ int main(int argc, char **argv)
#ifdef KJS_DEBUG_MEM
Interpreter::finalCheck();
#endif
return ret ? 0 : 1;
return ret ? 0 : 3;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment