Error [[Class]]

Harri Porten porten at froglogic.com
Sun Feb 22 17:30:11 CET 2004


I fixed some bugs found by the Mozilla test suite that are related to the
Error objects. Patch is attached but the JavaScriptCore implementation is
so different so this may not apply.

The essential tests you may want to make:

shouldBe("Object.prototype.toString.apply(Error())", "'[object Error]'");
shouldBe("Object.prototype.toString.apply(Error)", "'[object Function]'");
shouldBe("Object.prototype.toString.apply(EvalError)", "'[object Function]'");

Harri.
-------------- next part --------------
--- error_object.cpp	22 Feb 2004 15:38:31 -0000	1.28
+++ error_object.cpp	22 Feb 2004 16:30:40 -0000	1.29
@@ -32,7 +32,7 @@
 
 // ------------------------------ ErrorInstanceImp ----------------------------
 
-const ClassInfo ErrorInstanceImp::info = {"Function", 0, 0, 0};
+const ClassInfo ErrorInstanceImp::info = {"Error", 0, 0, 0};
 
 ErrorInstanceImp::ErrorInstanceImp(ObjectImp *proto)
   : ObjectImp(proto)
@@ -147,7 +147,7 @@
 
 // ------------------------------ NativeErrorImp -------------------------------
 
-const ClassInfo NativeErrorImp::info = {"Error", &InternalFunctionImp::info, 0, 0};
+const ClassInfo NativeErrorImp::info = {"Function", &InternalFunctionImp::info, 0, 0};
 
 NativeErrorImp::NativeErrorImp(ExecState */*exec*/, FunctionPrototypeImp *funcProto,
                                const Object &prot)


More information about the Khtml-devel mailing list