Commit fee62a72 authored by weinig@apple.com's avatar weinig@apple.com

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

        Rubber-stamped by Cameron Zwarich.

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

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2e67c024
2008-06-29 Sam Weinig <sam@webkit.org>
Rubber-stamped by Cameron Zwarich.
Splits ErrorConstructor, ErrorPrototype, NativeErrorConstructor and
NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/ArrayConstructor.cpp:
* kjs/ArrayPrototype.cpp:
* kjs/BooleanPrototype.cpp:
* kjs/DatePrototype.cpp:
* kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
* kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
* kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
* kjs/ErrorInstance.h: Copied from kjs/error_object.h.
* kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
* kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
* kjs/JSGlobalObject.cpp:
* kjs/JSObject.cpp:
* kjs/JSValue.cpp:
* kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
* kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
* kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
* kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
* kjs/NumberPrototype.cpp:
* kjs/RegExpConstructor.cpp:
* kjs/RegExpObject.cpp:
* kjs/RegExpPrototype.cpp:
* kjs/StringPrototype.cpp:
* kjs/error_object.cpp: Removed.
* kjs/error_object.h: Removed.
* kjs/internal.cpp:
2008-06-29 Sam Weinig <sam@webkit.org>
Fix non-AllInOne build.
......@@ -96,7 +96,9 @@ javascriptcore_sources += \
JavaScriptCore/kjs/DatePrototype.cpp \
JavaScriptCore/kjs/debugger.cpp \
JavaScriptCore/kjs/dtoa.cpp \
JavaScriptCore/kjs/error_object.cpp \
JavaScriptCore/kjs/ErrorConstructor.cpp \
JavaScriptCore/kjs/ErrorInstance.cpp \
JavaScriptCore/kjs/ErrorPrototype.cpp \
JavaScriptCore/kjs/JSFunction.cpp \
JavaScriptCore/kjs/JSVariableObject.cpp \
JavaScriptCore/kjs/FunctionConstructor.cpp \
......@@ -110,6 +112,8 @@ javascriptcore_sources += \
JavaScriptCore/kjs/MathObject.cpp \
JavaScriptCore/kjs/nodes.cpp \
JavaScriptCore/kjs/nodes2string.cpp \
JavaScriptCore/kjs/NativeErrorConstructor.cpp \
JavaScriptCore/kjs/NativeErrorPrototype.cpp \
JavaScriptCore/kjs/NumberConstructor.cpp \
JavaScriptCore/kjs/NumberObject.cpp \
JavaScriptCore/kjs/NumberPrototype.cpp \
......
......@@ -81,7 +81,9 @@ SOURCES += \
kjs/DatePrototype.cpp \
kjs/DebuggerCallFrame.cpp \
kjs/dtoa.cpp \
kjs/error_object.cpp \
kjs/ErrorConstructor.cpp \
kjs/ErrorInstance.cpp \
kjs/ErrorPrototype.cpp \
kjs/ExecState.cpp \
kjs/FunctionConstructor.cpp \
kjs/FunctionPrototype.cpp \
......@@ -95,6 +97,8 @@ SOURCES += \
kjs/list.cpp \
kjs/lookup.cpp \
kjs/MathObject.cpp \
kjs/NativeErrorConstructor.cpp \
kjs/NativeErrorPrototype.cpp \
kjs/nodes.cpp \
kjs/nodes2string.cpp \
kjs/NumberConstructor.cpp \
......
......@@ -381,11 +381,27 @@
>
</File>
<File
RelativePath="..\..\kjs\error_object.cpp"
RelativePath="..\..\kjs\ErrorConstructor.cpp"
>
</File>
<File
RelativePath="..\..\kjs\error_object.h"
RelativePath="..\..\kjs\ErrorConstructor.h"
>
</File>
<File
RelativePath="..\..\kjs\ErrorInstance.cpp"
>
</File>
<File
RelativePath="..\..\kjs\ErrorInstance.h"
>
</File>
<File
RelativePath="..\..\kjs\ErrorPrototype.cpp"
>
</File>
<File
RelativePath="..\..\kjs\ErrorPrototype.h"
>
</File>
<File
......@@ -576,6 +592,22 @@
RelativePath="..\..\kjs\NodeInfo.h"
>
</File>
<File
RelativePath="..\..\kjs\NativeErrorConstructor.cpp"
>
</File>
<File
RelativePath="..\..\kjs\NativeErrorConstructor.h"
>
</File>
<File
RelativePath="..\..\kjs\NativeErrorPrototype.cpp"
>
</File>
<File
RelativePath="..\..\kjs\NativeErrorPrototype.h"
>
</File>
<File
RelativePath="..\..\kjs\NumberConstructor.cpp"
>
......
......@@ -95,6 +95,11 @@
A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; };
A7C31DAA0DBEBA4300FDF8EB /* SegmentedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C31DA80DBEBA4300FDF8EB /* SegmentedVector.h */; };
BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; };
BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; };
BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */; };
BC02E9130E1839DB000F9297 /* NativeErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */; };
BC02E98D0E183E38000F9297 /* ErrorInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E98B0E183E38000F9297 /* ErrorInstance.h */; };
BC18C3E40E16F5CD00B34460 /* AlwaysInline.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AA4F770957251F0084B3A7 /* AlwaysInline.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C3E50E16F5CD00B34460 /* APICast.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B78A0A4305AB00517CFC /* APICast.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C3E60E16F5CD00B34460 /* ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7952070E15E8A800A898AB /* ArrayConstructor.h */; };
......@@ -120,7 +125,6 @@
BC18C3FC0E16F5CD00B34460 /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = 5186111D0CC824830081412B /* Deque.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C3FD0E16F5CD00B34460 /* DisallowCType.h in Headers */ = {isa = PBXBuildFile; fileRef = 938C4F6B0CA06BCE00D9310A /* DisallowCType.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C3FE0E16F5CD00B34460 /* dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 651F6413039D5B5F0078395C /* dtoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C3FF0E16F5CD00B34460 /* error_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A85B0255597D01FF60F7 /* error_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4000E16F5CD00B34460 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
BC18C4010E16F5CD00B34460 /* ExecState.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BD53F30A3E12D800BAF59C /* ExecState.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4020E16F5CD00B34460 /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E217BA08E7EECC0023E5F6 /* FastMalloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -586,6 +590,16 @@
A7C31DA80DBEBA4300FDF8EB /* SegmentedVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SegmentedVector.h; path = VM/SegmentedVector.h; sourceTree = "<group>"; };
A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = "<group>"; };
A8E894330CD0603F00367179 /* JSGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObject.h; sourceTree = "<group>"; };
BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorConstructor.cpp; sourceTree = "<group>"; };
BC02E9050E1839DB000F9297 /* ErrorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorConstructor.h; sourceTree = "<group>"; };
BC02E9060E1839DB000F9297 /* ErrorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorPrototype.cpp; sourceTree = "<group>"; };
BC02E9070E1839DB000F9297 /* ErrorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorPrototype.h; sourceTree = "<group>"; };
BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeErrorConstructor.cpp; sourceTree = "<group>"; };
BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeErrorConstructor.h; sourceTree = "<group>"; };
BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeErrorPrototype.cpp; sourceTree = "<group>"; };
BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeErrorPrototype.h; sourceTree = "<group>"; };
BC02E98A0E183E38000F9297 /* ErrorInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorInstance.cpp; sourceTree = "<group>"; };
BC02E98B0E183E38000F9297 /* ErrorInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorInstance.h; sourceTree = "<group>"; };
BC18C3C00E16EE3300B34460 /* StringConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringConstructor.cpp; sourceTree = "<group>"; };
BC18C3C10E16EE3300B34460 /* StringConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringConstructor.h; sourceTree = "<group>"; };
BC18C3C20E16EE3300B34460 /* StringObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringObject.cpp; sourceTree = "<group>"; };
......@@ -665,8 +679,6 @@
F692A8560255597D01FF60F7 /* date_object.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = date_object.h; sourceTree = "<group>"; tabWidth = 8; };
F692A8580255597D01FF60F7 /* debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = debugger.cpp; path = kjs/debugger.cpp; sourceTree = "<group>"; tabWidth = 8; };
F692A8590255597D01FF60F7 /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = debugger.h; path = kjs/debugger.h; sourceTree = "<group>"; tabWidth = 8; };
F692A85A0255597D01FF60F7 /* error_object.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = error_object.cpp; sourceTree = "<group>"; tabWidth = 8; };
F692A85B0255597D01FF60F7 /* error_object.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = error_object.h; sourceTree = "<group>"; tabWidth = 8; };
F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionPrototype.cpp; sourceTree = "<group>"; tabWidth = 8; };
F692A85D0255597D01FF60F7 /* FunctionPrototype.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = FunctionPrototype.h; sourceTree = "<group>"; tabWidth = 8; };
F692A85E0255597D01FF60F7 /* JSFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFunction.cpp; sourceTree = "<group>"; tabWidth = 8; };
......@@ -1050,8 +1062,12 @@
D21202290AD4310C00ED79B6 /* DateMath.h */,
651F6412039D5B5F0078395C /* dtoa.cpp */,
651F6413039D5B5F0078395C /* dtoa.h */,
F692A85A0255597D01FF60F7 /* error_object.cpp */,
F692A85B0255597D01FF60F7 /* error_object.h */,
BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */,
BC02E9050E1839DB000F9297 /* ErrorConstructor.h */,
BC02E98A0E183E38000F9297 /* ErrorInstance.cpp */,
BC02E98B0E183E38000F9297 /* ErrorInstance.h */,
BC02E9060E1839DB000F9297 /* ErrorPrototype.cpp */,
BC02E9070E1839DB000F9297 /* ErrorPrototype.h */,
14BD53F40A3E12D800BAF59C /* ExecState.cpp */,
14BD53F30A3E12D800BAF59C /* ExecState.h */,
BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */,
......@@ -1100,6 +1116,10 @@
F692A8690255597D01FF60F7 /* lookup.h */,
F692A86A0255597D01FF60F7 /* MathObject.cpp */,
F692A86B0255597D01FF60F7 /* MathObject.h */,
BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */,
BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */,
BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */,
BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */,
BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */,
BC2680C30E16D4E900A06E92 /* NumberConstructor.h */,
F692A8700255597D01FF60F7 /* NumberObject.cpp */,
......@@ -1256,7 +1276,6 @@
BC18C3FC0E16F5CD00B34460 /* Deque.h in Headers */,
BC18C3FD0E16F5CD00B34460 /* DisallowCType.h in Headers */,
BC18C3FE0E16F5CD00B34460 /* dtoa.h in Headers */,
BC18C3FF0E16F5CD00B34460 /* error_object.h in Headers */,
BC18C4000E16F5CD00B34460 /* ExceptionHelpers.h in Headers */,
BC18C4010E16F5CD00B34460 /* ExecState.h in Headers */,
BC18C4020E16F5CD00B34460 /* FastMalloc.h in Headers */,
......@@ -1387,6 +1406,11 @@
BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
BCD2034C0E17135E002C7E82 /* DatePrototype.h in Headers */,
BCD203E80E1718F4002C7E82 /* DatePrototype.lut.h in Headers */,
BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */,
BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */,
BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */,
BC02E9130E1839DB000F9297 /* NativeErrorPrototype.h in Headers */,
BC02E98D0E183E38000F9297 /* ErrorInstance.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -58,7 +58,9 @@ Source files for JSCore.
kjs/debugger.cpp
kjs/DebuggerCallFrame.cpp
kjs/dtoa.cpp
kjs/error_object.cpp
kjs/ErrorConstructor.cpp
kjs/ErrorInstance.cpp
kjs/ErrorPrototype.cpp
kjs/ExecState.cpp
kjs/JSFunction.cpp
kjs/FunctionConstructor.cpp
......@@ -79,6 +81,8 @@ Source files for JSCore.
kjs/list.cpp
kjs/lookup.cpp
kjs/MathObject.cpp
kjs/NativeErrorConstructor.cpp
kjs/NativeErrorPrototype.cpp
kjs/nodes.cpp
kjs/nodes2string.cpp
kjs/NumberConstructor.cpp
......
......@@ -44,7 +44,9 @@
#include "DatePrototype.cpp"
#include "date_object.cpp"
#include "dtoa.cpp"
#include "error_object.cpp"
#include "ErrorInstance.cpp"
#include "ErrorPrototype.cpp"
#include "ErrorConstructor.cpp"
#include "FunctionConstructor.cpp"
#include "FunctionPrototype.cpp"
#include "grammar.cpp"
......@@ -58,11 +60,13 @@
#include "list.cpp"
#include "lookup.cpp"
#include "MathObject.cpp"
#include "nodes.cpp"
#include "nodes2string.cpp"
#include "NativeErrorConstructor.cpp"
#include "NativeErrorPrototype.cpp"
#include "NumberConstructor.cpp"
#include "NumberObject.cpp"
#include "NumberPrototype.cpp"
#include "nodes.cpp"
#include "nodes2string.cpp"
#include "JSObject.cpp"
#include "JSGlobalObject.cpp"
#include "ObjectConstructor.cpp"
......
......@@ -27,7 +27,6 @@
#include "ArrayPrototype.h"
#include "FunctionPrototype.h"
#include "JSArray.h"
#include "error_object.h"
#include "lookup.h"
namespace KJS {
......
......@@ -26,12 +26,10 @@
#include "Machine.h"
#include "ObjectPrototype.h"
#include "error_object.h"
#include "lookup.h"
#include "operations.h"
#include <wtf/Assertions.h>
#include <wtf/HashSet.h>
#include <algorithm> // for std::min
namespace KJS {
......
......@@ -23,7 +23,6 @@
#include "FunctionPrototype.h"
#include "ObjectPrototype.h"
#include "error_object.h"
namespace KJS {
......
......@@ -26,7 +26,6 @@
#include "JSString.h"
#include "ObjectPrototype.h"
#include "date_object.h"
#include "error_object.h"
#include <float.h>
#include <limits.h>
#include <locale.h>
......
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "config.h"
#include "ErrorConstructor.h"
#include "ErrorInstance.h"
#include "ErrorPrototype.h"
#include "FunctionPrototype.h"
#include "JSGlobalObject.h"
#include "JSString.h"
namespace KJS {
ErrorConstructor::ErrorConstructor(ExecState* exec, FunctionPrototype* funcProto, ErrorPrototype* errorProto)
: InternalFunction(funcProto, Identifier(exec, errorProto->classInfo()->className))
{
// ECMA 15.11.3.1 Error.prototype
putDirect(exec->propertyNames().prototype, errorProto, DontEnum|DontDelete|ReadOnly);
putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete|ReadOnly|DontEnum);
}
// ECMA 15.9.3
static ErrorInstance* constructError(ExecState* exec, const ArgList& args)
{
ErrorInstance* obj = new (exec) ErrorInstance(exec->lexicalGlobalObject()->errorPrototype());
if (!args[0]->isUndefined())
obj->putDirect(exec->propertyNames().message, jsString(exec, args[0]->toString(exec)));
return obj;
}
static JSObject* constructWithErrorConstructor(ExecState* exec, JSObject*, const ArgList& args)
{
return constructError(exec, args);
}
ConstructType ErrorConstructor::getConstructData(ConstructData& constructData)
{
constructData.native.function = constructWithErrorConstructor;
return ConstructTypeNative;
}
// ECMA 15.9.2
static JSValue* callErrorConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
{
// "Error()" gives the sames result as "new Error()"
return constructError(exec, args);
}
CallType ErrorConstructor::getCallData(CallData& callData)
{
callData.native.function = callErrorConstructor;
return CallTypeNative;
}
} // namespace KJS
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef ErrorConstructor_h
#define ErrorConstructor_h
#include "JSFunction.h"
namespace KJS {
class ErrorPrototype;
class FunctionPrototype;
class ErrorConstructor : public InternalFunction {
public:
ErrorConstructor(ExecState*, FunctionPrototype*, ErrorPrototype*);
private:
virtual ConstructType getConstructData(ConstructData&);
virtual CallType getCallData(CallData&);
};
} // namespace KJS
#endif // ErrorConstructor_h
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "config.h"
#include "ErrorInstance.h"
namespace KJS {
const ClassInfo ErrorInstance::info = { "Error", 0, 0, 0 };
ErrorInstance::ErrorInstance(JSObject* prototype)
: JSObject(prototype)
{
}
} // namespace KJS
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef ErrorInstance_h
#define ErrorInstance_h
#include "JSObject.h"
namespace KJS {
class ErrorInstance : public JSObject {
public:
ErrorInstance(JSObject* prototype);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
};
} // namespace KJS
#endif // ErrorInstance_h
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "config.h"
#include "ErrorPrototype.h"
#include "FunctionPrototype.h"
#include "ObjectPrototype.h"
#include "ustring.h"
namespace KJS {
static JSValue* errorProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
// ECMA 15.9.4
ErrorPrototype::ErrorPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)
: ErrorInstance(objectPrototype)
{
// The constructor will be added later in ErrorConstructor's constructor
putDirect(exec->propertyNames().name, jsString(exec, "Error"), DontEnum);
putDirect(exec->propertyNames().message, jsString(exec, "Unknown error"), DontEnum);
putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum);
}
JSValue* errorProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
{
JSObject* thisObj = thisValue->toThisObject(exec);
UString s = "Error";
JSValue* v = thisObj->get(exec, exec->propertyNames().name);
if (!v->isUndefined())
s = v->toString(exec);
v = thisObj->get(exec, exec->propertyNames().message);
if (!v->isUndefined()) {
// Mozilla-compatible format.
s += ": ";
s += v->toString(exec);
}
return jsString(exec, s);
}
} // namespace KJS
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef ErrorPrototype_h
#define ErrorPrototype_h
#include "ErrorInstance.h"
namespace KJS {
class FunctionPrototype;
class ObjectPrototype;
class ErrorPrototype : public ErrorInstance {
public:
ErrorPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
};
} // namespace KJS
#endif // ErrorPrototype_h
......@@ -37,10 +37,14 @@
#include "CodeBlock.h"
#include "DateConstructor.h"
#include "DatePrototype.h"
#include "ErrorConstructor.h"
#include "ErrorPrototype.h"
#include "FunctionConstructor.h"
#include "FunctionPrototype.h"
#include "Machine.h"
#include "MathObject.h"
#include "NativeErrorConstructor.h"
#include "NativeErrorPrototype.h"
#include "NumberConstructor.h"
#include "NumberPrototype.h"
#include "ObjectConstructor.h"
......@@ -51,7 +55,6 @@
#include "StringConstructor.h"
#include "StringPrototype.h"
#include "debugger.h"
#include "error_object.h"
namespace KJS {
......
......@@ -26,10 +26,10 @@
#include "JSObject.h"
#include "DatePrototype.h"
#include "ErrorConstructor.h"
#include "JSGlobalObject.h"
#include "ObjectPrototype.h"
#include "PropertyNameArray.h"
#include "error_object.h"
#include "lookup.h"
#include "nodes.h"
#include "operations.h"
......
......@@ -23,7 +23,6 @@
#include "config.h"
#include "JSValue.h"
#include "error_object.h"
#include "nodes.h"
#include <stdio.h>
#include <string.h>
......