2008-06-29  Sam Weinig  <sam@webkit.org>

        Rubber-stamped by Cameron Zwarich.

        Splits ErrorConstructor, ErrorPrototype,  NativeErrorConstructor and
        NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.

        * GNUmakefile.am:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * kjs/AllInOneFile.cpp:
        * kjs/ArrayConstructor.cpp:
        * kjs/ArrayPrototype.cpp:
        * kjs/BooleanPrototype.cpp:
        * kjs/DatePrototype.cpp:
        * kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
        * kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
        * kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
        * kjs/ErrorInstance.h: Copied from kjs/error_object.h.
        * kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
        * kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
        * kjs/JSGlobalObject.cpp:
        * kjs/JSObject.cpp:
        * kjs/JSValue.cpp:
        * kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
        * kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
        * kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
        * kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
        * kjs/NumberPrototype.cpp:
        * kjs/RegExpConstructor.cpp:
        * kjs/RegExpObject.cpp:
        * kjs/RegExpPrototype.cpp:
        * kjs/StringPrototype.cpp:
        * kjs/error_object.cpp: Removed.
        * kjs/error_object.h: Removed.
        * kjs/internal.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index abde7ea..8014327 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,5 +1,44 @@
 2008-06-29  Sam Weinig  <sam@webkit.org>
 
+        Rubber-stamped by Cameron Zwarich.
+
+        Splits ErrorConstructor, ErrorPrototype,  NativeErrorConstructor and
+        NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
+
+        * GNUmakefile.am:
+        * JavaScriptCore.pri:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * JavaScriptCoreSources.bkl:
+        * kjs/AllInOneFile.cpp:
+        * kjs/ArrayConstructor.cpp:
+        * kjs/ArrayPrototype.cpp:
+        * kjs/BooleanPrototype.cpp:
+        * kjs/DatePrototype.cpp:
+        * kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
+        * kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
+        * kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
+        * kjs/ErrorInstance.h: Copied from kjs/error_object.h.
+        * kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
+        * kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
+        * kjs/JSGlobalObject.cpp:
+        * kjs/JSObject.cpp:
+        * kjs/JSValue.cpp:
+        * kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
+        * kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
+        * kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
+        * kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
+        * kjs/NumberPrototype.cpp:
+        * kjs/RegExpConstructor.cpp:
+        * kjs/RegExpObject.cpp:
+        * kjs/RegExpPrototype.cpp:
+        * kjs/StringPrototype.cpp:
+        * kjs/error_object.cpp: Removed.
+        * kjs/error_object.h: Removed.
+        * kjs/internal.cpp:
+
+2008-06-29  Sam Weinig  <sam@webkit.org>
+
         Fix non-AllInOne build.
 
         * kjs/DateConstructor.cpp:
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index 7520be7..16d0719 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -96,7 +96,9 @@
 	JavaScriptCore/kjs/DatePrototype.cpp \
 	JavaScriptCore/kjs/debugger.cpp \
 	JavaScriptCore/kjs/dtoa.cpp \
-	JavaScriptCore/kjs/error_object.cpp \
+	JavaScriptCore/kjs/ErrorConstructor.cpp \
+	JavaScriptCore/kjs/ErrorInstance.cpp \
+	JavaScriptCore/kjs/ErrorPrototype.cpp \
 	JavaScriptCore/kjs/JSFunction.cpp \
 	JavaScriptCore/kjs/JSVariableObject.cpp \
 	JavaScriptCore/kjs/FunctionConstructor.cpp \
@@ -110,6 +112,8 @@
 	JavaScriptCore/kjs/MathObject.cpp \
 	JavaScriptCore/kjs/nodes.cpp \
 	JavaScriptCore/kjs/nodes2string.cpp \
+	JavaScriptCore/kjs/NativeErrorConstructor.cpp \
+	JavaScriptCore/kjs/NativeErrorPrototype.cpp \
 	JavaScriptCore/kjs/NumberConstructor.cpp \
 	JavaScriptCore/kjs/NumberObject.cpp \
 	JavaScriptCore/kjs/NumberPrototype.cpp \
diff --git a/JavaScriptCore/JavaScriptCore.pri b/JavaScriptCore/JavaScriptCore.pri
index 6a70376..29fdecb 100644
--- a/JavaScriptCore/JavaScriptCore.pri
+++ b/JavaScriptCore/JavaScriptCore.pri
@@ -81,7 +81,9 @@
     kjs/DatePrototype.cpp \
     kjs/DebuggerCallFrame.cpp \
     kjs/dtoa.cpp \
-    kjs/error_object.cpp \
+    kjs/ErrorConstructor.cpp \
+    kjs/ErrorInstance.cpp \
+    kjs/ErrorPrototype.cpp \
     kjs/ExecState.cpp \
     kjs/FunctionConstructor.cpp \
     kjs/FunctionPrototype.cpp \
@@ -95,6 +97,8 @@
     kjs/list.cpp \
     kjs/lookup.cpp \
     kjs/MathObject.cpp \
+    kjs/NativeErrorConstructor.cpp \
+    kjs/NativeErrorPrototype.cpp \
     kjs/nodes.cpp \
     kjs/nodes2string.cpp \
     kjs/NumberConstructor.cpp \
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 9583d8c..dde6d78 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -381,11 +381,27 @@
 				>

 			</File>

 			<File

-				RelativePath="..\..\kjs\error_object.cpp"

+				RelativePath="..\..\kjs\ErrorConstructor.cpp"

 				>

 			</File>

 			<File

-				RelativePath="..\..\kjs\error_object.h"

+				RelativePath="..\..\kjs\ErrorConstructor.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\kjs\ErrorInstance.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\..\kjs\ErrorInstance.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\kjs\ErrorPrototype.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\..\kjs\ErrorPrototype.h"

 				>

 			</File>

 			<File

@@ -577,6 +593,22 @@
 				>

 			</File>

 			<File

+				RelativePath="..\..\kjs\NativeErrorConstructor.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\..\kjs\NativeErrorConstructor.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\kjs\NativeErrorPrototype.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\..\kjs\NativeErrorPrototype.h"

+				>

+			</File>

+			<File

 				RelativePath="..\..\kjs\NumberConstructor.cpp"

 				>

 			</File>

diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 73f2329..536f3f4 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -95,6 +95,11 @@
 		A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
 		A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; };
 		A7C31DAA0DBEBA4300FDF8EB /* SegmentedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C31DA80DBEBA4300FDF8EB /* SegmentedVector.h */; };
+		BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; };
+		BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; };
+		BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */; };
+		BC02E9130E1839DB000F9297 /* NativeErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */; };
+		BC02E98D0E183E38000F9297 /* ErrorInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E98B0E183E38000F9297 /* ErrorInstance.h */; };
 		BC18C3E40E16F5CD00B34460 /* AlwaysInline.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AA4F770957251F0084B3A7 /* AlwaysInline.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC18C3E50E16F5CD00B34460 /* APICast.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B78A0A4305AB00517CFC /* APICast.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC18C3E60E16F5CD00B34460 /* ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7952070E15E8A800A898AB /* ArrayConstructor.h */; };
@@ -120,7 +125,6 @@
 		BC18C3FC0E16F5CD00B34460 /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = 5186111D0CC824830081412B /* Deque.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC18C3FD0E16F5CD00B34460 /* DisallowCType.h in Headers */ = {isa = PBXBuildFile; fileRef = 938C4F6B0CA06BCE00D9310A /* DisallowCType.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC18C3FE0E16F5CD00B34460 /* dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 651F6413039D5B5F0078395C /* dtoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		BC18C3FF0E16F5CD00B34460 /* error_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A85B0255597D01FF60F7 /* error_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC18C4000E16F5CD00B34460 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
 		BC18C4010E16F5CD00B34460 /* ExecState.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BD53F30A3E12D800BAF59C /* ExecState.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC18C4020E16F5CD00B34460 /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E217BA08E7EECC0023E5F6 /* FastMalloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -586,6 +590,16 @@
 		A7C31DA80DBEBA4300FDF8EB /* SegmentedVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SegmentedVector.h; path = VM/SegmentedVector.h; sourceTree = "<group>"; };
 		A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = "<group>"; };
 		A8E894330CD0603F00367179 /* JSGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObject.h; sourceTree = "<group>"; };
+		BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorConstructor.cpp; sourceTree = "<group>"; };
+		BC02E9050E1839DB000F9297 /* ErrorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorConstructor.h; sourceTree = "<group>"; };
+		BC02E9060E1839DB000F9297 /* ErrorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorPrototype.cpp; sourceTree = "<group>"; };
+		BC02E9070E1839DB000F9297 /* ErrorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorPrototype.h; sourceTree = "<group>"; };
+		BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeErrorConstructor.cpp; sourceTree = "<group>"; };
+		BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeErrorConstructor.h; sourceTree = "<group>"; };
+		BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeErrorPrototype.cpp; sourceTree = "<group>"; };
+		BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeErrorPrototype.h; sourceTree = "<group>"; };
+		BC02E98A0E183E38000F9297 /* ErrorInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorInstance.cpp; sourceTree = "<group>"; };
+		BC02E98B0E183E38000F9297 /* ErrorInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorInstance.h; sourceTree = "<group>"; };
 		BC18C3C00E16EE3300B34460 /* StringConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringConstructor.cpp; sourceTree = "<group>"; };
 		BC18C3C10E16EE3300B34460 /* StringConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringConstructor.h; sourceTree = "<group>"; };
 		BC18C3C20E16EE3300B34460 /* StringObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringObject.cpp; sourceTree = "<group>"; };
@@ -665,8 +679,6 @@
 		F692A8560255597D01FF60F7 /* date_object.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = date_object.h; sourceTree = "<group>"; tabWidth = 8; };
 		F692A8580255597D01FF60F7 /* debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = debugger.cpp; path = kjs/debugger.cpp; sourceTree = "<group>"; tabWidth = 8; };
 		F692A8590255597D01FF60F7 /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = debugger.h; path = kjs/debugger.h; sourceTree = "<group>"; tabWidth = 8; };
-		F692A85A0255597D01FF60F7 /* error_object.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = error_object.cpp; sourceTree = "<group>"; tabWidth = 8; };
-		F692A85B0255597D01FF60F7 /* error_object.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = error_object.h; sourceTree = "<group>"; tabWidth = 8; };
 		F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionPrototype.cpp; sourceTree = "<group>"; tabWidth = 8; };
 		F692A85D0255597D01FF60F7 /* FunctionPrototype.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = FunctionPrototype.h; sourceTree = "<group>"; tabWidth = 8; };
 		F692A85E0255597D01FF60F7 /* JSFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFunction.cpp; sourceTree = "<group>"; tabWidth = 8; };
@@ -1050,8 +1062,12 @@
 				D21202290AD4310C00ED79B6 /* DateMath.h */,
 				651F6412039D5B5F0078395C /* dtoa.cpp */,
 				651F6413039D5B5F0078395C /* dtoa.h */,
-				F692A85A0255597D01FF60F7 /* error_object.cpp */,
-				F692A85B0255597D01FF60F7 /* error_object.h */,
+				BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */,
+				BC02E9050E1839DB000F9297 /* ErrorConstructor.h */,
+				BC02E98A0E183E38000F9297 /* ErrorInstance.cpp */,
+				BC02E98B0E183E38000F9297 /* ErrorInstance.h */,
+				BC02E9060E1839DB000F9297 /* ErrorPrototype.cpp */,
+				BC02E9070E1839DB000F9297 /* ErrorPrototype.h */,
 				14BD53F40A3E12D800BAF59C /* ExecState.cpp */,
 				14BD53F30A3E12D800BAF59C /* ExecState.h */,
 				BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */,
@@ -1100,6 +1116,10 @@
 				F692A8690255597D01FF60F7 /* lookup.h */,
 				F692A86A0255597D01FF60F7 /* MathObject.cpp */,
 				F692A86B0255597D01FF60F7 /* MathObject.h */,
+				BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */,
+				BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */,
+				BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */,
+				BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */,
 				BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */,
 				BC2680C30E16D4E900A06E92 /* NumberConstructor.h */,
 				F692A8700255597D01FF60F7 /* NumberObject.cpp */,
@@ -1256,7 +1276,6 @@
 				BC18C3FC0E16F5CD00B34460 /* Deque.h in Headers */,
 				BC18C3FD0E16F5CD00B34460 /* DisallowCType.h in Headers */,
 				BC18C3FE0E16F5CD00B34460 /* dtoa.h in Headers */,
-				BC18C3FF0E16F5CD00B34460 /* error_object.h in Headers */,
 				BC18C4000E16F5CD00B34460 /* ExceptionHelpers.h in Headers */,
 				BC18C4010E16F5CD00B34460 /* ExecState.h in Headers */,
 				BC18C4020E16F5CD00B34460 /* FastMalloc.h in Headers */,
@@ -1387,6 +1406,11 @@
 				BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
 				BCD2034C0E17135E002C7E82 /* DatePrototype.h in Headers */,
 				BCD203E80E1718F4002C7E82 /* DatePrototype.lut.h in Headers */,
+				BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */,
+				BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */,
+				BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */,
+				BC02E9130E1839DB000F9297 /* NativeErrorPrototype.h in Headers */,
+				BC02E98D0E183E38000F9297 /* ErrorInstance.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/JavaScriptCore/JavaScriptCoreSources.bkl b/JavaScriptCore/JavaScriptCoreSources.bkl
index c01fc9b..d94164c 100644
--- a/JavaScriptCore/JavaScriptCoreSources.bkl
+++ b/JavaScriptCore/JavaScriptCoreSources.bkl
@@ -58,7 +58,9 @@
         kjs/debugger.cpp
         kjs/DebuggerCallFrame.cpp
         kjs/dtoa.cpp
-        kjs/error_object.cpp
+        kjs/ErrorConstructor.cpp
+        kjs/ErrorInstance.cpp
+        kjs/ErrorPrototype.cpp
         kjs/ExecState.cpp
         kjs/JSFunction.cpp
         kjs/FunctionConstructor.cpp
@@ -79,6 +81,8 @@
         kjs/list.cpp
         kjs/lookup.cpp
         kjs/MathObject.cpp
+        kjs/NativeErrorConstructor.cpp
+        kjs/NativeErrorPrototype.cpp
         kjs/nodes.cpp
         kjs/nodes2string.cpp
         kjs/NumberConstructor.cpp
diff --git a/JavaScriptCore/kjs/AllInOneFile.cpp b/JavaScriptCore/kjs/AllInOneFile.cpp
index 932330a..5eccf21 100644
--- a/JavaScriptCore/kjs/AllInOneFile.cpp
+++ b/JavaScriptCore/kjs/AllInOneFile.cpp
@@ -44,7 +44,9 @@
 #include "DatePrototype.cpp"
 #include "date_object.cpp"
 #include "dtoa.cpp"
-#include "error_object.cpp"
+#include "ErrorInstance.cpp"
+#include "ErrorPrototype.cpp"
+#include "ErrorConstructor.cpp"
 #include "FunctionConstructor.cpp"
 #include "FunctionPrototype.cpp"
 #include "grammar.cpp"
@@ -58,11 +60,13 @@
 #include "list.cpp"
 #include "lookup.cpp"
 #include "MathObject.cpp"
-#include "nodes.cpp"
-#include "nodes2string.cpp"
+#include "NativeErrorConstructor.cpp"
+#include "NativeErrorPrototype.cpp"
 #include "NumberConstructor.cpp"
 #include "NumberObject.cpp"
 #include "NumberPrototype.cpp"
+#include "nodes.cpp"
+#include "nodes2string.cpp"
 #include "JSObject.cpp"
 #include "JSGlobalObject.cpp"
 #include "ObjectConstructor.cpp"
diff --git a/JavaScriptCore/kjs/ArrayConstructor.cpp b/JavaScriptCore/kjs/ArrayConstructor.cpp
index ce75101..6e2defa 100644
--- a/JavaScriptCore/kjs/ArrayConstructor.cpp
+++ b/JavaScriptCore/kjs/ArrayConstructor.cpp
@@ -27,7 +27,6 @@
 #include "ArrayPrototype.h"
 #include "FunctionPrototype.h"
 #include "JSArray.h"
-#include "error_object.h"
 #include "lookup.h"
 
 namespace KJS {
diff --git a/JavaScriptCore/kjs/ArrayPrototype.cpp b/JavaScriptCore/kjs/ArrayPrototype.cpp
index c2eea09..62a1015 100644
--- a/JavaScriptCore/kjs/ArrayPrototype.cpp
+++ b/JavaScriptCore/kjs/ArrayPrototype.cpp
@@ -26,12 +26,10 @@
 
 #include "Machine.h"
 #include "ObjectPrototype.h"
-#include "error_object.h"
 #include "lookup.h"
 #include "operations.h"
 #include <wtf/Assertions.h>
 #include <wtf/HashSet.h>
-
 #include <algorithm> // for std::min
 
 namespace KJS {
diff --git a/JavaScriptCore/kjs/BooleanPrototype.cpp b/JavaScriptCore/kjs/BooleanPrototype.cpp
index 2c64b30..a6df6fe 100644
--- a/JavaScriptCore/kjs/BooleanPrototype.cpp
+++ b/JavaScriptCore/kjs/BooleanPrototype.cpp
@@ -23,7 +23,6 @@
 
 #include "FunctionPrototype.h"
 #include "ObjectPrototype.h"
-#include "error_object.h"
 
 namespace KJS {
 
diff --git a/JavaScriptCore/kjs/DatePrototype.cpp b/JavaScriptCore/kjs/DatePrototype.cpp
index 62913d5..2731fb4 100644
--- a/JavaScriptCore/kjs/DatePrototype.cpp
+++ b/JavaScriptCore/kjs/DatePrototype.cpp
@@ -26,7 +26,6 @@
 #include "JSString.h"
 #include "ObjectPrototype.h"
 #include "date_object.h"
-#include "error_object.h"
 #include <float.h>
 #include <limits.h>
 #include <locale.h>
diff --git a/JavaScriptCore/kjs/ErrorConstructor.cpp b/JavaScriptCore/kjs/ErrorConstructor.cpp
new file mode 100644
index 0000000..e58caaa
--- /dev/null
+++ b/JavaScriptCore/kjs/ErrorConstructor.cpp
@@ -0,0 +1,73 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include "config.h"
+#include "ErrorConstructor.h"
+
+#include "ErrorInstance.h"
+#include "ErrorPrototype.h"
+#include "FunctionPrototype.h"
+#include "JSGlobalObject.h"
+#include "JSString.h"
+
+namespace KJS {
+
+ErrorConstructor::ErrorConstructor(ExecState* exec, FunctionPrototype* funcProto, ErrorPrototype* errorProto)
+    : InternalFunction(funcProto, Identifier(exec, errorProto->classInfo()->className))
+{
+    // ECMA 15.11.3.1 Error.prototype
+    putDirect(exec->propertyNames().prototype, errorProto, DontEnum|DontDelete|ReadOnly);
+    putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete|ReadOnly|DontEnum);
+}
+
+// ECMA 15.9.3
+static ErrorInstance* constructError(ExecState* exec, const ArgList& args)
+{
+    ErrorInstance* obj = new (exec) ErrorInstance(exec->lexicalGlobalObject()->errorPrototype());
+    if (!args[0]->isUndefined())
+        obj->putDirect(exec->propertyNames().message, jsString(exec, args[0]->toString(exec)));
+    return obj;
+}
+
+static JSObject* constructWithErrorConstructor(ExecState* exec, JSObject*, const ArgList& args)
+{
+    return constructError(exec, args);
+}
+
+ConstructType ErrorConstructor::getConstructData(ConstructData& constructData)
+{
+    constructData.native.function = constructWithErrorConstructor;
+    return ConstructTypeNative;
+}
+
+// ECMA 15.9.2
+static JSValue* callErrorConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+{
+    // "Error()" gives the sames result as "new Error()"
+    return constructError(exec, args);
+}
+
+CallType ErrorConstructor::getCallData(CallData& callData)
+{
+    callData.native.function = callErrorConstructor;
+    return CallTypeNative;
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/ErrorConstructor.h b/JavaScriptCore/kjs/ErrorConstructor.h
new file mode 100644
index 0000000..ddcb100
--- /dev/null
+++ b/JavaScriptCore/kjs/ErrorConstructor.h
@@ -0,0 +1,42 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef ErrorConstructor_h
+#define ErrorConstructor_h
+
+#include "JSFunction.h"
+
+namespace KJS {
+
+    class ErrorPrototype;
+    class FunctionPrototype;
+
+    class ErrorConstructor : public InternalFunction {
+    public:
+        ErrorConstructor(ExecState*, FunctionPrototype*, ErrorPrototype*);
+
+    private:
+        virtual ConstructType getConstructData(ConstructData&);
+        virtual CallType getCallData(CallData&);
+    };
+
+} // namespace KJS
+
+#endif // ErrorConstructor_h
diff --git a/JavaScriptCore/kjs/ErrorInstance.cpp b/JavaScriptCore/kjs/ErrorInstance.cpp
new file mode 100644
index 0000000..f991467
--- /dev/null
+++ b/JavaScriptCore/kjs/ErrorInstance.cpp
@@ -0,0 +1,33 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include "config.h"
+#include "ErrorInstance.h"
+
+namespace KJS {
+
+const ClassInfo ErrorInstance::info = { "Error", 0, 0, 0 };
+
+ErrorInstance::ErrorInstance(JSObject* prototype)
+    : JSObject(prototype)
+{
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/ErrorInstance.h b/JavaScriptCore/kjs/ErrorInstance.h
new file mode 100644
index 0000000..044c04a
--- /dev/null
+++ b/JavaScriptCore/kjs/ErrorInstance.h
@@ -0,0 +1,38 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef ErrorInstance_h
+#define ErrorInstance_h
+
+#include "JSObject.h"
+
+namespace KJS {
+
+    class ErrorInstance : public JSObject {
+    public:
+        ErrorInstance(JSObject* prototype);
+
+        virtual const ClassInfo* classInfo() const { return &info; }
+        static const ClassInfo info;
+    };
+
+} // namespace KJS
+
+#endif // ErrorInstance_h
diff --git a/JavaScriptCore/kjs/ErrorPrototype.cpp b/JavaScriptCore/kjs/ErrorPrototype.cpp
new file mode 100644
index 0000000..40b59ea
--- /dev/null
+++ b/JavaScriptCore/kjs/ErrorPrototype.cpp
@@ -0,0 +1,64 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include "config.h"
+#include "ErrorPrototype.h"
+
+#include "FunctionPrototype.h"
+#include "ObjectPrototype.h"
+#include "ustring.h"
+
+namespace KJS {
+
+static JSValue* errorProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
+
+// ECMA 15.9.4
+ErrorPrototype::ErrorPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)
+    : ErrorInstance(objectPrototype)
+{
+    // The constructor will be added later in ErrorConstructor's constructor
+
+    putDirect(exec->propertyNames().name, jsString(exec, "Error"), DontEnum);
+    putDirect(exec->propertyNames().message, jsString(exec, "Unknown error"), DontEnum);
+
+    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum);
+}
+
+JSValue* errorProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+{
+    JSObject* thisObj = thisValue->toThisObject(exec);
+
+    UString s = "Error";
+
+    JSValue* v = thisObj->get(exec, exec->propertyNames().name);
+    if (!v->isUndefined())
+        s = v->toString(exec);
+
+    v = thisObj->get(exec, exec->propertyNames().message);
+    if (!v->isUndefined()) {
+        // Mozilla-compatible format.
+        s += ": ";
+        s += v->toString(exec);
+    }
+
+    return jsString(exec, s);
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/ErrorPrototype.h b/JavaScriptCore/kjs/ErrorPrototype.h
new file mode 100644
index 0000000..5b1c97a
--- /dev/null
+++ b/JavaScriptCore/kjs/ErrorPrototype.h
@@ -0,0 +1,38 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef ErrorPrototype_h
+#define ErrorPrototype_h
+
+#include "ErrorInstance.h"
+
+namespace KJS {
+
+    class FunctionPrototype;
+    class ObjectPrototype;
+
+    class ErrorPrototype : public ErrorInstance {
+    public:
+        ErrorPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
+    };
+
+} // namespace KJS
+
+#endif // ErrorPrototype_h
diff --git a/JavaScriptCore/kjs/JSGlobalObject.cpp b/JavaScriptCore/kjs/JSGlobalObject.cpp
index 984af60..7965b4b6 100644
--- a/JavaScriptCore/kjs/JSGlobalObject.cpp
+++ b/JavaScriptCore/kjs/JSGlobalObject.cpp
@@ -37,10 +37,14 @@
 #include "CodeBlock.h"
 #include "DateConstructor.h"
 #include "DatePrototype.h"
+#include "ErrorConstructor.h"
+#include "ErrorPrototype.h"
 #include "FunctionConstructor.h"
 #include "FunctionPrototype.h"
 #include "Machine.h"
 #include "MathObject.h"
+#include "NativeErrorConstructor.h"
+#include "NativeErrorPrototype.h"
 #include "NumberConstructor.h"
 #include "NumberPrototype.h"
 #include "ObjectConstructor.h"
@@ -51,7 +55,6 @@
 #include "StringConstructor.h"
 #include "StringPrototype.h"
 #include "debugger.h"
-#include "error_object.h"
 
 namespace KJS {
 
diff --git a/JavaScriptCore/kjs/JSObject.cpp b/JavaScriptCore/kjs/JSObject.cpp
index dbf1e23..e04a93d 100644
--- a/JavaScriptCore/kjs/JSObject.cpp
+++ b/JavaScriptCore/kjs/JSObject.cpp
@@ -26,10 +26,10 @@
 #include "JSObject.h"
 
 #include "DatePrototype.h"
+#include "ErrorConstructor.h"
 #include "JSGlobalObject.h"
 #include "ObjectPrototype.h"
 #include "PropertyNameArray.h"
-#include "error_object.h"
 #include "lookup.h"
 #include "nodes.h"
 #include "operations.h"
diff --git a/JavaScriptCore/kjs/JSValue.cpp b/JavaScriptCore/kjs/JSValue.cpp
index 85baa6b..68f74eb 100644
--- a/JavaScriptCore/kjs/JSValue.cpp
+++ b/JavaScriptCore/kjs/JSValue.cpp
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "JSValue.h"
 
-#include "error_object.h"
 #include "nodes.h"
 #include <stdio.h>
 #include <string.h>
diff --git a/JavaScriptCore/kjs/NativeErrorConstructor.cpp b/JavaScriptCore/kjs/NativeErrorConstructor.cpp
new file mode 100644
index 0000000..bde6f09
--- /dev/null
+++ b/JavaScriptCore/kjs/NativeErrorConstructor.cpp
@@ -0,0 +1,77 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include "config.h"
+#include "NativeErrorConstructor.h"
+
+#include "ErrorInstance.h"
+#include "FunctionPrototype.h"
+#include "NativeErrorPrototype.h"
+
+namespace KJS {
+
+const ClassInfo NativeErrorConstructor::info = { "Function", &InternalFunction::info, 0, 0 };
+
+NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, FunctionPrototype* funcProto, NativeErrorPrototype* prot)
+    : InternalFunction(funcProto, Identifier(exec, prot->getDirect(exec->propertyNames().name)->getString()))
+    , proto(prot)
+{
+    putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
+    putDirect(exec->propertyNames().prototype, proto, DontDelete|ReadOnly|DontEnum);
+}
+
+ErrorInstance* NativeErrorConstructor::construct(ExecState* exec, const ArgList& args)
+{
+    ErrorInstance* object = new (exec) ErrorInstance(proto);
+    if (!args[0]->isUndefined())
+        object->putDirect(exec->propertyNames().message, jsString(exec, args[0]->toString(exec)));
+    return object;
+}
+
+static JSObject* constructWithNativeErrorConstructor(ExecState* exec, JSObject* constructor, const ArgList& args)
+{
+    return static_cast<NativeErrorConstructor*>(constructor)->construct(exec, args);
+}
+
+ConstructType NativeErrorConstructor::getConstructData(ConstructData& constructData)
+{
+    constructData.native.function = constructWithNativeErrorConstructor;
+    return ConstructTypeNative;
+}
+
+static JSValue* callNativeErrorConstructor(ExecState* exec, JSObject* constructor, JSValue*, const ArgList& args)
+{
+    return static_cast<NativeErrorConstructor*>(constructor)->construct(exec, args);
+}
+
+CallType NativeErrorConstructor::getCallData(CallData& callData)
+{
+    callData.native.function = callNativeErrorConstructor;
+    return CallTypeNative;
+}
+
+void NativeErrorConstructor::mark()
+{
+    JSObject::mark();
+    if (proto && !proto->marked())
+        proto->mark();
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/error_object.h b/JavaScriptCore/kjs/NativeErrorConstructor.h
similarity index 62%
rename from JavaScriptCore/kjs/error_object.h
rename to JavaScriptCore/kjs/NativeErrorConstructor.h
index d39f267..7ac860e 100644
--- a/JavaScriptCore/kjs/error_object.h
+++ b/JavaScriptCore/kjs/NativeErrorConstructor.h
@@ -18,42 +18,16 @@
  *
  */
 
-#ifndef ERROR_OBJECT_H_
-#define ERROR_OBJECT_H_
+#ifndef NativeErrorConstructor_h
+#define NativeErrorConstructor_h
 
 #include "JSFunction.h"
 
 namespace KJS {
 
+    class ErrorInstance;
     class FunctionPrototype;
-    class ObjectPrototype;
-
-    class ErrorInstance : public JSObject {
-    public:
-        ErrorInstance(JSObject* prototype);
-
-        virtual const ClassInfo* classInfo() const { return &info; }
-        static const ClassInfo info;
-    };
-
-    class ErrorPrototype : public ErrorInstance {
-    public:
-        ErrorPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
-    };
-
-    class ErrorConstructor : public InternalFunction {
-    public:
-        ErrorConstructor(ExecState*, FunctionPrototype*, ErrorPrototype*);
-
-    private:
-        virtual ConstructType getConstructData(ConstructData&);
-        virtual CallType getCallData(CallData&);
-    };
-
-    class NativeErrorPrototype : public JSObject {
-    public:
-        NativeErrorPrototype(ExecState*, ErrorPrototype*, const UString& name, const UString& message);
-    };
+    class NativeErrorPrototype;
 
     class NativeErrorConstructor : public InternalFunction {
     public:
@@ -72,4 +46,4 @@
 
 } // namespace KJS
 
-#endif // ERROR_OBJECT_H_
+#endif // NativeErrorConstructor_h
diff --git a/JavaScriptCore/kjs/NativeErrorPrototype.cpp b/JavaScriptCore/kjs/NativeErrorPrototype.cpp
new file mode 100644
index 0000000..386e25b
--- /dev/null
+++ b/JavaScriptCore/kjs/NativeErrorPrototype.cpp
@@ -0,0 +1,37 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include "config.h"
+#include "NativeErrorPrototype.h"
+
+#include "ErrorPrototype.h"
+#include "JSString.h"
+#include "ustring.h"
+
+namespace KJS {
+
+NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, ErrorPrototype* errorProto, const UString& name, const UString& message)
+    : JSObject(errorProto)
+{
+    putDirect(exec->propertyNames().name, jsString(exec, name), 0);
+    putDirect(exec->propertyNames().message, jsString(exec, message), 0);
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/NativeErrorPrototype.h b/JavaScriptCore/kjs/NativeErrorPrototype.h
new file mode 100644
index 0000000..4f15961
--- /dev/null
+++ b/JavaScriptCore/kjs/NativeErrorPrototype.h
@@ -0,0 +1,38 @@
+/*
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef NativeErrorPrototype_h
+#define NativeErrorPrototype_h
+
+#include "JSObject.h"
+
+namespace KJS {
+
+    class ErrorPrototype;
+    class UString;
+
+    class NativeErrorPrototype : public JSObject {
+    public:
+        NativeErrorPrototype(ExecState*, ErrorPrototype*, const UString& name, const UString& message);
+    };
+
+} // namespace KJS
+
+#endif // NativeErrorPrototype_h
diff --git a/JavaScriptCore/kjs/NumberPrototype.cpp b/JavaScriptCore/kjs/NumberPrototype.cpp
index 30124ef..01673c0 100644
--- a/JavaScriptCore/kjs/NumberPrototype.cpp
+++ b/JavaScriptCore/kjs/NumberPrototype.cpp
@@ -25,8 +25,6 @@
 #include "FunctionPrototype.h"
 #include "ObjectPrototype.h"
 #include "dtoa.h"
-#include "error_object.h"
-#include "error_object.h"
 #include "operations.h"
 #include <wtf/Assertions.h>
 #include <wtf/MathExtras.h>
diff --git a/JavaScriptCore/kjs/RegExpConstructor.cpp b/JavaScriptCore/kjs/RegExpConstructor.cpp
index a969fd0..61eda66 100644
--- a/JavaScriptCore/kjs/RegExpConstructor.cpp
+++ b/JavaScriptCore/kjs/RegExpConstructor.cpp
@@ -28,7 +28,6 @@
 #include "ObjectPrototype.h"
 #include "RegExpObject.h"
 #include "RegExpPrototype.h"
-#include "error_object.h"
 #include "regexp.h"
 
 namespace KJS {
diff --git a/JavaScriptCore/kjs/RegExpObject.cpp b/JavaScriptCore/kjs/RegExpObject.cpp
index 7e1aab4..a066241 100644
--- a/JavaScriptCore/kjs/RegExpObject.cpp
+++ b/JavaScriptCore/kjs/RegExpObject.cpp
@@ -27,7 +27,6 @@
 #include "JSString.h"
 #include "RegExpConstructor.h"
 #include "RegExpPrototype.h"
-#include "error_object.h"
 
 namespace KJS {
 
diff --git a/JavaScriptCore/kjs/RegExpPrototype.cpp b/JavaScriptCore/kjs/RegExpPrototype.cpp
index d9913ca..51b6a53 100644
--- a/JavaScriptCore/kjs/RegExpPrototype.cpp
+++ b/JavaScriptCore/kjs/RegExpPrototype.cpp
@@ -29,9 +29,6 @@
 #include "JSValue.h"
 #include "ObjectPrototype.h"
 #include "RegExpObject.h"
-#include "UnusedParam.h"
-#include "error_object.h"
-#include "operations.h"
 #include "regexp.h"
 
 namespace KJS {
diff --git a/JavaScriptCore/kjs/StringPrototype.cpp b/JavaScriptCore/kjs/StringPrototype.cpp
index ebe734e..27a6cc1 100644
--- a/JavaScriptCore/kjs/StringPrototype.cpp
+++ b/JavaScriptCore/kjs/StringPrototype.cpp
@@ -26,7 +26,6 @@
 #include "PropertyNameArray.h"
 #include "RegExpConstructor.h"
 #include "RegExpObject.h"
-#include "error_object.h"
 #include <wtf/MathExtras.h>
 #include <wtf/unicode/Collator.h>
 
diff --git a/JavaScriptCore/kjs/error_object.cpp b/JavaScriptCore/kjs/error_object.cpp
deleted file mode 100644
index de2fe36..0000000
--- a/JavaScriptCore/kjs/error_object.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#include "config.h"
-#include "error_object.h"
-
-#include "JSGlobalObject.h"
-#include "JSObject.h"
-#include "JSValue.h"
-#include "ObjectPrototype.h"
-#include "operations.h"
-
-namespace KJS {
-
-// ------------------------------ ErrorInstance ----------------------------
-
-const ClassInfo ErrorInstance::info = { "Error", 0, 0, 0 };
-
-ErrorInstance::ErrorInstance(JSObject* prototype)
-    : JSObject(prototype)
-{
-}
-
-// ------------------------------ ErrorPrototype ----------------------------
-
-static JSValue* errorProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
-
-// ECMA 15.9.4
-ErrorPrototype::ErrorPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)
-    : ErrorInstance(objectPrototype)
-{
-    // The constructor will be added later in ErrorConstructor's constructor
-
-    putDirect(exec->propertyNames().name, jsString(exec, "Error"), DontEnum);
-    putDirect(exec->propertyNames().message, jsString(exec, "Unknown error"), DontEnum);
-
-    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum);
-}
-
-JSValue* errorProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
-{
-    JSObject* thisObj = thisValue->toThisObject(exec);
-
-    UString s = "Error";
-
-    JSValue* v = thisObj->get(exec, exec->propertyNames().name);
-    if (!v->isUndefined())
-        s = v->toString(exec);
-
-    v = thisObj->get(exec, exec->propertyNames().message);
-    if (!v->isUndefined()) {
-        // Mozilla-compatible format.
-        s += ": ";
-        s += v->toString(exec);
-    }
-
-    return jsString(exec, s);
-}
-
-// ------------------------------ ErrorConstructor -------------------------------
-
-ErrorConstructor::ErrorConstructor(ExecState* exec, FunctionPrototype* funcProto, ErrorPrototype* errorProto)
-    : InternalFunction(funcProto, Identifier(exec, errorProto->classInfo()->className))
-{
-    // ECMA 15.11.3.1 Error.prototype
-    putDirect(exec->propertyNames().prototype, errorProto, DontEnum|DontDelete|ReadOnly);
-    putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete|ReadOnly|DontEnum);
-}
-
-// ECMA 15.9.3
-static ErrorInstance* constructError(ExecState* exec, const ArgList& args)
-{
-    ErrorInstance* obj = new (exec) ErrorInstance(exec->lexicalGlobalObject()->errorPrototype());
-    if (!args[0]->isUndefined())
-        obj->putDirect(exec->propertyNames().message, jsString(exec, args[0]->toString(exec)));
-    return obj;
-}
-
-static JSObject* constructWithErrorConstructor(ExecState* exec, JSObject*, const ArgList& args)
-{
-    return constructError(exec, args);
-}
-
-ConstructType ErrorConstructor::getConstructData(ConstructData& constructData)
-{
-    constructData.native.function = constructWithErrorConstructor;
-    return ConstructTypeNative;
-}
-
-// ECMA 15.9.2
-static JSValue* callErrorConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
-{
-    // "Error()" gives the sames result as "new Error()"
-    return constructError(exec, args);
-}
-
-CallType ErrorConstructor::getCallData(CallData& callData)
-{
-    callData.native.function = callErrorConstructor;
-    return CallTypeNative;
-}
-
-// ------------------------------ NativeErrorPrototype ----------------------
-
-NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, ErrorPrototype* errorProto, const UString& name, const UString& message)
-    : JSObject(errorProto)
-{
-    putDirect(exec->propertyNames().name, jsString(exec, name), 0);
-    putDirect(exec->propertyNames().message, jsString(exec, message), 0);
-}
-
-// ------------------------------ NativeErrorConstructor -------------------------------
-
-const ClassInfo NativeErrorConstructor::info = { "Function", &InternalFunction::info, 0, 0 };
-
-NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, FunctionPrototype* funcProto, NativeErrorPrototype* prot)
-    : InternalFunction(funcProto, Identifier(exec, prot->getDirect(exec->propertyNames().name)->getString()))
-    , proto(prot)
-{
-    putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
-    putDirect(exec->propertyNames().prototype, proto, DontDelete|ReadOnly|DontEnum);
-}
-
-ErrorInstance* NativeErrorConstructor::construct(ExecState* exec, const ArgList& args)
-{
-    ErrorInstance* object = new (exec) ErrorInstance(proto);
-    if (!args[0]->isUndefined())
-        object->putDirect(exec->propertyNames().message, jsString(exec, args[0]->toString(exec)));
-    return object;
-}
-
-static JSObject* constructWithNativeErrorConstructor(ExecState* exec, JSObject* constructor, const ArgList& args)
-{
-    return static_cast<NativeErrorConstructor*>(constructor)->construct(exec, args);
-}
-
-ConstructType NativeErrorConstructor::getConstructData(ConstructData& constructData)
-{
-    constructData.native.function = constructWithNativeErrorConstructor;
-    return ConstructTypeNative;
-}
-
-static JSValue* callNativeErrorConstructor(ExecState* exec, JSObject* constructor, JSValue*, const ArgList& args)
-{
-    return static_cast<NativeErrorConstructor*>(constructor)->construct(exec, args);
-}
-
-CallType NativeErrorConstructor::getCallData(CallData& callData)
-{
-    callData.native.function = callNativeErrorConstructor;
-    return CallTypeNative;
-}
-
-void NativeErrorConstructor::mark()
-{
-    JSObject::mark();
-    if (proto && !proto->marked())
-        proto->mark();
-}
-
-} // namespace KJS
diff --git a/JavaScriptCore/kjs/internal.cpp b/JavaScriptCore/kjs/internal.cpp
index 8c6a037..acd37c5 100644
--- a/JavaScriptCore/kjs/internal.cpp
+++ b/JavaScriptCore/kjs/internal.cpp
@@ -31,7 +31,6 @@
 #include "StringPrototype.h"
 #include "collector.h"
 #include "debugger.h"
-#include "error_object.h"
 #include "lexer.h"
 #include "nodes.h"
 #include "operations.h"