[webkit-changes] cvs commit: JavaScriptCore/kjs error_object.cpp
function_object.cpp internal.cpp internal.h object.h
Darin
darin at opensource.apple.com
Sun Aug 14 09:04:20 PDT 2005
darin 05/08/14 09:04:20
Modified: . ChangeLog Makefile.am
kjs error_object.cpp function_object.cpp internal.cpp
internal.h object.h
Log:
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
* kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
straightforward way. The old code set the proto to 0 and then to the correct value.
This showed up as a "false positive" when searching for places that set prototype
to NULL/0 so I fixed it.
* kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
* kjs/internal.h: Added a default constructor for InternalFunctionImp.
* kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
default constructor (empty body, just calls base class's default constructor).
* kjs/object.h:
(KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
in Development builds.
(KJS::ObjectImp::setPrototype): Ditto.
Revision Changes Path
1.792 +22 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.791
retrieving revision 1.792
diff -u -r1.791 -r1.792
--- ChangeLog 12 Aug 2005 23:20:47 -0000 1.791
+++ ChangeLog 14 Aug 2005 16:04:18 -0000 1.792
@@ -1,3 +1,25 @@
+2005-08-14 Darin Adler <darin at apple.com>
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
+ REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
+
+ * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
+ straightforward way. The old code set the proto to 0 and then to the correct value.
+ This showed up as a "false positive" when searching for places that set prototype
+ to NULL/0 so I fixed it.
+
+ * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
+ not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
+
+ * kjs/internal.h: Added a default constructor for InternalFunctionImp.
+ * kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
+ default constructor (empty body, just calls base class's default constructor).
+
+ * kjs/object.h:
+ (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
+ in Development builds.
+ (KJS::ObjectImp::setPrototype): Ditto.
+
2005-08-12 Maciej Stachowiak <mjs at apple.com>
Reviewed by John.
1.35 +3 -1 JavaScriptCore/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /cvs/root/JavaScriptCore/Makefile.am,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- Makefile.am 26 Jul 2005 17:28:58 -0000 1.34
+++ Makefile.am 14 Aug 2005 16:04:18 -0000 1.35
@@ -1,8 +1,10 @@
all-am:
defaults write com.apple.Xcode PBXProductDirectory "$(SYMROOTS)"
defaults write com.apple.Xcode PBXIntermediatesDirectory "$(SYMROOTS)"
+ ../WebKitTools/Scripts/set-webkit-configuration --$(BUILDSTYLE)
xcodebuild -target All -configuration $(BUILDSTYLE)
clean-am:
defaults write com.apple.Xcode PBXProductDirectory "$(SYMROOTS)"
defaults write com.apple.Xcode PBXIntermediatesDirectory "$(SYMROOTS)"
- xcodebuild -target All clean -configuration ${BUILDSTYLE}
+ ../WebKitTools/Scripts/set-webkit-configuration --$(BUILDSTYLE)
+ xcodebuild -target All clean -configuration $(BUILDSTYLE)
1.18 +1 -3 JavaScriptCore/kjs/error_object.cpp
Index: error_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/error_object.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- error_object.cpp 8 Aug 2005 04:07:28 -0000 1.17
+++ error_object.cpp 14 Aug 2005 16:04:19 -0000 1.18
@@ -145,10 +145,8 @@
NativeErrorImp::NativeErrorImp(ExecState *exec, FunctionPrototypeImp *funcProto,
ObjectImp *prot)
- : InternalFunctionImp(funcProto), proto(0)
+ : InternalFunctionImp(funcProto), proto(prot)
{
- proto = static_cast<ObjectImp*>(prot);
-
putDirect(lengthPropertyName, jsOne(), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
putDirect(prototypePropertyName, proto, DontDelete|ReadOnly|DontEnum);
}
1.28 +0 -1 JavaScriptCore/kjs/function_object.cpp
Index: function_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function_object.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- function_object.cpp 8 Aug 2005 04:07:28 -0000 1.27
+++ function_object.cpp 14 Aug 2005 16:04:19 -0000 1.28
@@ -38,7 +38,6 @@
// ------------------------------ FunctionPrototypeImp -------------------------
FunctionPrototypeImp::FunctionPrototypeImp(ExecState *exec)
- : InternalFunctionImp(0)
{
putDirect(lengthPropertyName, jsZero(), DontDelete|ReadOnly|DontEnum);
putDirect(toStringPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::ToString, 0), DontEnum);
1.62 +4 -0 JavaScriptCore/kjs/internal.cpp
Index: internal.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/internal.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- internal.cpp 8 Aug 2005 04:07:28 -0000 1.61
+++ internal.cpp 14 Aug 2005 16:04:19 -0000 1.62
@@ -857,6 +857,10 @@
const ClassInfo InternalFunctionImp::info = {"Function", 0, 0, 0};
+InternalFunctionImp::InternalFunctionImp()
+{
+}
+
InternalFunctionImp::InternalFunctionImp(FunctionPrototypeImp *funcProto)
: ObjectImp(funcProto)
{
1.33 +1 -0 JavaScriptCore/kjs/internal.h
Index: internal.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/internal.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- internal.h 8 Aug 2005 04:07:28 -0000 1.32
+++ internal.h 14 Aug 2005 16:04:19 -0000 1.33
@@ -392,6 +392,7 @@
class InternalFunctionImp : public ObjectImp {
public:
+ InternalFunctionImp();
InternalFunctionImp(FunctionPrototypeImp *funcProto);
bool implementsHasInstance() const;
bool hasInstance(ExecState *exec, ValueImp *value);
1.43 +2 -0 JavaScriptCore/kjs/object.h
Index: object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- object.h 12 Aug 2005 07:36:00 -0000 1.42
+++ object.h 14 Aug 2005 16:04:19 -0000 1.43
@@ -622,6 +622,7 @@
inline ObjectImp::ObjectImp(ObjectImp *proto)
: _proto(proto), _internalValue(0)
{
+ assert(proto);
}
inline ObjectImp::ObjectImp()
@@ -646,6 +647,7 @@
inline void ObjectImp::setPrototype(ValueImp *proto)
{
+ assert(proto);
_proto = proto;
}
More information about the webkit-changes
mailing list