JavaScriptCore:
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Jun 2008 21:22:01 +0000 (21:22 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Jun 2008 21:22:01 +0000 (21:22 +0000)
2008-06-28  Sam Weinig  <sam@webkit.org>

        Rubber-stamped by Oliver Hunt.

        Splits FunctionConstructor out of FunctionPrototype.h/cpp
        Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
        Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.

        * API/JSCallbackConstructor.cpp:
        * API/JSClassRef.cpp:
        * API/JSObjectRef.cpp:
        * DerivedSources.make:
        * GNUmakefile.am:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * VM/Machine.cpp:
        * kjs/AllInOneFile.cpp:
        * kjs/ArrayConstructor.cpp:
        * kjs/ArrayConstructor.h:
        * kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
        * kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
        * kjs/FunctionPrototype.cpp:
        * kjs/FunctionPrototype.h:
        * kjs/JSFunction.cpp:
        * kjs/JSGlobalObject.cpp:
        * kjs/JSImmediate.cpp:
        * kjs/MathObject.h:
        * kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
        * kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
        * kjs/NumberObject.cpp:
        * kjs/NumberObject.h:
        * kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
        * kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
        * kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
        * kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
        * kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
        * kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
        * kjs/RegExpObject.h:
        * kjs/Shell.cpp:
        * kjs/error_object.h:
        * kjs/internal.cpp:
        * kjs/nodes.cpp:
        * kjs/object_object.cpp: Removed.
        * kjs/object_object.h: Removed.
        * kjs/string_object.h:

WebCore:

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

        Rubber-stamped by Oliver Hunt.

        Update includes after remaming object_object.h to ObjectPrototype.h and
        splitting FunctionConstructor out of FunctionPrototype.h

        * ForwardingHeaders/kjs/FunctionConstructor.h: Added.
        * ForwardingHeaders/kjs/ObjectPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/object_object.h.
        * ForwardingHeaders/kjs/object_object.h: Removed.
        * bindings/js/JSEventListener.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        * bridge/qt/qt_instance.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34854 268f45cc-cd09-0410-ab3c-d52691b4dbfc

45 files changed:
JavaScriptCore/API/JSCallbackConstructor.cpp
JavaScriptCore/API/JSClassRef.cpp
JavaScriptCore/API/JSObjectRef.cpp
JavaScriptCore/ChangeLog
JavaScriptCore/DerivedSources.make
JavaScriptCore/GNUmakefile.am
JavaScriptCore/JavaScriptCore.pri
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/JavaScriptCoreSources.bkl
JavaScriptCore/VM/Machine.cpp
JavaScriptCore/kjs/AllInOneFile.cpp
JavaScriptCore/kjs/ArrayConstructor.cpp
JavaScriptCore/kjs/ArrayConstructor.h
JavaScriptCore/kjs/FunctionConstructor.cpp [new file with mode: 0644]
JavaScriptCore/kjs/FunctionConstructor.h [new file with mode: 0644]
JavaScriptCore/kjs/FunctionPrototype.cpp
JavaScriptCore/kjs/FunctionPrototype.h
JavaScriptCore/kjs/JSFunction.cpp
JavaScriptCore/kjs/JSGlobalObject.cpp
JavaScriptCore/kjs/JSImmediate.cpp
JavaScriptCore/kjs/MathObject.h
JavaScriptCore/kjs/NumberConstructor.cpp [new file with mode: 0644]
JavaScriptCore/kjs/NumberConstructor.h [new file with mode: 0644]
JavaScriptCore/kjs/NumberObject.cpp
JavaScriptCore/kjs/NumberObject.h
JavaScriptCore/kjs/NumberPrototype.cpp [new file with mode: 0644]
JavaScriptCore/kjs/NumberPrototype.h [new file with mode: 0644]
JavaScriptCore/kjs/ObjectConstructor.cpp [new file with mode: 0644]
JavaScriptCore/kjs/ObjectConstructor.h [moved from JavaScriptCore/kjs/object_object.h with 75% similarity]
JavaScriptCore/kjs/ObjectPrototype.cpp [moved from JavaScriptCore/kjs/object_object.cpp with 80% similarity]
JavaScriptCore/kjs/ObjectPrototype.h [new file with mode: 0644]
JavaScriptCore/kjs/RegExpObject.h
JavaScriptCore/kjs/Shell.cpp
JavaScriptCore/kjs/error_object.h
JavaScriptCore/kjs/internal.cpp
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/string_object.h
WebCore/ChangeLog
WebCore/ForwardingHeaders/kjs/FunctionConstructor.h [new file with mode: 0644]
WebCore/ForwardingHeaders/kjs/ObjectPrototype.h [new file with mode: 0644]
WebCore/ForwardingHeaders/kjs/object_object.h [deleted file]
WebCore/bindings/js/JSEventListener.cpp
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/bridge/qt/qt_instance.cpp

index 173ec83..0f1ae01 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "APICast.h"
 #include <kjs/JSGlobalObject.h>
-#include <kjs/object_object.h>
+#include <kjs/ObjectPrototype.h>
 #include <wtf/Vector.h>
 
 namespace KJS {
index 0f878df..d82a8e7 100644 (file)
 #include "APICast.h"
 #include "JSCallbackObject.h"
 #include "JSObjectRef.h"
+#include <kjs/InitializeThreading.h>
 #include <kjs/JSGlobalObject.h>
+#include <kjs/ObjectPrototype.h>
 #include <kjs/identifier.h>
-#include <kjs/InitializeThreading.h>
-#include <kjs/object_object.h>
 
 using namespace KJS;
 
index bc97a1b..2d92069 100644 (file)
 #include "JSObjectRef.h"
 
 #include "APICast.h"
+#include "FunctionConstructor.h"
 #include "JSCallbackConstructor.h"
 #include "JSCallbackFunction.h"
 #include "JSCallbackObject.h"
 #include "JSClassRef.h"
+#include "JSFunction.h"
 #include "JSGlobalObject.h"
+#include "JSObject.h"
+#include "JSString.h"
 #include "JSValueRef.h"
+#include "ObjectPrototype.h"
 #include "PropertyNameArray.h"
-#include "JSFunction.h"
-#include "FunctionPrototype.h"
 #include "identifier.h"
-#include "JSString.h"
-#include "JSObject.h"
-#include "object_object.h"
 #include <wtf/Platform.h>
 
 using namespace KJS;
index 8afac02..1bef902 100644 (file)
@@ -1,3 +1,51 @@
+2008-06-28  Sam Weinig  <sam@webkit.org>
+
+        Rubber-stamped by Oliver Hunt.
+
+        Splits FunctionConstructor out of FunctionPrototype.h/cpp
+        Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
+        Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.
+
+        * API/JSCallbackConstructor.cpp:
+        * API/JSClassRef.cpp:
+        * API/JSObjectRef.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * JavaScriptCore.pri:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * JavaScriptCoreSources.bkl:
+        * VM/Machine.cpp:
+        * kjs/AllInOneFile.cpp:
+        * kjs/ArrayConstructor.cpp:
+        * kjs/ArrayConstructor.h:
+        * kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
+        * kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
+        * kjs/FunctionPrototype.cpp:
+        * kjs/FunctionPrototype.h:
+        * kjs/JSFunction.cpp:
+        * kjs/JSGlobalObject.cpp:
+        * kjs/JSImmediate.cpp:
+        * kjs/MathObject.h:
+        * kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
+        * kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
+        * kjs/NumberObject.cpp:
+        * kjs/NumberObject.h:
+        * kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
+        * kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
+        * kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
+        * kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
+        * kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
+        * kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
+        * kjs/RegExpObject.h:
+        * kjs/Shell.cpp:
+        * kjs/error_object.h:
+        * kjs/internal.cpp:
+        * kjs/nodes.cpp:
+        * kjs/object_object.cpp: Removed.
+        * kjs/object_object.h: Removed.
+        * kjs/string_object.h:
+
 2008-06-28  Darin Adler  <darin@apple.com>
 
         Reviewed by Oliver.
index 13cd700..5a7a375 100644 (file)
@@ -39,7 +39,7 @@ all : \
     grammar.cpp \
     lexer.lut.h \
     MathObject.lut.h \
-    NumberObject.lut.h \
+    NumberConstructor.lut.h \
     RegExpObject.lut.h \
     string_object.lut.h \
     $(JavaScriptCore)/docs/bytecode.html \
index d5e4c00..ce23279 100644 (file)
@@ -21,7 +21,7 @@ javascriptcore_built_nosources += \
        JavaScriptCore/kjs/ArrayPrototype.lut.h \
        JavaScriptCore/kjs/date_object.lut.h \
        JavaScriptCore/kjs/MathObject.lut.h \
-       JavaScriptCore/kjs/NumberObject.lut.h \
+       JavaScriptCore/kjs/NumberConstructor.lut.h \
        JavaScriptCore/kjs/RegExpObject.lut.h \
        JavaScriptCore/kjs/string_object.lut.h \
        JavaScriptCore/pcre/chartables.c \
@@ -96,6 +96,7 @@ javascriptcore_sources += \
        JavaScriptCore/kjs/dtoa.cpp \
        JavaScriptCore/kjs/error_object.cpp \
        JavaScriptCore/kjs/JSFunction.cpp \
+       JavaScriptCore/kjs/FunctionConstructor.cpp \
        JavaScriptCore/kjs/FunctionPrototype.cpp \
        JavaScriptCore/kjs/identifier.cpp \
        JavaScriptCore/kjs/internal.cpp \
@@ -106,10 +107,13 @@ javascriptcore_sources += \
        JavaScriptCore/kjs/MathObject.cpp \
        JavaScriptCore/kjs/nodes.cpp \
        JavaScriptCore/kjs/nodes2string.cpp \
+       JavaScriptCore/kjs/NumberConstructor.cpp \
        JavaScriptCore/kjs/NumberObject.cpp \
+       JavaScriptCore/kjs/NumberPrototype.cpp \
        JavaScriptCore/kjs/JSObject.cpp \
        JavaScriptCore/kjs/JSGlobalObject.cpp \
-       JavaScriptCore/kjs/object_object.cpp \
+       JavaScriptCore/kjs/ObjectConstructor.cpp \
+       JavaScriptCore/kjs/ObjectPrototype.cpp \
        JavaScriptCore/kjs/operations.cpp \
        JavaScriptCore/kjs/PropertyMap.cpp \
        JavaScriptCore/kjs/PropertySlot.cpp \
@@ -208,7 +212,7 @@ CLEANFILES += \
        JavaScriptCore/kjs/ArrayPrototype.lut.h \
        JavaScriptCore/kjs/date_object.lut.h \
        JavaScriptCore/kjs/MathObject.lut.h \
-       JavaScriptCore/kjs/NumberObject.lut.h \
+       JavaScriptCore/kjs/NumberConstructor.lut.h \
        JavaScriptCore/kjs/RegExpObject.lut.h \
        JavaScriptCore/kjs/string_object.lut.h \
        JavaScriptCore/pcre/chartables.c \
index aeeff47..735d48a 100644 (file)
@@ -15,7 +15,7 @@ include(pcre/pcre.pri)
 
 LUT_FILES += \
     kjs/date_object.cpp \
-    kjs/NumberObject.cpp \
+    kjs/NumberConstructor.cpp \
     kjs/string_object.cpp \
     kjs/ArrayPrototype.cpp \
     kjs/MathObject.cpp \
@@ -80,6 +80,7 @@ SOURCES += \
     kjs/dtoa.cpp \
     kjs/error_object.cpp \
     kjs/ExecState.cpp \
+    kjs/FunctionConstructor.cpp \
     kjs/FunctionPrototype.cpp \
     kjs/identifier.cpp \
     kjs/internal.cpp \
@@ -93,9 +94,12 @@ SOURCES += \
     kjs/MathObject.cpp \
     kjs/nodes.cpp \
     kjs/nodes2string.cpp \
+    kjs/NumberConstructor.cpp \
     kjs/NumberObject.cpp \
+    kjs/NumberPrototype.cpp \
     kjs/JSObject.cpp \
-    kjs/object_object.cpp \
+    kjs/ObjectConstructor.cpp \
+    kjs/ObjectPrototype.cpp \
     kjs/operations.cpp \
     kjs/Parser.cpp \
     kjs/PropertyMap.cpp \
index a08b2a5..9e4a943 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\kjs\FunctionConstructor.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\kjs\FunctionConstructor.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\kjs\FunctionPrototype.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\kjs\NumberConstructor.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\kjs\NumberConstructor.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\kjs\NumberObject.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\kjs\object_object.cpp"\r
+                               RelativePath="..\..\kjs\NumberPrototype.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\kjs\NumberPrototype.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\kjs\ObjectConstructor.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\kjs\ObjectConstructor.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\kjs\ObjectPrototype.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\kjs\object_object.h"\r
+                               RelativePath="..\..\kjs\ObjectPrototype.h"\r
                                >\r
                        </File>\r
                        <File\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\NumberObject.lut.h"\r
+                                       RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\NumberConstructor.lut.h"\r
                                        >\r
                                </File>\r
                                <File\r
index 155da40..fb82818 100644 (file)
                14DA81900D99FD2000B0A4FB /* JSActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DA818E0D99FD2000B0A4FB /* JSActivation.h */; };
                14E0FF120DBAAED00007C0AB /* Machine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149B15E70D81F986009CB8C7 /* Machine.cpp */; settings = {COMPILER_FLAGS = "-fno-tree-pre"; }; };
                14F252570D08DD8D004ECFFF /* JSVariableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F252560D08DD8D004ECFFF /* JSVariableObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               14F252610D08DF2F004ECFFF /* JSVariableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */; };
                1CAA8B4C0D32C39A0041BCFF /* JavaScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */; settings = {ATTRIBUTES = (Public, ); }; };
                1CAA8B4D0D32C39A0041BCFF /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
                5186111E0CC824900081412B /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = 5186111D0CC824830081412B /* Deque.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65A7A5E00CD1D50E00061F8E /* LabelStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B813A80CD1D01900DF59D6 /* LabelStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65B1749A09D0FEB700820339 /* ArrayPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B1749909D0FEB700820339 /* ArrayPrototype.lut.h */; };
                65B174F509D100FA00820339 /* MathObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B174F109D100FA00820339 /* MathObject.lut.h */; };
-               65B174F609D100FA00820339 /* NumberObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B174F209D100FA00820339 /* NumberObject.lut.h */; };
                65B174F809D100FA00820339 /* string_object.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B174F409D100FA00820339 /* string_object.lut.h */; };
                65C647B4093EF8D60022C380 /* RefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C647B3093EF8D60022C380 /* RefPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65C7A1740A8EAACB00FA37EA /* JSWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B4E0822A1C700736975 /* MathObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86B0255597D01FF60F7 /* MathObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B500822A1C700736975 /* nodes.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86E0255597D01FF60F7 /* nodes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B510822A1C700736975 /* NumberObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8710255597D01FF60F7 /* NumberObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               932F5B530822A1C700736975 /* object_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8740255597D01FF60F7 /* object_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               932F5B540822A1C700736975 /* JSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8760255597D01FF60F7 /* JSObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B550822A1C700736975 /* operations.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8780255597D01FF60F7 /* operations.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B560822A1C700736975 /* PropertyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87A0255597D01FF60F7 /* PropertyMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B570822A1C700736975 /* RegExpObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87C0255597D01FF60F7 /* RegExpObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A7C31DAA0DBEBA4300FDF8EB /* SegmentedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C31DA80DBEBA4300FDF8EB /* SegmentedVector.h */; };
                A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; };
                A8E894340CD0603F00367179 /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BC22A39C0E16E14800AF21C8 /* JSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC22A3990E16E14800AF21C8 /* JSObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BC2680CB0E16D4E900A06E92 /* FunctionConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BC2680CD0E16D4E900A06E92 /* NumberConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C30E16D4E900A06E92 /* NumberConstructor.h */; };
+               BC2680CF0E16D4E900A06E92 /* NumberPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C50E16D4E900A06E92 /* NumberPrototype.h */; };
+               BC2680D10E16D4E900A06E92 /* ObjectConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C70E16D4E900A06E92 /* ObjectConstructor.h */; };
+               BC2680D30E16D4E900A06E92 /* ObjectPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BC2680E70E16D52300A06E92 /* NumberConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */; };
                BC7952090E15E8A800A898AB /* ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7952070E15E8A800A898AB /* ArrayConstructor.h */; };
                BC8F3CED0DAF1A8000577A80 /* ConstructData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCF655590A2049710038A194 /* MathExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF6553B0A2048DE0038A194 /* MathExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSActivation.cpp; sourceTree = "<group>"; };
                14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObject.cpp; sourceTree = "<group>"; };
                14F252560D08DD8D004ECFFF /* JSVariableObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVariableObject.h; sourceTree = "<group>"; };
-               14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVariableObject.cpp; sourceTree = "<group>"; };
                1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
                1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = JavaScriptCore.xcconfig; sourceTree = "<group>"; };
                1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
                65B1749909D0FEB700820339 /* ArrayPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ArrayPrototype.lut.h; path = ../../../../../symroots/Debug/DerivedSources/JavaScriptCore/ArrayPrototype.lut.h; sourceTree = "<group>"; };
                65B174BE09D1000200820339 /* chartables.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 30; path = chartables.c; sourceTree = "<group>"; };
                65B174F109D100FA00820339 /* MathObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MathObject.lut.h; path = ../../../../../symroots/Debug/DerivedSources/JavaScriptCore/MathObject.lut.h; sourceTree = "<group>"; };
-               65B174F209D100FA00820339 /* NumberObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NumberObject.lut.h; path = ../../../../../symroots/Debug/DerivedSources/JavaScriptCore/NumberObject.lut.h; sourceTree = "<group>"; };
                65B174F409D100FA00820339 /* string_object.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = string_object.lut.h; path = ../../../../../symroots/Debug/DerivedSources/JavaScriptCore/string_object.lut.h; sourceTree = "<group>"; };
                65B813A80CD1D01900DF59D6 /* LabelStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelStack.h; sourceTree = "<group>"; };
                65C02FBB0637462A003E7EE6 /* protect.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = protect.h; sourceTree = "<group>"; tabWidth = 8; };
                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>"; };
+               BC22A3980E16E14800AF21C8 /* JSObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObject.cpp; sourceTree = "<group>"; };
+               BC22A3990E16E14800AF21C8 /* JSObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObject.h; sourceTree = "<group>"; };
+               BC22A39A0E16E14800AF21C8 /* JSVariableObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVariableObject.cpp; sourceTree = "<group>"; };
+               BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionConstructor.cpp; sourceTree = "<group>"; };
+               BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionConstructor.h; sourceTree = "<group>"; };
+               BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberConstructor.cpp; sourceTree = "<group>"; };
+               BC2680C30E16D4E900A06E92 /* NumberConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberConstructor.h; sourceTree = "<group>"; };
+               BC2680C40E16D4E900A06E92 /* NumberPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberPrototype.cpp; sourceTree = "<group>"; };
+               BC2680C50E16D4E900A06E92 /* NumberPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberPrototype.h; sourceTree = "<group>"; };
+               BC2680C60E16D4E900A06E92 /* ObjectConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectConstructor.cpp; sourceTree = "<group>"; };
+               BC2680C70E16D4E900A06E92 /* ObjectConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectConstructor.h; sourceTree = "<group>"; };
+               BC2680C80E16D4E900A06E92 /* ObjectPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectPrototype.cpp; sourceTree = "<group>"; };
+               BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectPrototype.h; sourceTree = "<group>"; };
+               BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberConstructor.lut.h; sourceTree = "<group>"; };
                BC7952060E15E8A800A898AB /* ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayConstructor.cpp; sourceTree = "<group>"; };
                BC7952070E15E8A800A898AB /* ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayConstructor.h; sourceTree = "<group>"; };
                BC7952320E15EB5600A898AB /* BooleanConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BooleanConstructor.cpp; sourceTree = "<group>"; };
                F692A86E0255597D01FF60F7 /* nodes.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = nodes.h; path = kjs/nodes.h; sourceTree = "<group>"; tabWidth = 8; };
                F692A8700255597D01FF60F7 /* NumberObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberObject.cpp; sourceTree = "<group>"; tabWidth = 8; };
                F692A8710255597D01FF60F7 /* NumberObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = NumberObject.h; sourceTree = "<group>"; tabWidth = 8; };
-               F692A8730255597D01FF60F7 /* object_object.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_object.cpp; sourceTree = "<group>"; tabWidth = 8; };
-               F692A8740255597D01FF60F7 /* object_object.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = object_object.h; sourceTree = "<group>"; tabWidth = 8; };
-               F692A8750255597D01FF60F7 /* JSObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObject.cpp; sourceTree = "<group>"; tabWidth = 8; };
-               F692A8760255597D01FF60F7 /* JSObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = JSObject.h; sourceTree = "<group>"; tabWidth = 8; };
                F692A8770255597D01FF60F7 /* operations.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = operations.cpp; sourceTree = "<group>"; tabWidth = 8; };
                F692A8780255597D01FF60F7 /* operations.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = operations.h; sourceTree = "<group>"; tabWidth = 8; };
                F692A8790255597D01FF60F7 /* PropertyMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyMap.cpp; sourceTree = "<group>"; tabWidth = 8; };
                                65FB3F4909D11B2400F49DEB /* grammar.h */,
                                65FB3EB209D109F000F49DEB /* lexer.lut.h */,
                                65B174F109D100FA00820339 /* MathObject.lut.h */,
-                               65B174F209D100FA00820339 /* NumberObject.lut.h */,
+                               BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */,
                                65FB3F4C09D11B2400F49DEB /* RegExpObject.lut.h */,
                                65B174F409D100FA00820339 /* string_object.lut.h */,
                        );
                                F692A85B0255597D01FF60F7 /* error_object.h */,
                                14BD53F40A3E12D800BAF59C /* ExecState.cpp */,
                                14BD53F30A3E12D800BAF59C /* ExecState.h */,
+                               BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */,
+                               BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */,
                                F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */,
                                F692A85D0255597D01FF60F7 /* FunctionPrototype.h */,
                                933A3499038AE7C6008635CE /* grammar.y */,
                                65EA4C9A092AF9E20093D800 /* JSLock.h */,
                                A72700780DAC605600E548D7 /* JSNotAnObject.cpp */,
                                A72700770DAC605600E548D7 /* JSNotAnObject.h */,
-                               F692A8750255597D01FF60F7 /* JSObject.cpp */,
-                               F692A8760255597D01FF60F7 /* JSObject.h */,
+                               BC22A3980E16E14800AF21C8 /* JSObject.cpp */,
+                               BC22A3990E16E14800AF21C8 /* JSObject.h */,
                                F692A8620255597D01FF60F7 /* JSString.h */,
                                14ABB454099C2A0F00E2A24F /* JSType.h */,
                                F692A8870255597D01FF60F7 /* JSValue.cpp */,
                                14ABB36E099C076400E2A24F /* JSValue.h */,
-                               14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
+                               BC22A39A0E16E14800AF21C8 /* JSVariableObject.cpp */,
                                14F252560D08DD8D004ECFFF /* JSVariableObject.h */,
                                65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */,
                                65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */,
                                F692A8690255597D01FF60F7 /* lookup.h */,
                                F692A86A0255597D01FF60F7 /* MathObject.cpp */,
                                F692A86B0255597D01FF60F7 /* MathObject.h */,
+                               BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */,
+                               BC2680C30E16D4E900A06E92 /* NumberConstructor.h */,
                                F692A8700255597D01FF60F7 /* NumberObject.cpp */,
                                F692A8710255597D01FF60F7 /* NumberObject.h */,
-                               F692A8760255597D01FF60F7 /* JSObject.h */,
-                               F692A8750255597D01FF60F7 /* JSObject.cpp */,
-                               F692A8730255597D01FF60F7 /* object_object.cpp */,
-                               F692A8740255597D01FF60F7 /* object_object.h */,
+                               BC2680C40E16D4E900A06E92 /* NumberPrototype.cpp */,
+                               BC2680C50E16D4E900A06E92 /* NumberPrototype.h */,
+                               BC2680C60E16D4E900A06E92 /* ObjectConstructor.cpp */,
+                               BC2680C70E16D4E900A06E92 /* ObjectConstructor.h */,
+                               BC2680C80E16D4E900A06E92 /* ObjectPrototype.cpp */,
+                               BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */,
                                F692A8770255597D01FF60F7 /* operations.cpp */,
                                F692A8780255597D01FF60F7 /* operations.h */,
                                F692A8790255597D01FF60F7 /* PropertyMap.cpp */,
                                F692A87A0255597D01FF60F7 /* PropertyMap.h */,
-                               65621E6B089E859700760F35 /* PropertySlot.cpp */,
-                               65621E6C089E859700760F35 /* PropertySlot.h */,
                                65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */,
                                65400C100A69BAF200509887 /* PropertyNameArray.h */,
+                               65621E6B089E859700760F35 /* PropertySlot.cpp */,
+                               65621E6C089E859700760F35 /* PropertySlot.h */,
                                65C02FBB0637462A003E7EE6 /* protect.h */,
                                F692A87D0255597D01FF60F7 /* regexp.cpp */,
                                F692A87E0255597D01FF60F7 /* regexp.h */,
                                14A396A60CD2933100B5B4FF /* SymbolTable.h */,
                                F692A8850255597D01FF60F7 /* ustring.cpp */,
                                F692A8860255597D01FF60F7 /* ustring.h */,
-                               14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
                        );
                        path = kjs;
                        sourceTree = "<group>";
                                65B174F509D100FA00820339 /* MathObject.lut.h in Headers */,
                                932F5B500822A1C700736975 /* nodes.h in Headers */,
                                932F5B510822A1C700736975 /* NumberObject.h in Headers */,
-                               65B174F609D100FA00820339 /* NumberObject.lut.h in Headers */,
-                               932F5B540822A1C700736975 /* JSObject.h in Headers */,
-                               932F5B530822A1C700736975 /* object_object.h in Headers */,
                                932F5B550822A1C700736975 /* operations.h in Headers */,
                                932F5B6C0822A1C700736975 /* pcre.h in Headers */,
                                93E26BE608B1517100F85226 /* pcre_internal.h in Headers */,
                                1480DB9D0DDC227F003CFDF2 /* DebuggerCallFrame.h in Headers */,
                                E18E3A580DF9278C00D90B34 /* JSGlobalData.h in Headers */,
                                BC7952090E15E8A800A898AB /* ArrayConstructor.h in Headers */,
+                               BC2680CB0E16D4E900A06E92 /* FunctionConstructor.h in Headers */,
+                               BC2680CD0E16D4E900A06E92 /* NumberConstructor.h in Headers */,
+                               BC2680CF0E16D4E900A06E92 /* NumberPrototype.h in Headers */,
+                               BC2680D10E16D4E900A06E92 /* ObjectConstructor.h in Headers */,
+                               BC2680D30E16D4E900A06E92 /* ObjectPrototype.h in Headers */,
+                               BC2680E70E16D52300A06E92 /* NumberConstructor.lut.h in Headers */,
+                               BC22A39C0E16E14800AF21C8 /* JSObject.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                1482B74E0A43032800517CFC /* JSStringRef.cpp in Sources */,
                                146AAB380B66A94400E55F16 /* JSStringRefCF.cpp in Sources */,
                                14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */,
-                               14F252610D08DF2F004ECFFF /* JSVariableObject.cpp in Sources */,
                                14E0FF120DBAAED00007C0AB /* Machine.cpp in Sources */,
                                E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */,
                                930754C108B0F68000AB3056 /* pcre_compile.cpp in Sources */,
index 72b1f71..ebae876 100644 (file)
@@ -59,6 +59,7 @@ Source files for JSCore.
         kjs/error_object.cpp
         kjs/ExecState.cpp
         kjs/JSFunction.cpp
+        kjs/FunctionConstructor.cpp
         kjs/FunctionPrototype.cpp
         kjs/identifier.cpp
         kjs/InitializeThreading.cpp
@@ -78,9 +79,12 @@ Source files for JSCore.
         kjs/MathObject.cpp
         kjs/nodes.cpp
         kjs/nodes2string.cpp
+        kjs/NumberConstructor.cpp
         kjs/NumberObject.cpp
+        kjs/NumberPrototype.cpp
         kjs/JSObject.cpp
-        kjs/object_object.cpp
+        kjs/ObjectConstructor.cpp
+        kjs/ObjectPrototype.cpp
         kjs/operations.cpp
         kjs/Parser.cpp
         kjs/PropertyMap.cpp
index 4283f35..037c04d 100644 (file)
 #include "JSLock.h"
 #include "JSPropertyNameIterator.h"
 #include "JSString.h"
+#include "ObjectPrototype.h"
 #include "Parser.h"
 #include "Profiler.h"
 #include "RegExpObject.h"
 #include "Register.h"
 #include "debugger.h"
-#include "object_object.h"
 #include "operations.h"
 #include <stdio.h>
 
index c6f21b9..3dae408 100644 (file)
@@ -43,6 +43,7 @@
 #include "DateMath.cpp"
 #include "dtoa.cpp"
 #include "error_object.cpp"
+#include "FunctionConstructor.cpp"
 #include "FunctionPrototype.cpp"
 #include "grammar.cpp"
 #include "identifier.cpp"
 #include "MathObject.cpp"
 #include "nodes.cpp"
 #include "nodes2string.cpp"
+#include "NumberConstructor.cpp"
 #include "NumberObject.cpp"
+#include "NumberPrototype.cpp"
 #include "JSObject.cpp"
 #include "JSGlobalObject.cpp"
-#include "object_object.cpp"
+#include "ObjectConstructor.cpp"
+#include "ObjectPrototype.cpp"
 #include "operations.cpp"
 #include "Parser.cpp"
 #include "PropertyMap.cpp"
@@ -72,6 +76,7 @@
 #include "string_object.cpp"
 #include "ustring.cpp"
 #include "JSValue.cpp"
+#include "JSVariableObject.cpp"
 #include "wtf/FastMalloc.cpp"
 #include "wtf/TCSystemAlloc.cpp"
 #include "VM/CodeGenerator.cpp"
index 0b60529..ce75101 100644 (file)
@@ -25,6 +25,7 @@
 #include "ArrayConstructor.h"
 
 #include "ArrayPrototype.h"
+#include "FunctionPrototype.h"
 #include "JSArray.h"
 #include "error_object.h"
 #include "lookup.h"
index 2b0b0a7..6c1ce9b 100644 (file)
 #ifndef ArrayConstructor_h
 #define ArrayConstructor_h
 
-#include "FunctionPrototype.h"
+#include "JSFunction.h"
 
 namespace KJS {
 
   class ArrayPrototype;
+  class FunctionPrototype;
 
   class ArrayConstructor : public InternalFunction {
   public:
diff --git a/JavaScriptCore/kjs/FunctionConstructor.cpp b/JavaScriptCore/kjs/FunctionConstructor.cpp
new file mode 100644 (file)
index 0000000..fc4e14b
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 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 "FunctionConstructor.h"
+
+#include "FunctionPrototype.h"
+#include "JSFunction.h"
+#include "JSGlobalObject.h"
+#include "JSString.h"
+#include "Parser.h"
+#include "debugger.h"
+#include "lexer.h"
+#include "nodes.h"
+
+namespace KJS {
+
+FunctionConstructor::FunctionConstructor(ExecState* exec, FunctionPrototype* functionPrototype)
+    : InternalFunction(functionPrototype, Identifier(exec, functionPrototype->classInfo()->className))
+{
+    putDirect(exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly);
+
+    // Number of arguments for constructor
+    putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
+}
+
+static JSObject* constructWithFunctionConstructor(ExecState* exec, JSObject*, const ArgList& args)
+{
+    return constructFunction(exec, args);
+}
+
+ConstructType FunctionConstructor::getConstructData(ConstructData& constructData)
+{
+    constructData.native.function = constructWithFunctionConstructor;
+    return ConstructTypeNative;
+}
+
+static JSValue* callFunctionConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+{
+    return constructFunction(exec, args);
+}
+
+// ECMA 15.3.1 The Function Constructor Called as a Function
+CallType FunctionConstructor::getCallData(CallData& callData)
+{
+    callData.native.function = callFunctionConstructor;
+    return CallTypeNative;
+}
+
+// ECMA 15.3.2 The Function Constructor
+JSObject* constructFunction(ExecState* exec, const ArgList& args, const Identifier& functionName, const UString& sourceURL, int lineNumber)
+{
+    UString p("");
+    UString body;
+    int argsSize = args.size();
+    if (argsSize == 0)
+        body = "";
+    else if (argsSize == 1)
+        body = args[0]->toString(exec);
+    else {
+        p = args[0]->toString(exec);
+        for (int k = 1; k < argsSize - 1; k++)
+            p += "," + args[k]->toString(exec);
+        body = args[argsSize - 1]->toString(exec);
+    }
+
+    // parse the source code
+    int sourceId;
+    int errLine;
+    UString errMsg;
+    RefPtr<SourceProvider> source = UStringSourceProvider::create(body);
+    RefPtr<FunctionBodyNode> functionBody = exec->parser()->parse<FunctionBodyNode>(exec, sourceURL, lineNumber, source, &sourceId, &errLine, &errMsg);
+
+    // No program node == syntax error - throw a syntax error
+    if (!functionBody)
+        // We can't return a Completion(Throw) here, so just set the exception
+        // and return it
+        return throwError(exec, SyntaxError, errMsg, errLine, sourceId, sourceURL);
+    
+    functionBody->setSource(SourceRange(source, 0, source->length()));
+    ScopeChain scopeChain(exec->lexicalGlobalObject(), exec->globalThisValue());
+
+    JSFunction* function = new (exec) JSFunction(exec, functionName, functionBody.get(), scopeChain.node());
+
+    // parse parameter list. throw syntax error on illegal identifiers
+    int len = p.size();
+    const UChar* c = p.data();
+    int i = 0, params = 0;
+    UString param;
+    while (i < len) {
+        while (*c == ' ' && i < len)
+            c++, i++;
+        if (Lexer::isIdentStart(c[0])) {  // else error
+            param = UString(c, 1);
+            c++, i++;
+            while (i < len && (Lexer::isIdentPart(c[0]))) {
+                param.append(*c);
+                c++, i++;
+            }
+            while (i < len && *c == ' ')
+                c++, i++;
+            if (i == len) {
+                functionBody->parameters().append(Identifier(exec, param));
+                params++;
+                break;
+            } else if (*c == ',') {
+                functionBody->parameters().append(Identifier(exec, param));
+                params++;
+                c++, i++;
+                continue;
+            } // else error
+        }
+        return throwError(exec, SyntaxError, "Syntax error in parameter list");
+    }
+  
+    JSObject* prototype = constructEmptyObject(exec);
+    prototype->putDirect(exec->propertyNames().constructor, function, DontEnum);
+    function->putDirect(exec->propertyNames().prototype, prototype, DontDelete);
+    return function;
+}
+
+// ECMA 15.3.2 The Function Constructor
+JSObject* constructFunction(ExecState* exec, const ArgList& args)
+{
+    return constructFunction(exec, args, Identifier(exec, "anonymous"), UString(), 1);
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/FunctionConstructor.h b/JavaScriptCore/kjs/FunctionConstructor.h
new file mode 100644 (file)
index 0000000..c9d2fdc
--- /dev/null
@@ -0,0 +1,50 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2006 Apple Computer, Inc.
+ *
+ *  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 FunctionConstructor_h
+#define FunctionConstructor_h
+
+#include "JSFunction.h"
+
+namespace KJS {
+
+    class FunctionPrototype;
+
+    /**
+     * @internal
+     *
+     * The initial value of the the global variable's "Function" property
+     */
+    class FunctionConstructor : public InternalFunction {
+    public:
+        FunctionConstructor(ExecState*, FunctionPrototype*);
+    private:
+        virtual ConstructType getConstructData(ConstructData&);
+        virtual CallType getCallData(CallData&);
+    };
+
+    JSObject* constructFunction(ExecState*, const ArgList&, const Identifier& functionName, const UString& sourceURL, int lineNumber);
+    JSObject* constructFunction(ExecState*, const ArgList&);
+
+} // namespace KJS
+
+#endif // FunctionConstructor_h
index 0c1eaad..0bd615e 100644 (file)
 #include "config.h"
 #include "FunctionPrototype.h"
 
-#include "JSGlobalObject.h"
-#include "Parser.h"
-#include "debugger.h"
-#include "JSArray.h"
-#include "JSFunction.h"
 #include "JSString.h"
-#include "lexer.h"
-#include "nodes.h"
-#include "JSObject.h"
-#include <stdio.h>
-#include <string.h>
-#include <wtf/Assertions.h>
 
 namespace KJS {
 
-// ------------------------------ FunctionPrototype -------------------------
-
 static JSValue* functionProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
 static JSValue* functionProtoFuncApply(ExecState*, JSObject*, JSValue*, const ArgList&);
 static JSValue* functionProtoFuncCall(ExecState*, JSObject*, JSValue*, const ArgList&);
@@ -133,116 +120,4 @@ JSValue* functionProtoFuncCall(ExecState* exec, JSObject*, JSValue* thisValue, c
     return call(exec, thisValue, callType, callData, callThis, argsTail);
 }
 
-// ------------------------------ FunctionConstructor ----------------------------
-
-FunctionConstructor::FunctionConstructor(ExecState* exec, FunctionPrototype* functionPrototype)
-    : InternalFunction(functionPrototype, Identifier(exec, functionPrototype->classInfo()->className))
-{
-    putDirect(exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly);
-
-    // Number of arguments for constructor
-    putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
-}
-
-static JSObject* constructWithFunctionConstructor(ExecState* exec, JSObject*, const ArgList& args)
-{
-    return constructFunction(exec, args);
-}
-
-ConstructType FunctionConstructor::getConstructData(ConstructData& constructData)
-{
-    constructData.native.function = constructWithFunctionConstructor;
-    return ConstructTypeNative;
-}
-
-static JSValue* callFunctionConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
-{
-    return constructFunction(exec, args);
-}
-
-// ECMA 15.3.1 The Function Constructor Called as a Function
-CallType FunctionConstructor::getCallData(CallData& callData)
-{
-    callData.native.function = callFunctionConstructor;
-    return CallTypeNative;
-}
-
-// ECMA 15.3.2 The Function Constructor
-JSObject* constructFunction(ExecState* exec, const ArgList& args, const Identifier& functionName, const UString& sourceURL, int lineNumber)
-{
-    UString p("");
-    UString body;
-    int argsSize = args.size();
-    if (argsSize == 0)
-        body = "";
-    else if (argsSize == 1)
-        body = args[0]->toString(exec);
-    else {
-        p = args[0]->toString(exec);
-        for (int k = 1; k < argsSize - 1; k++)
-            p += "," + args[k]->toString(exec);
-        body = args[argsSize - 1]->toString(exec);
-    }
-
-    // parse the source code
-    int sourceId;
-    int errLine;
-    UString errMsg;
-    RefPtr<SourceProvider> source = UStringSourceProvider::create(body);
-    RefPtr<FunctionBodyNode> functionBody = exec->parser()->parse<FunctionBodyNode>(exec, sourceURL, lineNumber, source, &sourceId, &errLine, &errMsg);
-
-    // No program node == syntax error - throw a syntax error
-    if (!functionBody)
-        // We can't return a Completion(Throw) here, so just set the exception
-        // and return it
-        return throwError(exec, SyntaxError, errMsg, errLine, sourceId, sourceURL);
-    
-    functionBody->setSource(SourceRange(source, 0, source->length()));
-    ScopeChain scopeChain(exec->lexicalGlobalObject(), exec->globalThisValue());
-
-    JSFunction* function = new (exec) JSFunction(exec, functionName, functionBody.get(), scopeChain.node());
-
-    // parse parameter list. throw syntax error on illegal identifiers
-    int len = p.size();
-    const UChar* c = p.data();
-    int i = 0, params = 0;
-    UString param;
-    while (i < len) {
-        while (*c == ' ' && i < len)
-            c++, i++;
-        if (Lexer::isIdentStart(c[0])) {  // else error
-            param = UString(c, 1);
-            c++, i++;
-            while (i < len && (Lexer::isIdentPart(c[0]))) {
-                param.append(*c);
-                c++, i++;
-            }
-            while (i < len && *c == ' ')
-                c++, i++;
-            if (i == len) {
-                functionBody->parameters().append(Identifier(exec, param));
-                params++;
-                break;
-            } else if (*c == ',') {
-                functionBody->parameters().append(Identifier(exec, param));
-                params++;
-                c++, i++;
-                continue;
-            } // else error
-        }
-        return throwError(exec, SyntaxError, "Syntax error in parameter list");
-    }
-  
-    JSObject* prototype = constructEmptyObject(exec);
-    prototype->putDirect(exec->propertyNames().constructor, function, DontEnum);
-    function->putDirect(exec->propertyNames().prototype, prototype, DontDelete);
-    return function;
-}
-
-// ECMA 15.3.2 The Function Constructor
-JSObject* constructFunction(ExecState* exec, const ArgList& args)
-{
-    return constructFunction(exec, args, Identifier(exec, "anonymous"), UString(), 1);
-}
-
 } // namespace KJS
index a5e2e1c..ffb76fe 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef FunctionPrototype_h
 #define FunctionPrototype_h
 
-#include "object_object.h"
 #include "JSFunction.h"
 
 namespace KJS {
@@ -41,22 +40,6 @@ namespace KJS {
         virtual CallType getCallData(CallData&);
     };
 
-    /**
-     * @internal
-     *
-     * The initial value of the the global variable's "Function" property
-     */
-    class FunctionConstructor : public InternalFunction {
-    public:
-        FunctionConstructor(ExecState*, FunctionPrototype*);
-    private:
-        virtual ConstructType getConstructData(ConstructData&);
-        virtual CallType getCallData(CallData&);
-    };
-
-    JSObject* constructFunction(ExecState*, const ArgList&, const Identifier& functionName, const UString& sourceURL, int lineNumber);
-    JSObject* constructFunction(ExecState*, const ArgList&);
-
 } // namespace KJS
 
-#endif // _FUNCTION_OBJECT_H_
+#endif // FunctionPrototype_h
index 6f74698..9b27c81 100644 (file)
 #include "JSFunction.h"
 
 #include "ExecState.h"
+#include "FunctionPrototype.h"
 #include "JSActivation.h"
 #include "JSGlobalObject.h"
+#include "JSString.h"
 #include "Machine.h"
+#include "ObjectPrototype.h"
 #include "Parser.h"
 #include "PropertyNameArray.h"
+#include "ScopeChainMark.h"
 #include "debugger.h"
 #include "dtoa.h"
-#include "FunctionPrototype.h"
-#include "JSString.h"
 #include "lexer.h"
 #include "nodes.h"
 #include "operations.h"
-#include "ScopeChainMark.h"
 #include <errno.h>
 #include <profiler/Profiler.h>
 #include <stdio.h>
index ab41c24..f56d14c 100644 (file)
 #include "config.h"
 #include "JSGlobalObject.h"
 
-#include "CodeBlock.h"
-#include "ArrayPrototype.h"
 #include "ArrayConstructor.h"
-#include "BooleanPrototype.h"
+#include "ArrayPrototype.h"
 #include "BooleanConstructor.h"
-#include "date_object.h"
-#include "debugger.h"
-#include "error_object.h"
+#include "BooleanPrototype.h"
+#include "CodeBlock.h"
+#include "FunctionConstructor.h"
 #include "FunctionPrototype.h"
 #include "Machine.h"
 #include "MathObject.h"
-#include "NumberObject.h"
-#include "object_object.h"
+#include "NumberConstructor.h"
+#include "NumberPrototype.h"
+#include "ObjectConstructor.h"
+#include "ObjectPrototype.h"
 #include "RegExpObject.h"
 #include "ScopeChainMark.h"
+#include "date_object.h"
+#include "debugger.h"
+#include "error_object.h"
 #include "string_object.h"
 
 namespace KJS {
index af7bd9a..dc9bd8e 100644 (file)
@@ -24,7 +24,7 @@
 #include "BooleanConstructor.h"
 #include "JSGlobalObject.h"
 #include "JSNotAnObject.h"
-#include "NumberObject.h"
+#include "NumberPrototype.h"
 
 namespace KJS {
 
index 43c9ee2..1cf6c1f 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef MathObject_h
 #define MathObject_h
 
-#include "FunctionPrototype.h"
+#include "JSObject.h"
 #include "lookup.h"
 
 namespace KJS {
diff --git a/JavaScriptCore/kjs/NumberConstructor.cpp b/JavaScriptCore/kjs/NumberConstructor.cpp
new file mode 100644 (file)
index 0000000..8e336ab
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ *  Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2007, 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 "NumberConstructor.h"
+#include "NumberConstructor.lut.h"
+
+#include "NumberObject.h"
+#include "NumberPrototype.h"
+
+namespace KJS {
+
+
+const ClassInfo NumberConstructor::info = { "Function", &InternalFunction::info, 0, ExecState::numberTable };
+
+/* Source for NumberObject.lut.h
+@begin numberTable
+  NaN                   NumberConstructor::NaNValue       DontEnum|DontDelete|ReadOnly
+  NEGATIVE_INFINITY     NumberConstructor::NegInfinity    DontEnum|DontDelete|ReadOnly
+  POSITIVE_INFINITY     NumberConstructor::PosInfinity    DontEnum|DontDelete|ReadOnly
+  MAX_VALUE             NumberConstructor::MaxValue       DontEnum|DontDelete|ReadOnly
+  MIN_VALUE             NumberConstructor::MinValue       DontEnum|DontDelete|ReadOnly
+@end
+*/
+NumberConstructor::NumberConstructor(ExecState* exec, FunctionPrototype* funcProto, NumberPrototype* numberProto)
+    : InternalFunction(funcProto, Identifier(exec, numberProto->info.className))
+{
+    // Number.Prototype
+    putDirect(exec->propertyNames().prototype, numberProto, DontEnum|DontDelete|ReadOnly);
+
+    // no. of arguments for constructor
+    putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
+}
+
+bool NumberConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, slot);
+}
+
+JSValue* NumberConstructor::getValueProperty(ExecState* exec, int token) const
+{
+    // ECMA 15.7.3
+    switch (token) {
+        case NaNValue:
+            return jsNaN(exec);
+        case NegInfinity:
+            return jsNumberCell(exec, -Inf);
+        case PosInfinity:
+            return jsNumberCell(exec, Inf);
+        case MaxValue:
+            return jsNumberCell(exec, 1.7976931348623157E+308);
+        case MinValue:
+            return jsNumberCell(exec, 5E-324);
+    }
+    ASSERT_NOT_REACHED();
+    return jsNull();
+}
+
+// ECMA 15.7.1
+static JSObject* constructWithNumberConstructor(ExecState* exec, JSObject*, const ArgList& args)
+{
+    NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());
+    double n = args.isEmpty() ? 0 : args[0]->toNumber(exec);
+    obj->setInternalValue(jsNumber(exec, n));
+    return obj;
+}
+
+ConstructType NumberConstructor::getConstructData(ConstructData& constructData)
+{
+    constructData.native.function = constructWithNumberConstructor;
+    return ConstructTypeNative;
+}
+
+// ECMA 15.7.2
+static JSValue* callNumberConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+{
+    return jsNumber(exec, args.isEmpty() ? 0 : args[0]->toNumber(exec));
+}
+
+CallType NumberConstructor::getCallData(CallData& callData)
+{
+    callData.native.function = callNumberConstructor;
+    return CallTypeNative;
+}
+
+NumberObject* constructNumber(ExecState* exec, JSNumberCell* number)
+{
+    NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());
+    obj->setInternalValue(number);
+    return obj;
+}
+
+NumberObject* constructNumberFromImmediateNumber(ExecState* exec, JSValue* value)
+{
+    NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());
+    obj->setInternalValue(value);
+    return obj;
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/NumberConstructor.h b/JavaScriptCore/kjs/NumberConstructor.h
new file mode 100644 (file)
index 0000000..bebf6aa
--- /dev/null
@@ -0,0 +1,56 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *
+ *  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 NumberConstructor_h
+#define NumberConstructor_h
+
+#include "JSFunction.h"
+
+namespace KJS {
+
+    class FunctionPrototype;
+    class NumberPrototype;
+
+    /**
+     * @internal
+     *
+     * The initial value of the the global variable's "Number" property
+     */
+    class NumberConstructor : public InternalFunction {
+    public:
+        NumberConstructor(ExecState*, FunctionPrototype*, NumberPrototype*);
+
+        bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+        JSValue* getValueProperty(ExecState*, int token) const;
+
+        static const ClassInfo info;
+
+        enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
+
+    private:
+        virtual ConstructType getConstructData(ConstructData&);
+        virtual CallType getCallData(CallData&);
+        virtual const ClassInfo* classInfo() const { return &info; }
+    };
+
+} // namespace KJS
+
+#endif // NumberConstructor_h
index 28ad2e3..b568d02 100644 (file)
 
 #include "config.h"
 #include "NumberObject.h"
-#include "NumberObject.lut.h"
-
-#include "dtoa.h"
-#include "error_object.h"
-#include "operations.h"
-#include <wtf/Assertions.h>
-#include <wtf/MathExtras.h>
-#include <wtf/Vector.h>
 
 namespace KJS {
 
-// ------------------------------ NumberObject ----------------------------
-
 const ClassInfo NumberObject::info = { "Number", 0, 0, 0 };
 
 NumberObject::NumberObject(JSObject* proto)
@@ -46,498 +36,4 @@ JSValue* NumberObject::getJSNumber()
     return internalValue();
 }
 
-// ------------------------------ NumberPrototype ---------------------------
-
-static JSValue* numberProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* numberProtoFuncToLocaleString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* numberProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* numberProtoFuncToFixed(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* numberProtoFuncToExponential(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* numberProtoFuncToPrecision(ExecState*, JSObject*, JSValue*, const ArgList&);
-
-// ECMA 15.7.4
-
-NumberPrototype::NumberPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)
-    : NumberObject(objectPrototype)
-{
-    setInternalValue(jsNumber(exec, 0));
-
-    // The constructor will be added later, after NumberConstructor has been constructed
-
-    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toString, numberProtoFuncToString), DontEnum);
-    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toLocaleString, numberProtoFuncToLocaleString), DontEnum);
-    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, numberProtoFuncValueOf), DontEnum);
-    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toFixed, numberProtoFuncToFixed), DontEnum);
-    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toExponential, numberProtoFuncToExponential), DontEnum);
-    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toPrecision, numberProtoFuncToPrecision), DontEnum);
-}
-
-// ------------------------------ Functions ---------------------------
-
-// ECMA 15.7.4.2 - 15.7.4.7
-
-static UString integer_part_noexp(double d)
-{
-    int decimalPoint;
-    int sign;
-    char* result = dtoa(d, 0, &decimalPoint, &sign, NULL);
-    bool resultIsInfOrNan = (decimalPoint == 9999);
-    size_t length = strlen(result);
-
-    UString str = sign ? "-" : "";
-    if (resultIsInfOrNan)
-        str += result;
-    else if (decimalPoint <= 0)
-        str += "0";
-    else {
-        Vector<char, 1024> buf(decimalPoint + 1);
-
-        if (static_cast<int>(length) <= decimalPoint) {
-            strcpy(buf.data(), result);
-            memset(buf.data() + length, '0', decimalPoint - length);
-        } else
-            strncpy(buf.data(), result, decimalPoint);
-
-        buf[decimalPoint] = '\0';
-        str.append(buf.data());
-    }
-
-    freedtoa(result);
-
-    return str;
-}
-
-static UString char_sequence(char c, int count)
-{
-    Vector<char, 2048> buf(count + 1, c);
-    buf[count] = '\0';
-
-    return UString(buf.data());
-}
-
-static double intPow10(int e)
-{
-    // This function uses the "exponentiation by squaring" algorithm and
-    // long double to quickly and precisely calculate integer powers of 10.0.
-
-    // This is a handy workaround for <rdar://problem/4494756>
-
-    if (e == 0)
-        return 1.0;
-
-    bool negative = e < 0;
-    unsigned exp = negative ? -e : e;
-
-    long double result = 10.0;
-    bool foundOne = false;
-    for (int bit = 31; bit >= 0; bit--) {
-        if (!foundOne) {
-            if ((exp >> bit) & 1)
-                foundOne = true;
-        } else {
-            result = result * result;
-            if ((exp >> bit) & 1)
-                result = result * 10.0;
-        }
-    }
-
-    if (negative)
-        return static_cast<double>(1.0 / result);
-    return static_cast<double>(result);
-}
-
-
-JSValue* numberProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
-{
-    JSValue* v = thisValue->getJSNumber();
-    if (!v)
-        return throwError(exec, TypeError);
-
-    double radixAsDouble = args[0]->toInteger(exec); // nan -> 0
-    if (radixAsDouble == 10 || args[0]->isUndefined())
-        return jsString(exec, v->toString(exec));
-
-    if (radixAsDouble < 2 || radixAsDouble > 36)
-        return throwError(exec, RangeError, "toString() radix argument must be between 2 and 36");
-
-    int radix = static_cast<int>(radixAsDouble);
-    const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-    // INT_MAX results in 1024 characters left of the dot with radix 2
-    // give the same space on the right side. safety checks are in place
-    // unless someone finds a precise rule.
-    char s[2048 + 3];
-    const char* lastCharInString = s + sizeof(s) - 1;
-    double x = v->uncheckedGetNumber();
-    if (isnan(x) || isinf(x))
-        return jsString(exec, UString::from(x));
-
-    bool isNegative = x < 0.0;
-    if (isNegative)
-        x = -x;
-
-    double integerPart = floor(x);
-    char* decimalPoint = s + sizeof(s) / 2;
-
-    // convert integer portion
-    char* p = decimalPoint;
-    double d = integerPart;
-    do {
-        int remainderDigit = static_cast<int>(fmod(d, radix));
-        *--p = digits[remainderDigit];
-        d /= radix;
-    } while ((d <= -1.0 || d >= 1.0) && s < p);
-
-    if (isNegative)
-        *--p = '-';
-    char* startOfResultString = p;
-    ASSERT(s <= startOfResultString);
-
-    d = x - integerPart;
-    p = decimalPoint;
-    const double epsilon = 0.001; // TODO: guessed. base on radix ?
-    bool hasFractionalPart = (d < -epsilon || d > epsilon);
-    if (hasFractionalPart) {
-        *p++ = '.';
-        do {
-            d *= radix;
-            const int digit = static_cast<int>(d);
-            *p++ = digits[digit];
-            d -= digit;
-        } while ((d < -epsilon || d > epsilon) && p < lastCharInString);
-    }
-    *p = '\0';
-    ASSERT(p < s + sizeof(s));
-
-    return jsString(exec, startOfResultString);
-}
-
-JSValue* numberProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
-{
-    // FIXME: Not implemented yet.
-
-    JSValue* v = thisValue->getJSNumber();
-    if (!v)
-        return throwError(exec, TypeError);
-
-    return jsString(exec, v->toString(exec));
-}
-
-JSValue* numberProtoFuncValueOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
-{
-    JSValue* v = thisValue->getJSNumber();
-    if (!v)
-        return throwError(exec, TypeError);
-
-    return v;
-}
-
-JSValue* numberProtoFuncToFixed(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
-{
-    JSValue* v = thisValue->getJSNumber();
-    if (!v)
-        return throwError(exec, TypeError);
-
-    JSValue* fractionDigits = args[0];
-    double df = fractionDigits->toInteger(exec);
-    if (!(df >= 0 && df <= 20))
-        return throwError(exec, RangeError, "toFixed() digits argument must be between 0 and 20");
-    int f = (int)df;
-
-    double x = v->uncheckedGetNumber();
-    if (isnan(x))
-        return jsString(exec, "NaN");
-
-    UString s;
-    if (x < 0) {
-        s.append('-');
-        x = -x;
-    } else if (x == -0.0)
-        x = 0;
-
-    if (x >= pow(10.0, 21.0))
-        return jsString(exec, s + UString::from(x));
-
-    const double tenToTheF = pow(10.0, f);
-    double n = floor(x * tenToTheF);
-    if (fabs(n / tenToTheF - x) >= fabs((n + 1) / tenToTheF - x))
-        n++;
-
-    UString m = integer_part_noexp(n);
-
-    int k = m.size();
-    if (k <= f) {
-        UString z;
-        for (int i = 0; i < f + 1 - k; i++)
-            z.append('0');
-        m = z + m;
-        k = f + 1;
-        ASSERT(k == m.size());
-    }
-    int kMinusf = k - f;
-    if (kMinusf < m.size())
-        return jsString(exec, s + m.substr(0, kMinusf) + "." + m.substr(kMinusf));
-    return jsString(exec, s + m.substr(0, kMinusf));
-}
-
-static void fractionalPartToString(char* buf, int& i, const char* result, int resultLength, int fractionalDigits)
-{
-    if (fractionalDigits <= 0)
-        return;
-
-    int fDigitsInResult = static_cast<int>(resultLength) - 1;
-    buf[i++] = '.';
-    if (fDigitsInResult > 0) {
-        if (fractionalDigits < fDigitsInResult) {
-            strncpy(buf + i, result + 1, fractionalDigits);
-            i += fractionalDigits;
-        } else {
-            strcpy(buf + i, result + 1);
-            i += static_cast<int>(resultLength) - 1;
-        }
-    }
-
-    for (int j = 0; j < fractionalDigits - fDigitsInResult; j++)
-        buf[i++] = '0';
-}
-
-static void exponentialPartToString(char* buf, int& i, int decimalPoint)
-{
-    buf[i++] = 'e';
-    buf[i++] = (decimalPoint >= 0) ? '+' : '-';
-    // decimalPoint can't be more than 3 digits decimal given the
-    // nature of float representation
-    int exponential = decimalPoint - 1;
-    if (exponential < 0)
-        exponential *= -1;
-    if (exponential >= 100)
-        buf[i++] = static_cast<char>('0' + exponential / 100);
-    if (exponential >= 10)
-        buf[i++] = static_cast<char>('0' + (exponential % 100) / 10);
-    buf[i++] = static_cast<char>('0' + exponential % 10);
-}
-
-JSValue* numberProtoFuncToExponential(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
-{
-    JSValue* v = thisValue->getJSNumber();
-    if (!v)
-        return throwError(exec, TypeError);
-
-    double x = v->uncheckedGetNumber();
-
-    if (isnan(x) || isinf(x))
-        return jsString(exec, UString::from(x));
-
-    JSValue* fractionalDigitsValue = args[0];
-    double df = fractionalDigitsValue->toInteger(exec);
-    if (!(df >= 0 && df <= 20))
-        return throwError(exec, RangeError, "toExponential() argument must between 0 and 20");
-    int fractionalDigits = (int)df;
-    bool includeAllDigits = fractionalDigitsValue->isUndefined();
-
-    int decimalAdjust = 0;
-    if (x && !includeAllDigits) {
-        double logx = floor(log10(fabs(x)));
-        x /= pow(10.0, logx);
-        const double tenToTheF = pow(10.0, fractionalDigits);
-        double fx = floor(x * tenToTheF) / tenToTheF;
-        double cx = ceil(x * tenToTheF) / tenToTheF;
-
-        if (fabs(fx - x) < fabs(cx - x))
-            x = fx;
-        else
-            x = cx;
-
-        decimalAdjust = static_cast<int>(logx);
-    }
-
-    if (isnan(x))
-        return jsString(exec, "NaN");
-
-    if (x == -0.0) // (-0.0).toExponential() should print as 0 instead of -0
-        x = 0;
-
-    int decimalPoint;
-    int sign;
-    char* result = dtoa(x, 0, &decimalPoint, &sign, NULL);
-    size_t resultLength = strlen(result);
-    decimalPoint += decimalAdjust;
-
-    int i = 0;
-    char buf[80]; // digit + '.' + fractionDigits (max 20) + 'e' + sign + exponent (max?)
-    if (sign)
-        buf[i++] = '-';
-
-    if (decimalPoint == 999) // ? 9999 is the magical "result is Inf or NaN" value.  what's 999??
-        strcpy(buf + i, result);
-    else {
-        buf[i++] = result[0];
-
-        if (includeAllDigits)
-            fractionalDigits = static_cast<int>(resultLength) - 1;
-
-        fractionalPartToString(buf, i, result, resultLength, fractionalDigits);
-        exponentialPartToString(buf, i, decimalPoint);
-        buf[i++] = '\0';
-    }
-    ASSERT(i <= 80);
-
-    freedtoa(result);
-
-    return jsString(exec, buf);
-}
-
-JSValue* numberProtoFuncToPrecision(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
-{
-    JSValue* v = thisValue->getJSNumber();
-    if (!v)
-        return throwError(exec, TypeError);
-
-    double doublePrecision = args[0]->toIntegerPreserveNaN(exec);
-    double x = v->uncheckedGetNumber();
-    if (args[0]->isUndefined() || isnan(x) || isinf(x))
-        return jsString(exec, v->toString(exec));
-
-    UString s;
-    if (x < 0) {
-        s = "-";
-        x = -x;
-    }
-
-    if (!(doublePrecision >= 1 && doublePrecision <= 21)) // true for NaN
-        return throwError(exec, RangeError, "toPrecision() argument must be between 1 and 21");
-    int precision = (int)doublePrecision;
-
-    int e = 0;
-    UString m;
-    if (x) {
-        e = static_cast<int>(log10(x));
-        double tens = intPow10(e - precision + 1);
-        double n = floor(x / tens);
-        if (n < intPow10(precision - 1)) {
-            e = e - 1;
-            tens = intPow10(e - precision + 1);
-            n = floor(x / tens);
-        }
-
-        if (fabs((n + 1.0) * tens - x) <= fabs(n * tens - x))
-            ++n;
-        // maintain n < 10^(precision)
-        if (n >= intPow10(precision)) {
-            n /= 10.0;
-            e += 1;
-        }
-        ASSERT(intPow10(precision - 1) <= n);
-        ASSERT(n < intPow10(precision));
-
-        m = integer_part_noexp(n);
-        if (e < -6 || e >= precision) {
-            if (m.size() > 1)
-                m = m.substr(0, 1) + "." + m.substr(1);
-            if (e >= 0)
-                return jsString(exec, s + m + "e+" + UString::from(e));
-            return jsString(exec, s + m + "e-" + UString::from(-e));
-        }
-    } else {
-        m = char_sequence('0', precision);
-        e = 0;
-    }
-
-    if (e == precision - 1)
-        return jsString(exec, s + m);
-    if (e >= 0) {
-        if (e + 1 < m.size())
-            return jsString(exec, s + m.substr(0, e + 1) + "." + m.substr(e + 1));
-        return jsString(exec, s + m);
-    }
-    return jsString(exec, s + "0." + char_sequence('0', -(e + 1)) + m);
-}
-
-// ------------------------------ NumberConstructor ------------------------------
-
-const ClassInfo NumberConstructor::info = { "Function", &InternalFunction::info, 0, ExecState::numberTable };
-
-/* Source for NumberObject.lut.h
-@begin numberTable
-  NaN                   NumberConstructor::NaNValue       DontEnum|DontDelete|ReadOnly
-  NEGATIVE_INFINITY     NumberConstructor::NegInfinity    DontEnum|DontDelete|ReadOnly
-  POSITIVE_INFINITY     NumberConstructor::PosInfinity    DontEnum|DontDelete|ReadOnly
-  MAX_VALUE             NumberConstructor::MaxValue       DontEnum|DontDelete|ReadOnly
-  MIN_VALUE             NumberConstructor::MinValue       DontEnum|DontDelete|ReadOnly
-@end
-*/
-NumberConstructor::NumberConstructor(ExecState* exec, FunctionPrototype* funcProto, NumberPrototype* numberProto)
-    : InternalFunction(funcProto, Identifier(exec, numberProto->info.className))
-{
-    // Number.Prototype
-    putDirect(exec->propertyNames().prototype, numberProto, DontEnum|DontDelete|ReadOnly);
-
-    // no. of arguments for constructor
-    putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
-}
-
-bool NumberConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
-    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, slot);
-}
-
-JSValue* NumberConstructor::getValueProperty(ExecState* exec, int token) const
-{
-    // ECMA 15.7.3
-    switch (token) {
-        case NaNValue:
-            return jsNaN(exec);
-        case NegInfinity:
-            return jsNumberCell(exec, -Inf);
-        case PosInfinity:
-            return jsNumberCell(exec, Inf);
-        case MaxValue:
-            return jsNumberCell(exec, 1.7976931348623157E+308);
-        case MinValue:
-            return jsNumberCell(exec, 5E-324);
-    }
-    ASSERT_NOT_REACHED();
-    return jsNull();
-}
-
-// ECMA 15.7.1
-static JSObject* constructWithNumberConstructor(ExecState* exec, JSObject*, const ArgList& args)
-{
-    NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());
-    double n = args.isEmpty() ? 0 : args[0]->toNumber(exec);
-    obj->setInternalValue(jsNumber(exec, n));
-    return obj;
-}
-
-ConstructType NumberConstructor::getConstructData(ConstructData& constructData)
-{
-    constructData.native.function = constructWithNumberConstructor;
-    return ConstructTypeNative;
-}
-
-// ECMA 15.7.2
-static JSValue* callNumberConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
-{
-    return jsNumber(exec, args.isEmpty() ? 0 : args[0]->toNumber(exec));
-}
-
-CallType NumberConstructor::getCallData(CallData& callData)
-{
-    callData.native.function = callNumberConstructor;
-    return CallTypeNative;
-}
-
-NumberObject* constructNumber(ExecState* exec, JSNumberCell* number)
-{
-    NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());
-    obj->setInternalValue(number);
-    return obj;
-}
-
-NumberObject* constructNumberFromImmediateNumber(ExecState* exec, JSValue* value)
-{
-    NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());
-    obj->setInternalValue(value);
-    return obj;
-}
-
 } // namespace KJS
index 1953c60..bc00ae0 100644 (file)
@@ -1,7 +1,7 @@
 // -*- c-basic-offset: 2 -*-
 /*
- *  This file is part of the KDE libraries
  *  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
@@ -22,7 +22,6 @@
 #ifndef NumberObject_h
 #define NumberObject_h
 
-#include "FunctionPrototype.h"
 #include "JSWrapperObject.h"
 
 namespace KJS {
@@ -42,39 +41,6 @@ namespace KJS {
     NumberObject* constructNumber(ExecState*, JSNumberCell*);
     NumberObject* constructNumberFromImmediateNumber(ExecState*, JSValue*);
 
-    /**
-     * @internal
-     *
-     * The initial value of Number.prototype (and thus all objects created
-     * with the Number constructor
-     */
-    class NumberPrototype : public NumberObject {
-    public:
-        NumberPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
-    };
-
-    /**
-     * @internal
-     *
-     * The initial value of the the global variable's "Number" property
-     */
-    class NumberConstructor : public InternalFunction {
-    public:
-        NumberConstructor(ExecState*, FunctionPrototype*, NumberPrototype*);
-
-        bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
-        JSValue* getValueProperty(ExecState*, int token) const;
-
-        static const ClassInfo info;
-
-        enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
-
-    private:
-        virtual ConstructType getConstructData(ConstructData&);
-        virtual CallType getCallData(CallData&);
-        virtual const ClassInfo* classInfo() const { return &info; }
-    };
-
 } // namespace KJS
 
 #endif // NumberObject_h
diff --git a/JavaScriptCore/kjs/NumberPrototype.cpp b/JavaScriptCore/kjs/NumberPrototype.cpp
new file mode 100644 (file)
index 0000000..0b61b20
--- /dev/null
@@ -0,0 +1,439 @@
+/*
+ *  Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2007, 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 "NumberPrototype.h"
+
+#include "dtoa.h"
+#include "error_object.h"
+#include "operations.h"
+#include <wtf/Assertions.h>
+#include <wtf/MathExtras.h>
+#include <wtf/Vector.h>
+
+namespace KJS {
+
+
+static JSValue* numberProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValue* numberProtoFuncToLocaleString(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValue* numberProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValue* numberProtoFuncToFixed(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValue* numberProtoFuncToExponential(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValue* numberProtoFuncToPrecision(ExecState*, JSObject*, JSValue*, const ArgList&);
+
+// ECMA 15.7.4
+
+NumberPrototype::NumberPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)
+    : NumberObject(objectPrototype)
+{
+    setInternalValue(jsNumber(exec, 0));
+
+    // The constructor will be added later, after NumberConstructor has been constructed
+
+    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toString, numberProtoFuncToString), DontEnum);
+    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toLocaleString, numberProtoFuncToLocaleString), DontEnum);
+    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, numberProtoFuncValueOf), DontEnum);
+    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toFixed, numberProtoFuncToFixed), DontEnum);
+    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toExponential, numberProtoFuncToExponential), DontEnum);
+    putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toPrecision, numberProtoFuncToPrecision), DontEnum);
+}
+
+// ------------------------------ Functions ---------------------------
+
+// ECMA 15.7.4.2 - 15.7.4.7
+
+static UString integer_part_noexp(double d)
+{
+    int decimalPoint;
+    int sign;
+    char* result = dtoa(d, 0, &decimalPoint, &sign, NULL);
+    bool resultIsInfOrNan = (decimalPoint == 9999);
+    size_t length = strlen(result);
+
+    UString str = sign ? "-" : "";
+    if (resultIsInfOrNan)
+        str += result;
+    else if (decimalPoint <= 0)
+        str += "0";
+    else {
+        Vector<char, 1024> buf(decimalPoint + 1);
+
+        if (static_cast<int>(length) <= decimalPoint) {
+            strcpy(buf.data(), result);
+            memset(buf.data() + length, '0', decimalPoint - length);
+        } else
+            strncpy(buf.data(), result, decimalPoint);
+
+        buf[decimalPoint] = '\0';
+        str.append(buf.data());
+    }
+
+    freedtoa(result);
+
+    return str;
+}
+
+static UString char_sequence(char c, int count)
+{
+    Vector<char, 2048> buf(count + 1, c);
+    buf[count] = '\0';
+
+    return UString(buf.data());
+}
+
+static double intPow10(int e)
+{
+    // This function uses the "exponentiation by squaring" algorithm and
+    // long double to quickly and precisely calculate integer powers of 10.0.
+
+    // This is a handy workaround for <rdar://problem/4494756>
+
+    if (e == 0)
+        return 1.0;
+
+    bool negative = e < 0;
+    unsigned exp = negative ? -e : e;
+
+    long double result = 10.0;
+    bool foundOne = false;
+    for (int bit = 31; bit >= 0; bit--) {
+        if (!foundOne) {
+            if ((exp >> bit) & 1)
+                foundOne = true;
+        } else {
+            result = result * result;
+            if ((exp >> bit) & 1)
+                result = result * 10.0;
+        }
+    }
+
+    if (negative)
+        return static_cast<double>(1.0 / result);
+    return static_cast<double>(result);
+}
+
+
+JSValue* numberProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+{
+    JSValue* v = thisValue->getJSNumber();
+    if (!v)
+        return throwError(exec, TypeError);
+
+    double radixAsDouble = args[0]->toInteger(exec); // nan -> 0
+    if (radixAsDouble == 10 || args[0]->isUndefined())
+        return jsString(exec, v->toString(exec));
+
+    if (radixAsDouble < 2 || radixAsDouble > 36)
+        return throwError(exec, RangeError, "toString() radix argument must be between 2 and 36");
+
+    int radix = static_cast<int>(radixAsDouble);
+    const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+    // INT_MAX results in 1024 characters left of the dot with radix 2
+    // give the same space on the right side. safety checks are in place
+    // unless someone finds a precise rule.
+    char s[2048 + 3];
+    const char* lastCharInString = s + sizeof(s) - 1;
+    double x = v->uncheckedGetNumber();
+    if (isnan(x) || isinf(x))
+        return jsString(exec, UString::from(x));
+
+    bool isNegative = x < 0.0;
+    if (isNegative)
+        x = -x;
+
+    double integerPart = floor(x);
+    char* decimalPoint = s + sizeof(s) / 2;
+
+    // convert integer portion
+    char* p = decimalPoint;
+    double d = integerPart;
+    do {
+        int remainderDigit = static_cast<int>(fmod(d, radix));
+        *--p = digits[remainderDigit];
+        d /= radix;
+    } while ((d <= -1.0 || d >= 1.0) && s < p);
+
+    if (isNegative)
+        *--p = '-';
+    char* startOfResultString = p;
+    ASSERT(s <= startOfResultString);
+
+    d = x - integerPart;
+    p = decimalPoint;
+    const double epsilon = 0.001; // TODO: guessed. base on radix ?
+    bool hasFractionalPart = (d < -epsilon || d > epsilon);
+    if (hasFractionalPart) {
+        *p++ = '.';
+        do {
+            d *= radix;
+            const int digit = static_cast<int>(d);
+            *p++ = digits[digit];
+            d -= digit;
+        } while ((d < -epsilon || d > epsilon) && p < lastCharInString);
+    }
+    *p = '\0';
+    ASSERT(p < s + sizeof(s));
+
+    return jsString(exec, startOfResultString);
+}
+
+JSValue* numberProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+{
+    // FIXME: Not implemented yet.
+
+    JSValue* v = thisValue->getJSNumber();
+    if (!v)
+        return throwError(exec, TypeError);
+
+    return jsString(exec, v->toString(exec));
+}
+
+JSValue* numberProtoFuncValueOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+{
+    JSValue* v = thisValue->getJSNumber();
+    if (!v)
+        return throwError(exec, TypeError);
+
+    return v;
+}
+
+JSValue* numberProtoFuncToFixed(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+{
+    JSValue* v = thisValue->getJSNumber();
+    if (!v)
+        return throwError(exec, TypeError);
+
+    JSValue* fractionDigits = args[0];
+    double df = fractionDigits->toInteger(exec);
+    if (!(df >= 0 && df <= 20))
+        return throwError(exec, RangeError, "toFixed() digits argument must be between 0 and 20");
+    int f = (int)df;
+
+    double x = v->uncheckedGetNumber();
+    if (isnan(x))
+        return jsString(exec, "NaN");
+
+    UString s;
+    if (x < 0) {
+        s.append('-');
+        x = -x;
+    } else if (x == -0.0)
+        x = 0;
+
+    if (x >= pow(10.0, 21.0))
+        return jsString(exec, s + UString::from(x));
+
+    const double tenToTheF = pow(10.0, f);
+    double n = floor(x * tenToTheF);
+    if (fabs(n / tenToTheF - x) >= fabs((n + 1) / tenToTheF - x))
+        n++;
+
+    UString m = integer_part_noexp(n);
+
+    int k = m.size();
+    if (k <= f) {
+        UString z;
+        for (int i = 0; i < f + 1 - k; i++)
+            z.append('0');
+        m = z + m;
+        k = f + 1;
+        ASSERT(k == m.size());
+    }
+    int kMinusf = k - f;
+    if (kMinusf < m.size())
+        return jsString(exec, s + m.substr(0, kMinusf) + "." + m.substr(kMinusf));
+    return jsString(exec, s + m.substr(0, kMinusf));
+}
+
+static void fractionalPartToString(char* buf, int& i, const char* result, int resultLength, int fractionalDigits)
+{
+    if (fractionalDigits <= 0)
+        return;
+
+    int fDigitsInResult = static_cast<int>(resultLength) - 1;
+    buf[i++] = '.';
+    if (fDigitsInResult > 0) {
+        if (fractionalDigits < fDigitsInResult) {
+            strncpy(buf + i, result + 1, fractionalDigits);
+            i += fractionalDigits;
+        } else {
+            strcpy(buf + i, result + 1);
+            i += static_cast<int>(resultLength) - 1;
+        }
+    }
+
+    for (int j = 0; j < fractionalDigits - fDigitsInResult; j++)
+        buf[i++] = '0';
+}
+
+static void exponentialPartToString(char* buf, int& i, int decimalPoint)
+{
+    buf[i++] = 'e';
+    buf[i++] = (decimalPoint >= 0) ? '+' : '-';
+    // decimalPoint can't be more than 3 digits decimal given the
+    // nature of float representation
+    int exponential = decimalPoint - 1;
+    if (exponential < 0)
+        exponential *= -1;
+    if (exponential >= 100)
+        buf[i++] = static_cast<char>('0' + exponential / 100);
+    if (exponential >= 10)
+        buf[i++] = static_cast<char>('0' + (exponential % 100) / 10);
+    buf[i++] = static_cast<char>('0' + exponential % 10);
+}
+
+JSValue* numberProtoFuncToExponential(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+{
+    JSValue* v = thisValue->getJSNumber();
+    if (!v)
+        return throwError(exec, TypeError);
+
+    double x = v->uncheckedGetNumber();
+
+    if (isnan(x) || isinf(x))
+        return jsString(exec, UString::from(x));
+
+    JSValue* fractionalDigitsValue = args[0];
+    double df = fractionalDigitsValue->toInteger(exec);
+    if (!(df >= 0 && df <= 20))
+        return throwError(exec, RangeError, "toExponential() argument must between 0 and 20");
+    int fractionalDigits = (int)df;
+    bool includeAllDigits = fractionalDigitsValue->isUndefined();
+
+    int decimalAdjust = 0;
+    if (x && !includeAllDigits) {
+        double logx = floor(log10(fabs(x)));
+        x /= pow(10.0, logx);
+        const double tenToTheF = pow(10.0, fractionalDigits);
+        double fx = floor(x * tenToTheF) / tenToTheF;
+        double cx = ceil(x * tenToTheF) / tenToTheF;
+
+        if (fabs(fx - x) < fabs(cx - x))
+            x = fx;
+        else
+            x = cx;
+
+        decimalAdjust = static_cast<int>(logx);
+    }
+
+    if (isnan(x))
+        return jsString(exec, "NaN");
+
+    if (x == -0.0) // (-0.0).toExponential() should print as 0 instead of -0
+        x = 0;
+
+    int decimalPoint;
+    int sign;
+    char* result = dtoa(x, 0, &decimalPoint, &sign, NULL);
+    size_t resultLength = strlen(result);
+    decimalPoint += decimalAdjust;
+
+    int i = 0;
+    char buf[80]; // digit + '.' + fractionDigits (max 20) + 'e' + sign + exponent (max?)
+    if (sign)
+        buf[i++] = '-';
+
+    if (decimalPoint == 999) // ? 9999 is the magical "result is Inf or NaN" value.  what's 999??
+        strcpy(buf + i, result);
+    else {
+        buf[i++] = result[0];
+
+        if (includeAllDigits)
+            fractionalDigits = static_cast<int>(resultLength) - 1;
+
+        fractionalPartToString(buf, i, result, resultLength, fractionalDigits);
+        exponentialPartToString(buf, i, decimalPoint);
+        buf[i++] = '\0';
+    }
+    ASSERT(i <= 80);
+
+    freedtoa(result);
+
+    return jsString(exec, buf);
+}
+
+JSValue* numberProtoFuncToPrecision(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+{
+    JSValue* v = thisValue->getJSNumber();
+    if (!v)
+        return throwError(exec, TypeError);
+
+    double doublePrecision = args[0]->toIntegerPreserveNaN(exec);
+    double x = v->uncheckedGetNumber();
+    if (args[0]->isUndefined() || isnan(x) || isinf(x))
+        return jsString(exec, v->toString(exec));
+
+    UString s;
+    if (x < 0) {
+        s = "-";
+        x = -x;
+    }
+
+    if (!(doublePrecision >= 1 && doublePrecision <= 21)) // true for NaN
+        return throwError(exec, RangeError, "toPrecision() argument must be between 1 and 21");
+    int precision = (int)doublePrecision;
+
+    int e = 0;
+    UString m;
+    if (x) {
+        e = static_cast<int>(log10(x));
+        double tens = intPow10(e - precision + 1);
+        double n = floor(x / tens);
+        if (n < intPow10(precision - 1)) {
+            e = e - 1;
+            tens = intPow10(e - precision + 1);
+            n = floor(x / tens);
+        }
+
+        if (fabs((n + 1.0) * tens - x) <= fabs(n * tens - x))
+            ++n;
+        // maintain n < 10^(precision)
+        if (n >= intPow10(precision)) {
+            n /= 10.0;
+            e += 1;
+        }
+        ASSERT(intPow10(precision - 1) <= n);
+        ASSERT(n < intPow10(precision));
+
+        m = integer_part_noexp(n);
+        if (e < -6 || e >= precision) {
+            if (m.size() > 1)
+                m = m.substr(0, 1) + "." + m.substr(1);
+            if (e >= 0)
+                return jsString(exec, s + m + "e+" + UString::from(e));
+            return jsString(exec, s + m + "e-" + UString::from(-e));
+        }
+    } else {
+        m = char_sequence('0', precision);
+        e = 0;
+    }
+
+    if (e == precision - 1)
+        return jsString(exec, s + m);
+    if (e >= 0) {
+        if (e + 1 < m.size())
+            return jsString(exec, s + m.substr(0, e + 1) + "." + m.substr(e + 1));
+        return jsString(exec, s + m);
+    }
+    return jsString(exec, s + "0." + char_sequence('0', -(e + 1)) + m);
+}
+
+} // namespace KJS
diff --git a/JavaScriptCore/kjs/NumberPrototype.h b/JavaScriptCore/kjs/NumberPrototype.h
new file mode 100644 (file)
index 0000000..3432ff5
--- /dev/null
@@ -0,0 +1,42 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ *
+ *  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 NumberPrototype_h
+#define NumberPrototype_h
+
+#include "NumberObject.h"
+
+namespace KJS {
+
+    /**
+     * @internal
+     *
+     * The initial value of Number.prototype (and thus all objects created
+     * with the Number constructor
+     */
+    class NumberPrototype : public NumberObject {
+    public:
+        NumberPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
+    };
+
+} // namespace KJS
+
+#endif // NumberPrototype_h
diff --git a/JavaScriptCore/kjs/ObjectConstructor.cpp b/JavaScriptCore/kjs/ObjectConstructor.cpp
new file mode 100644 (file)
index 0000000..b336bad
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ *  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
+ *
+ */
+
+#include "config.h"
+#include "ObjectConstructor.h"
+
+#include "JSGlobalObject.h"
+#include "FunctionPrototype.h"
+
+namespace KJS {
+
+ObjectConstructor::ObjectConstructor(ExecState* exec, ObjectPrototype* objProto, FunctionPrototype* funcProto)
+  : InternalFunction(funcProto, Identifier(exec, "Object"))
+{
+  // ECMA 15.2.3.1
+  putDirect(exec->propertyNames().prototype, objProto, DontEnum|DontDelete|ReadOnly);
+
+  // no. of arguments for constructor
+  putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
+}
+
+// ECMA 15.2.2
+static ALWAYS_INLINE JSObject* constructObject(ExecState* exec, const ArgList& args)
+{
+    JSValue* arg = args[0];
+    if (arg->isUndefinedOrNull())
+        return new (exec) JSObject(exec->lexicalGlobalObject()->objectPrototype());
+    return arg->toObject(exec);
+}
+
+static JSObject* constructWithObjectConstructor(ExecState* exec, JSObject*, const ArgList& args)
+{
+    return constructObject(exec, args);
+}
+
+ConstructType ObjectConstructor::getConstructData(ConstructData& constructData)
+{
+    constructData.native.function = constructWithObjectConstructor;
+    return ConstructTypeNative;
+}
+
+static JSValue* callObjectConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+{
+    return constructObject(exec, args);
+}
+
+CallType ObjectConstructor::getCallData(CallData& callData)
+{
+    callData.native.function = callObjectConstructor;
+    return CallTypeNative;
+}
+
+} // namespace KJS
similarity index 75%
rename from JavaScriptCore/kjs/object_object.h
rename to JavaScriptCore/kjs/ObjectConstructor.h
index d5986ea..1832b1a 100644 (file)
  *
  */
 
-#ifndef _OBJECT_OBJECT_H_
-#define _OBJECT_OBJECT_H_
+#ifndef ObjectConstructor_h
+#define ObjectConstructor_h
 
 #include "JSFunction.h"
 
 namespace KJS {
 
-    /**
-     * @internal
-     *
-     * The initial value of Object.prototype (and thus all objects created
-     * with the Object constructor
-     */
-    class ObjectPrototype : public JSObject {
-    public:
-        ObjectPrototype(ExecState*, FunctionPrototype*);
-    };
-
-    JSValue* objectProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
+    class FunctionPrototype;
+    class ObjectPrototype;
 
     /**
      * @internal
@@ -53,4 +43,4 @@ namespace KJS {
 
 } // namespace KJS
 
-#endif // _OBJECT_OBJECT_H_
+#endif // ObjectConstructor_h
similarity index 80%
rename from JavaScriptCore/kjs/object_object.cpp
rename to JavaScriptCore/kjs/ObjectPrototype.cpp
index 22d7b9e..b8b6261 100644 (file)
  */
 
 #include "config.h"
-#include "object_object.h"
+#include "ObjectPrototype.h"
 
-#include "JSGlobalObject.h"
 #include "operations.h"
 #include "FunctionPrototype.h"
-#include <stdio.h>
 
 namespace KJS {
 
-// ------------------------------ ObjectPrototype --------------------------------
-
 static JSValue* objectProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
 static JSValue* objectProtoFuncHasOwnProperty(ExecState*, JSObject*, JSValue*, const ArgList&);
 static JSValue* objectProtoFuncIsPrototypeOf(ExecState*, JSObject*, JSValue*, const ArgList&);
@@ -133,47 +129,4 @@ JSValue* objectProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue,
     return jsString(exec, "[object " + thisValue->toThisObject(exec)->className() + "]");
 }
 
-// ------------------------------ ObjectConstructor --------------------------------
-
-ObjectConstructor::ObjectConstructor(ExecState* exec, ObjectPrototype* objProto, FunctionPrototype* funcProto)
-  : InternalFunction(funcProto, Identifier(exec, "Object"))
-{
-  // ECMA 15.2.3.1
-  putDirect(exec->propertyNames().prototype, objProto, DontEnum|DontDelete|ReadOnly);
-
-  // no. of arguments for constructor
-  putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
-}
-
-// ECMA 15.2.2
-static ALWAYS_INLINE JSObject* constructObject(ExecState* exec, const ArgList& args)
-{
-    JSValue* arg = args[0];
-    if (arg->isUndefinedOrNull())
-        return new (exec) JSObject(exec->lexicalGlobalObject()->objectPrototype());
-    return arg->toObject(exec);
-}
-
-static JSObject* constructWithObjectConstructor(ExecState* exec, JSObject*, const ArgList& args)
-{
-    return constructObject(exec, args);
-}
-
-ConstructType ObjectConstructor::getConstructData(ConstructData& constructData)
-{
-    constructData.native.function = constructWithObjectConstructor;
-    return ConstructTypeNative;
-}
-
-static JSValue* callObjectConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
-{
-    return constructObject(exec, args);
-}
-
-CallType ObjectConstructor::getCallData(CallData& callData)
-{
-    callData.native.function = callObjectConstructor;
-    return CallTypeNative;
-}
-
 } // namespace KJS
diff --git a/JavaScriptCore/kjs/ObjectPrototype.h b/JavaScriptCore/kjs/ObjectPrototype.h
new file mode 100644 (file)
index 0000000..44069f7
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ *  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 ObjectPrototype_h
+#define ObjectPrototype_h
+
+#include "JSObject.h"
+
+namespace KJS {
+
+    class FunctionPrototype;
+
+    /**
+     * @internal
+     *
+     * The initial value of Object.prototype (and thus all objects created
+     * with the Object constructor
+     */
+    class ObjectPrototype : public JSObject {
+    public:
+        ObjectPrototype(ExecState*, FunctionPrototype*);
+    };
+
+    JSValue* objectProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
+
+} // namespace KJS
+
+#endif // ObjectPrototype_h
index 764f567..25d1eb2 100644 (file)
 #ifndef RegExpObject_h
 #define RegExpObject_h
 
-#include "FunctionPrototype.h"
 #include "regexp.h"
 
 namespace KJS {
 
+    class FunctionPrototype;
     struct RegExpConstructorPrivate;
 
     class RegExpPrototype : public JSObject {
index 9ce8821..50244c6 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "config.h"
 
+#include "ObjectPrototype.h"
+#include "ObjectConstructor.h"
+
 #include "CodeGenerator.h"
 #include "InitializeThreading.h"
 #include "JSArray.h"
index 2607c68..00d75c9 100644 (file)
 #ifndef ERROR_OBJECT_H_
 #define ERROR_OBJECT_H_
 
-#include "FunctionPrototype.h"
+#include "JSFunction.h"
 
 namespace KJS {
 
+    class FunctionPrototype;
+
     class ErrorInstance : public JSObject {
     public:
         ErrorInstance(JSObject* prototype);
index 8163b11..01ac1e1 100644 (file)
 #include "JSString.h"
 
 #include "ExecState.h"
+#include "FunctionPrototype.h"
+#include "JSObject.h"
+#include "MathObject.h"
+#include "NumberObject.h"
+#include "RegExpObject.h"
 #include "collector.h"
 #include "date_object.h"
 #include "debugger.h"
 #include "error_object.h"
-#include "FunctionPrototype.h"
 #include "lexer.h"
-#include "MathObject.h"
 #include "nodes.h"
-#include "NumberObject.h"
-#include "JSObject.h"
-#include "object_object.h"
 #include "operations.h"
-#include "RegExpObject.h"
 #include "string_object.h"
 #include <math.h>
 #include <stdio.h>
index 37e0f11..349c01b 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "CodeGenerator.h"
 #include "ExecState.h"
-#include "FunctionPrototype.h"
 #include "JSGlobalObject.h"
 #include "Parser.h"
 #include "PropertyNameArray.h"
index 8dad490..b9ff652 100644 (file)
 #ifndef STRING_OBJECT_H_
 #define STRING_OBJECT_H_
 
-#include "FunctionPrototype.h"
 #include "JSWrapperObject.h"
 #include "JSString.h"
 #include "lookup.h"
 
 namespace KJS {
 
+  class FunctionPrototype;
+
   class StringObject : public JSWrapperObject {
   public:
     StringObject(ExecState*, JSObject* prototype);
index 614ead7..3800bca 100644 (file)
@@ -1,3 +1,17 @@
+2008-06-28  Sam Weinig  <sam@webkit.org>
+
+        Rubber-stamped by Oliver Hunt.
+
+        Update includes after remaming object_object.h to ObjectPrototype.h and
+        splitting FunctionConstructor out of FunctionPrototype.h
+
+        * ForwardingHeaders/kjs/FunctionConstructor.h: Added.
+        * ForwardingHeaders/kjs/ObjectPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/object_object.h.
+        * ForwardingHeaders/kjs/object_object.h: Removed.
+        * bindings/js/JSEventListener.cpp:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bridge/qt/qt_instance.cpp:
+
 2008-06-28  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/ForwardingHeaders/kjs/FunctionConstructor.h b/WebCore/ForwardingHeaders/kjs/FunctionConstructor.h
new file mode 100644 (file)
index 0000000..bc49dca
--- /dev/null
@@ -0,0 +1 @@
+#include <JavaScriptCore/FunctionConstructor.h>
diff --git a/WebCore/ForwardingHeaders/kjs/ObjectPrototype.h b/WebCore/ForwardingHeaders/kjs/ObjectPrototype.h
new file mode 100644 (file)
index 0000000..54e60b7
--- /dev/null
@@ -0,0 +1 @@
+#include <JavaScriptCore/ObjectPrototype.h>
diff --git a/WebCore/ForwardingHeaders/kjs/object_object.h b/WebCore/ForwardingHeaders/kjs/object_object.h
deleted file mode 100644 (file)
index 6a70f08..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <JavaScriptCore/object_object.h>
index d190149..f0526bb 100644 (file)
@@ -32,7 +32,7 @@
 #include "JSEvent.h"
 #include "JSEventTargetNode.h"
 #include "ScriptController.h"
-#include <kjs/FunctionPrototype.h>
+#include <kjs/FunctionConstructor.h>
 
 using namespace KJS;
 
index 818f6c4..48770a1 100644 (file)
@@ -356,7 +356,7 @@ sub GenerateHeader
     } else {
         push(@headerContentHeader, "#include \"JSDOMBinding.h\"\n");
         push(@headerContentHeader, "#include <kjs/JSGlobalObject.h>\n");
-        push(@headerContentHeader, "#include <kjs/object_object.h>\n");
+        push(@headerContentHeader, "#include <kjs/ObjectPrototype.h>\n");
     }
     if ($interfaceName eq "Node") {
         push(@headerContentHeader, "#include \"EventTargetNode.h\"\n");
index 6767365..2942b12 100644 (file)
@@ -26,7 +26,7 @@
 #include "qt_runtime.h"
 #include "PropertyNameArray.h"
 #include "runtime_object.h"
-#include "object_object.h"
+#include "ObjectPrototype.h"
 
 #include <qmetaobject.h>
 #include <qdebug.h>