[webkit-changes] cvs commit: JavaScriptCore/kjs array_instance.h
array_object.cpp function.cpp function.h object.cpp object.h
object_object.cpp object_object.h string_object.cpp string_object.h
Adele
adele at opensource.apple.com
Tue Aug 2 14:26:22 PDT 2005
adele 05/08/02 14:26:21
Modified: . Tag: Safari-2-0-branch ChangeLog
khtml/ecma Tag: Safari-2-0-branch kjs_binding.h kjs_css.cpp
kjs_css.h kjs_dom.cpp kjs_dom.h kjs_html.cpp
kjs_html.h kjs_window.cpp kjs_window.h
. Tag: Safari-2-0-branch ChangeLog
bindings Tag: Safari-2-0-branch runtime_array.cpp
runtime_array.h runtime_object.cpp runtime_object.h
bindings/objc Tag: Safari-2-0-branch objc_runtime.h
objc_runtime.mm
kjs Tag: Safari-2-0-branch array_instance.h
array_object.cpp function.cpp function.h object.cpp
object.h object_object.cpp object_object.h
string_object.cpp string_object.h
Log:
JavaScriptCore:
Merged from TOT to Safari-2-0-branch.
2005-07-27 Maciej Stachowiak <mjs at apple.com>
Changes by Michael Kahl, reviewed by me.
- fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
* JavaScriptCore.xcodeproj/project.pbxproj:
* kjs/debugger.cpp:
(KJS::AttachedInterpreter::AttachedInterpreter):
(KJS::AttachedInterpreter::~AttachedInterpreter):
(Debugger::~Debugger):
(Debugger::attach):
(Debugger::detach):
(Debugger::sourceParsed):
* kjs/debugger.h:
* kjs/function.cpp:
(KJS::FunctionImp::call):
(KJS::GlobalFuncImp::call):
* kjs/function_object.cpp:
(FunctionObjectImp::construct):
* kjs/grammar.y:
* kjs/internal.cpp:
(Parser::parse):
(InterpreterImp::evaluate):
* kjs/internal.h:
(KJS::InterpreterImp::setDebugger):
* kjs/interpreter.cpp:
* kjs/interpreter.h:
(KJS::Interpreter::imp):
* kjs/nodes.cpp:
WebCore:
Merged fix from TOT to Safari-2-0-branch
2005-07-03 Maciej Stachowiak <mjs at apple.com>
Original patch from Mark Rowe <opendarwin.org at bdash.net.nz>, reviewed by me.
Fixes to patch by me, reviewed by John Sullivan.
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
Test cases added:
* layout-tests/fast/js/has-own-property.html: Added - tests this change.
* layout-tests/fast/js/eval-var-decl.html: Added - test depends on this change.
* khtml/ecma/kjs_css.cpp:
(KJS::DOMCSSStyleDeclaration::hasOwnProperty):
* khtml/ecma/kjs_css.h:
* khtml/ecma/kjs_dom.cpp:
(KJS::DOMNodeList::hasOwnProperty):
(KJS::DOMElement::tryGet):
(KJS::DOMNamedNodeMap::hasOwnProperty):
* khtml/ecma/kjs_dom.h:
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLDocument::hasOwnProperty):
(KJS::HTMLDocument::tryGet):
(KJS::KJS::HTMLElement::hasOwnProperty):
(KJS::KJS::HTMLCollection::hasOwnProperty):
* khtml/ecma/kjs_html.h:
* khtml/ecma/kjs_window.cpp:
(KJS::Window::hasOwnProperty):
(KJS::Konqueror::hasOwnProperty):
* khtml/ecma/kjs_window.h:
Revision Changes Path
No revision
No revision
1.4104.2.81 +35 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4104.2.80
retrieving revision 1.4104.2.81
diff -u -r1.4104.2.80 -r1.4104.2.81
--- ChangeLog 2 Aug 2005 16:52:20 -0000 1.4104.2.80
+++ ChangeLog 2 Aug 2005 21:26:03 -0000 1.4104.2.81
@@ -2,6 +2,41 @@
Merged fix from TOT to Safari-2-0-branch
+ 2005-07-03 Maciej Stachowiak <mjs at apple.com>
+
+ Original patch from Mark Rowe <opendarwin.org at bdash.net.nz>, reviewed by me.
+ Fixes to patch by me, reviewed by John Sullivan.
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
+
+ Test cases added:
+ * layout-tests/fast/js/has-own-property.html: Added - tests this change.
+ * layout-tests/fast/js/eval-var-decl.html: Added - test depends on this change.
+
+ * khtml/ecma/kjs_css.cpp:
+ (KJS::DOMCSSStyleDeclaration::hasOwnProperty):
+ * khtml/ecma/kjs_css.h:
+ * khtml/ecma/kjs_dom.cpp:
+ (KJS::DOMNodeList::hasOwnProperty):
+ (KJS::DOMElement::tryGet):
+ (KJS::DOMNamedNodeMap::hasOwnProperty):
+ * khtml/ecma/kjs_dom.h:
+ * khtml/ecma/kjs_html.cpp:
+ (KJS::HTMLDocument::hasOwnProperty):
+ (KJS::HTMLDocument::tryGet):
+ (KJS::KJS::HTMLElement::hasOwnProperty):
+ (KJS::KJS::HTMLCollection::hasOwnProperty):
+ * khtml/ecma/kjs_html.h:
+ * khtml/ecma/kjs_window.cpp:
+ (KJS::Window::hasOwnProperty):
+ (KJS::Konqueror::hasOwnProperty):
+ * khtml/ecma/kjs_window.h:
+
+
+2005-08-02 Adele Peterson <adele at apple.com>
+
+ Merged fix from TOT to Safari-2-0-branch
+
2005-07-08 Vicki Murley <vicki at apple.com>
- fixed by Trey Matteson <trey at usa.net>, reviewed by Maciej.
No revision
No revision
1.22.8.3 +6 -6 WebCore/khtml/ecma/kjs_binding.h
Index: kjs_binding.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_binding.h,v
retrieving revision 1.22.8.2
retrieving revision 1.22.8.3
diff -u -r1.22.8.2 -r1.22.8.3
--- kjs_binding.h 31 May 2005 19:37:41 -0000 1.22.8.2
+++ kjs_binding.h 2 Aug 2005 21:26:14 -0000 1.22.8.3
@@ -301,7 +301,7 @@
virtual const ClassInfo *classInfo() const { return &info; } \
static const ClassInfo info; \
Value get(ExecState *exec, const Identifier &propertyName) const; \
- bool hasProperty(ExecState *exec, const Identifier &propertyName) const; \
+ bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const; \
}; \
const ClassInfo ClassProto::info = { ClassName, 0, &ClassProto##Table, 0 }; \
};
@@ -312,9 +312,9 @@
/*fprintf( stderr, "%sProto::get(%s) [in macro, no parent]\n", info.className, propertyName.ascii());*/ \
return lookupGetFunction<ClassFunc,ObjectImp>(exec, propertyName, &ClassProto##Table, this ); \
} \
- bool KJS::ClassProto::hasProperty(ExecState *exec, const Identifier &propertyName) const \
+ bool ClassProto::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const \
{ /*stupid but we need this to have a common macro for the declaration*/ \
- return ObjectImp::hasProperty(exec, propertyName); \
+ return ObjectImp::hasOwnProperty(exec, propertyName); \
}
#define IMPLEMENT_PROTOTYPE_WITH_PARENT(ClassProto,ClassFunc,ParentProto) \
@@ -326,11 +326,11 @@
/* Not found -> forward request to "parent" prototype */ \
return ParentProto::self(exec).get( exec, propertyName ); \
} \
- bool KJS::ClassProto::hasProperty(ExecState *exec, const Identifier &propertyName) const \
+ bool ClassProto::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const \
{ \
- if (ObjectImp::hasProperty(exec, propertyName)) \
+ if (ObjectImp::hasOwnProperty(exec, propertyName)) \
return true; \
- return ParentProto::self(exec).hasProperty(exec, propertyName); \
+ return ParentProto::self(exec)->hasOwnProperty(exec, propertyName); \
}
#define IMPLEMENT_PROTOFUNC(ClassFunc) \
1.19.16.3 +2 -2 WebCore/khtml/ecma/kjs_css.cpp
Index: kjs_css.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_css.cpp,v
retrieving revision 1.19.16.2
retrieving revision 1.19.16.3
diff -u -r1.19.16.2 -r1.19.16.3
--- kjs_css.cpp 22 Jul 2005 01:18:29 -0000 1.19.16.2
+++ kjs_css.cpp 2 Aug 2005 21:26:14 -0000 1.19.16.3
@@ -96,7 +96,7 @@
ScriptInterpreter::forgetDOMObject(styleDecl.handle());
}
-bool DOMCSSStyleDeclaration::hasProperty(ExecState *exec, const Identifier &p) const
+bool DOMCSSStyleDeclaration::hasOwnProperty(ExecState *exec, const Identifier &p) const
{
if (p == "cssText")
return true;
@@ -105,7 +105,7 @@
if (DOM::getPropertyID(prop.ascii(), prop.length()))
return true;
- return ObjectImp::hasProperty(exec, p);
+ return ObjectImp::hasOwnProperty(exec, p);
}
Value DOMCSSStyleDeclaration::tryGet(ExecState *exec, const Identifier &propertyName) const
1.10.16.2 +1 -1 WebCore/khtml/ecma/kjs_css.h
Index: kjs_css.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_css.h,v
retrieving revision 1.10.16.1
retrieving revision 1.10.16.2
diff -u -r1.10.16.1 -r1.10.16.2
--- kjs_css.h 24 May 2005 17:06:41 -0000 1.10.16.1
+++ kjs_css.h 2 Aug 2005 21:26:14 -0000 1.10.16.2
@@ -39,7 +39,7 @@
virtual ~DOMCSSStyleDeclaration();
virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
enum { CssText, Length, ParentRule,
1.66.6.9 +6 -5 WebCore/khtml/ecma/kjs_dom.cpp
Index: kjs_dom.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.cpp,v
retrieving revision 1.66.6.8
retrieving revision 1.66.6.9
diff -u -r1.66.6.8 -r1.66.6.9
--- kjs_dom.cpp 22 Jul 2005 01:18:29 -0000 1.66.6.8
+++ kjs_dom.cpp 2 Aug 2005 21:26:14 -0000 1.66.6.9
@@ -695,11 +695,11 @@
// We have to implement hasProperty since we don't use a hashtable for 'length' and 'item'
// ## this breaks "for (..in..)" though.
-bool DOMNodeList::hasProperty(ExecState *exec, const Identifier &p) const
+bool DOMNodeList::hasOwnProperty(ExecState *exec, const Identifier &p) const
{
if (p == lengthPropertyName || p == "item")
return true;
- return ObjectImp::hasProperty(exec, p);
+ return ObjectImp::hasOwnProperty(exec, p);
}
Value DOMNodeList::tryGet(ExecState *exec, const Identifier &p) const
@@ -1158,7 +1158,8 @@
// We have to check in DOMNode before giving access to attributes, otherwise
// onload="..." would make onload return the string (attribute value) instead of
// the listener object (function).
- if (DOMNode::hasProperty(exec, propertyName))
+ ValueImp *proto = prototype().imp();
+ if (DOMNode::hasOwnProperty(exec, propertyName) || (proto->dispatchType() == ObjectType && static_cast<ObjectImp *>(proto)->hasProperty(exec, propertyName)))
return DOMNode::tryGet(exec, propertyName);
DOM::DOMString attr = element.getAttribute( propertyName.string() );
@@ -1376,11 +1377,11 @@
// We have to implement hasProperty since we don't use a hashtable for 'length'
// ## this breaks "for (..in..)" though.
-bool DOMNamedNodeMap::hasProperty(ExecState *exec, const Identifier &p) const
+bool DOMNamedNodeMap::hasOwnProperty(ExecState *exec, const Identifier &p) const
{
if (p == lengthPropertyName)
return true;
- return DOMObject::hasProperty(exec, p);
+ return DOMObject::hasOwnProperty(exec, p);
}
Value DOMNamedNodeMap::tryGet(ExecState* exec, const Identifier &p) const
1.34.6.5 +2 -2 WebCore/khtml/ecma/kjs_dom.h
Index: kjs_dom.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.h,v
retrieving revision 1.34.6.4
retrieving revision 1.34.6.5
diff -u -r1.34.6.4 -r1.34.6.5
--- kjs_dom.h 1 Jul 2005 22:36:03 -0000 1.34.6.4
+++ kjs_dom.h 2 Aug 2005 21:26:14 -0000 1.34.6.5
@@ -79,7 +79,7 @@
public:
DOMNodeList(ExecState *, const DOM::NodeList &l) : list(l) { }
~DOMNodeList();
- virtual bool hasProperty(ExecState *exec, const Identifier &p) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &p) const;
virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
virtual Value call(ExecState *exec, Object &thisObj, const List&args);
virtual Value tryCall(ExecState *exec, Object &thisObj, const List&args);
@@ -193,7 +193,7 @@
public:
DOMNamedNodeMap(ExecState *, const DOM::NamedNodeMap &m);
~DOMNamedNodeMap();
- virtual bool hasProperty(ExecState *exec, const Identifier &p) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &p) const;
virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
1.108.6.6 +8 -8 WebCore/khtml/ecma/kjs_html.cpp
Index: kjs_html.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.cpp,v
retrieving revision 1.108.6.5
retrieving revision 1.108.6.6
diff -u -r1.108.6.5 -r1.108.6.6
--- kjs_html.cpp 27 Jul 2005 21:08:17 -0000 1.108.6.5
+++ kjs_html.cpp 2 Aug 2005 21:26:14 -0000 1.108.6.6
@@ -187,15 +187,14 @@
# ids
@end
*/
-bool KJS::HTMLDocument::hasProperty(ExecState *exec, const Identifier &p) const
+bool HTMLDocument::hasOwnProperty(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
//kdDebug(6070) << "KJS::HTMLDocument::hasProperty " << p.qstring() << endl;
#endif
DOM::HTMLDocumentImpl *docImpl = static_cast<DOM::HTMLDocumentImpl *>(node.handle());
- return (DOMDocument::hasProperty(exec, p) ||
- docImpl->haveNamedImageOrForm(p.qstring()));
+ return DOMDocument::hasOwnProperty(exec, p) || docImpl->haveNamedImageOrForm(p.qstring());
}
Value KJS::HTMLDocument::tryGet(ExecState *exec, const Identifier &propertyName) const
@@ -305,7 +304,8 @@
}
}
- if (DOMDocument::hasProperty(exec, propertyName))
+ ValueImp *proto = prototype().imp();
+ if (DOMDocument::hasOwnProperty(exec, propertyName) || (proto->dispatchType() == ObjectType && static_cast<ObjectImp *>(proto)->hasProperty(exec, propertyName)))
return DOMDocument::tryGet(exec, propertyName);
//kdDebug(6070) << "KJS::HTMLDocument::tryGet " << propertyName.qstring() << " not found, returning element" << endl;
@@ -1978,7 +1978,7 @@
return Undefined();
}
-bool KJS::HTMLElement::hasProperty(ExecState *exec, const Identifier &propertyName) const
+bool KJS::HTMLElement::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
//kdDebug(6070) << "HTMLElement::hasProperty " << propertyName.qstring() << endl;
@@ -2008,7 +2008,7 @@
break;
}
- return DOMElement::hasProperty(exec, propertyName);
+ return DOMElement::hasOwnProperty(exec, propertyName);
}
UString KJS::HTMLElement::toString(ExecState *exec) const
@@ -3078,11 +3078,11 @@
// We have to implement hasProperty since we don't use a hashtable for 'selectedIndex' and 'length'
// ## this breaks "for (..in..)" though.
-bool KJS::HTMLCollection::hasProperty(ExecState *exec, const Identifier &p) const
+bool KJS::HTMLCollection::hasOwnProperty(ExecState *exec, const Identifier &p) const
{
if (p == "selectedIndex" || p == lengthPropertyName)
return true;
- return DOMObject::hasProperty(exec, p);
+ return DOMObject::hasOwnProperty(exec, p);
}
Value KJS::HTMLCollection::tryGet(ExecState *exec, const Identifier &propertyName) const
1.41.6.2 +3 -3 WebCore/khtml/ecma/kjs_html.h
Index: kjs_html.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.h,v
retrieving revision 1.41.6.1
retrieving revision 1.41.6.2
diff -u -r1.41.6.1 -r1.41.6.2
--- kjs_html.h 12 Jul 2005 00:45:43 -0000 1.41.6.1
+++ kjs_html.h 2 Aug 2005 21:26:15 -0000 1.41.6.2
@@ -47,7 +47,7 @@
virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Title, Referrer, Domain, URL, Body, Location, Cookie,
@@ -64,7 +64,7 @@
Value getValueProperty(ExecState *exec, int token) const;
virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
void putValue(ExecState *exec, int token, const Value& value, int);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual UString toString(ExecState *exec) const;
virtual void pushEventHandlerScope(ExecState *exec, ScopeChain &scope) const;
virtual const ClassInfo* classInfo() const;
@@ -181,7 +181,7 @@
virtual Value tryCall(ExecState *exec, Object &thisObj, const List&args);
virtual bool implementsCall() const { return true; }
virtual bool toBoolean(ExecState *) const { return true; }
- virtual bool hasProperty(ExecState *exec, const Identifier &p) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &p) const;
enum { Item, NamedItem, Tags };
Value getNamedItems(ExecState *exec, const Identifier &propertyName) const;
virtual const ClassInfo* classInfo() const { return &info; }
1.146.8.9 +2 -2 WebCore/khtml/ecma/kjs_window.cpp
Index: kjs_window.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.cpp,v
retrieving revision 1.146.8.8
retrieving revision 1.146.8.9
diff -u -r1.146.8.8 -r1.146.8.9
--- kjs_window.cpp 12 Jul 2005 22:19:20 -0000 1.146.8.8
+++ kjs_window.cpp 2 Aug 2005 21:26:15 -0000 1.146.8.9
@@ -1109,7 +1109,7 @@
return Undefined();
}
-bool Window::hasProperty(ExecState *exec, const Identifier &p) const
+bool Window::hasOwnProperty(ExecState *exec, const Identifier &p) const
{
// matches logic in get function above, but no need to handle numeric values (frame indices)
@@ -2902,7 +2902,7 @@
const ClassInfo Konqueror::info = { "Konqueror", 0, 0, 0 };
-bool Konqueror::hasProperty(ExecState *exec, const Identifier &p) const
+bool Konqueror::hasOwnProperty(ExecState *exec, const Identifier &p) const
{
if ( p.qstring().startsWith( "goHistory" ) ) return false;
1.34.8.6 +2 -2 WebCore/khtml/ecma/kjs_window.h
Index: kjs_window.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.h,v
retrieving revision 1.34.8.5
retrieving revision 1.34.8.6
diff -u -r1.34.8.5 -r1.34.8.6
--- kjs_window.h 12 Jul 2005 22:00:01 -0000 1.34.8.5
+++ kjs_window.h 2 Aug 2005 21:26:15 -0000 1.34.8.6
@@ -89,7 +89,7 @@
QGuardedPtr<KHTMLPart> part() const { return m_part; }
virtual void mark();
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
virtual bool toBoolean(ExecState *exec) const;
int installTimeout(const UString &handler, int t, bool singleShot);
@@ -274,7 +274,7 @@
public:
Konqueror(KHTMLPart *p) : part(p) { }
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
- virtual bool hasProperty(ExecState *exec, const Identifier &p) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &p) const;
virtual UString toString(ExecState *exec) const;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
No revision
No revision
1.677.6.14 +44 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.677.6.13
retrieving revision 1.677.6.14
diff -u -r1.677.6.13 -r1.677.6.14
--- ChangeLog 2 Aug 2005 20:39:09 -0000 1.677.6.13
+++ ChangeLog 2 Aug 2005 21:26:17 -0000 1.677.6.14
@@ -34,6 +34,50 @@
2005-08-02 Adele Peterson <adele at apple.com>
+ Merged fix from TOT to Safari-2-0-branch
+
+ 2005-06-20 Maciej Stachowiak <mjs at apple.com>
+
+ Patch from Mark Rowe <opendarwin.org at bdash.net.nz>, reviewed by me.
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
+
+ Test cases added:
+ * tests/mozilla/expected.html: Updated for two fixed tests.
+ - also added a layout test
+
+ * bindings/objc/objc_runtime.h:
+ * bindings/objc/objc_runtime.mm:
+ (ObjcFallbackObjectImp::hasOwnProperty):
+ * bindings/runtime_array.cpp:
+ (RuntimeArrayImp::hasOwnProperty):
+ * bindings/runtime_array.h:
+ * bindings/runtime_object.cpp:
+ (RuntimeObjectImp::hasOwnProperty):
+ * bindings/runtime_object.h:
+ * kjs/array_instance.h:
+ * kjs/array_object.cpp:
+ (ArrayInstanceImp::hasOwnProperty):
+ * kjs/function.cpp:
+ (KJS::FunctionImp::hasOwnProperty):
+ (KJS::ActivationImp::hasOwnProperty):
+ * kjs/function.h:
+ * kjs/object.cpp:
+ (KJS::ObjectImp::hasProperty):
+ (KJS::ObjectImp::hasOwnProperty):
+ * kjs/object.h:
+ (KJS::Object::hasOwnProperty):
+ * kjs/object_object.cpp:
+ (ObjectPrototypeImp::ObjectPrototypeImp):
+ (ObjectProtoFuncImp::call):
+ * kjs/object_object.h:
+ (KJS::ObjectProtoFuncImp::):
+ * kjs/string_object.cpp:
+ (StringInstanceImp::hasOwnProperty):
+ * kjs/string_object.h:
+
+2005-08-02 Adele Peterson <adele at apple.com>
+
Merged from TOT to Safari-2-0-branch.
2005-06-30 Kevin Decker <kdecker at apple.com>
No revision
No revision
1.4.14.1 +3 -3 JavaScriptCore/bindings/runtime_array.cpp
Index: runtime_array.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_array.cpp,v
retrieving revision 1.4
retrieving revision 1.4.14.1
diff -u -r1.4 -r1.4.14.1
--- runtime_array.cpp 24 May 2004 22:19:02 -0000 1.4
+++ runtime_array.cpp 2 Aug 2005 21:26:18 -0000 1.4.14.1
@@ -96,7 +96,7 @@
}
-bool RuntimeArrayImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
+bool RuntimeArrayImp::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == lengthPropertyName)
return true;
@@ -109,10 +109,10 @@
return true;
}
- return ObjectImp::hasProperty(exec, propertyName);
+ return ObjectImp::hasOwnProperty(exec, propertyName);
}
-bool RuntimeArrayImp::hasProperty(ExecState *exec, unsigned index) const
+bool RuntimeArrayImp::hasOwnProperty(ExecState *exec, unsigned index) const
{
if (index >= getLength())
return false;
1.6.8.1 +2 -2 JavaScriptCore/bindings/runtime_array.h
Index: runtime_array.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_array.h,v
retrieving revision 1.6
retrieving revision 1.6.8.1
diff -u -r1.6 -r1.6.8.1
--- runtime_array.h 20 Jan 2005 01:39:19 -0000 1.6
+++ runtime_array.h 2 Aug 2005 21:26:18 -0000 1.6.8.1
@@ -42,8 +42,8 @@
virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
virtual void put(ExecState *exec, unsigned propertyName, const Value &value, int attr = None);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
- virtual bool hasProperty(ExecState *exec, unsigned propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, unsigned propertyName) const;
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
1.22.8.1 +1 -1 JavaScriptCore/bindings/runtime_object.cpp
Index: runtime_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_object.cpp,v
retrieving revision 1.22
retrieving revision 1.22.8.1
diff -u -r1.22 -r1.22.8.1
--- runtime_object.cpp 26 Jan 2005 21:38:10 -0000 1.22
+++ runtime_object.cpp 2 Aug 2005 21:26:18 -0000 1.22.8.1
@@ -131,7 +131,7 @@
return result;
}
-bool RuntimeObjectImp::hasProperty(ExecState *exec,
+bool RuntimeObjectImp::hasOwnProperty(ExecState *exec,
const Identifier &propertyName) const
{
bool result = false;
1.10.8.1 +1 -1 JavaScriptCore/bindings/runtime_object.h
Index: runtime_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/runtime_object.h,v
retrieving revision 1.10
retrieving revision 1.10.8.1
diff -u -r1.10 -r1.10.8.1
--- runtime_object.h 26 Jan 2005 21:38:10 -0000 1.10
+++ runtime_object.h 2 Aug 2005 21:26:19 -0000 1.10.8.1
@@ -48,7 +48,7 @@
virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
- virtual bool hasProperty(ExecState *exec,
+ virtual bool hasOwnProperty(ExecState *exec,
const Identifier &propertyName) const;
No revision
No revision
1.7.8.1 +1 -1 JavaScriptCore/bindings/objc/objc_runtime.h
Index: objc_runtime.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_runtime.h,v
retrieving revision 1.7
retrieving revision 1.7.8.1
diff -u -r1.7 -r1.7.8.1
--- objc_runtime.h 21 Jan 2005 00:41:59 -0000 1.7
+++ objc_runtime.h 2 Aug 2005 21:26:19 -0000 1.7.8.1
@@ -179,7 +179,7 @@
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
- virtual bool hasProperty(ExecState *exec,
+ virtual bool hasOwnProperty(ExecState *exec,
const Identifier &propertyName) const;
1.13.8.1 +1 -1 JavaScriptCore/bindings/objc/objc_runtime.mm
Index: objc_runtime.mm
===================================================================
RCS file: /cvs/root/JavaScriptCore/bindings/objc/objc_runtime.mm,v
retrieving revision 1.13
retrieving revision 1.13.8.1
diff -u -r1.13 -r1.13.8.1
--- objc_runtime.mm 21 Jan 2005 00:41:59 -0000 1.13
+++ objc_runtime.mm 2 Aug 2005 21:26:19 -0000 1.13.8.1
@@ -332,7 +332,7 @@
return result;
}
-bool ObjcFallbackObjectImp::hasProperty(ExecState *exec,
+bool ObjcFallbackObjectImp::hasOwnProperty(ExecState *exec,
const Identifier &propertyName) const
{
return false;
No revision
No revision
1.9.62.1 +2 -2 JavaScriptCore/kjs/array_instance.h
Index: array_instance.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/array_instance.h,v
retrieving revision 1.9
retrieving revision 1.9.62.1
diff -u -r1.9 -r1.9.62.1
--- array_instance.h 22 Jan 2003 00:11:43 -0000 1.9
+++ array_instance.h 2 Aug 2005 21:26:20 -0000 1.9.62.1
@@ -37,8 +37,8 @@
virtual Value get(ExecState *exec, unsigned propertyName) const;
virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
virtual void put(ExecState *exec, unsigned propertyName, const Value &value, int attr = None);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
- virtual bool hasProperty(ExecState *exec, unsigned propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, unsigned propertyName) const;
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
virtual ReferenceList propList(ExecState *exec, bool recursive);
1.39.12.1 +4 -4 JavaScriptCore/kjs/array_object.cpp
Index: array_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/array_object.cpp,v
retrieving revision 1.39
retrieving revision 1.39.12.1
diff -u -r1.39 -r1.39.12.1
--- array_object.cpp 10 Aug 2004 18:43:51 -0000 1.39
+++ array_object.cpp 2 Aug 2005 21:26:20 -0000 1.39.12.1
@@ -138,7 +138,7 @@
ObjectImp::put(exec, Identifier::from(index), value, attr);
}
-bool ArrayInstanceImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
+bool ArrayInstanceImp::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == lengthPropertyName)
return true;
@@ -154,10 +154,10 @@
}
}
- return ObjectImp::hasProperty(exec, propertyName);
+ return ObjectImp::hasOwnProperty(exec, propertyName);
}
-bool ArrayInstanceImp::hasProperty(ExecState *exec, unsigned index) const
+bool ArrayInstanceImp::hasOwnProperty(ExecState *exec, unsigned index) const
{
if (index >= length)
return false;
@@ -166,7 +166,7 @@
return v && v != UndefinedImp::staticUndefined;
}
- return ObjectImp::hasProperty(exec, Identifier::from(index));
+ return ObjectImp::hasOwnProperty(exec, Identifier::from(index));
}
bool ArrayInstanceImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
1.38.8.2 +4 -4 JavaScriptCore/kjs/function.cpp
Index: function.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function.cpp,v
retrieving revision 1.38.8.1
retrieving revision 1.38.8.2
diff -u -r1.38.8.1 -r1.38.8.2
--- function.cpp 2 Aug 2005 20:39:11 -0000 1.38.8.1
+++ function.cpp 2 Aug 2005 21:26:20 -0000 1.38.8.2
@@ -243,11 +243,11 @@
InternalFunctionImp::put(exec, propertyName, value, attr);
}
-bool FunctionImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
+bool FunctionImp::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == argumentsPropertyName || propertyName == lengthPropertyName)
return true;
- return InternalFunctionImp::hasProperty(exec, propertyName);
+ return InternalFunctionImp::hasOwnProperty(exec, propertyName);
}
bool FunctionImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
@@ -366,11 +366,11 @@
ObjectImp::put(exec, propertyName, value, attr);
}
-bool ActivationImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
+bool ActivationImp::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == argumentsPropertyName)
return true;
- return ObjectImp::hasProperty(exec, propertyName);
+ return ObjectImp::hasOwnProperty(exec, propertyName);
}
bool ActivationImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
1.19.28.1 +2 -2 JavaScriptCore/kjs/function.h
Index: function.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/function.h,v
retrieving revision 1.19
retrieving revision 1.19.28.1
diff -u -r1.19 -r1.19.28.1
--- function.h 18 Aug 2003 18:51:25 -0000 1.19
+++ function.h 2 Aug 2005 21:26:20 -0000 1.19.28.1
@@ -43,7 +43,7 @@
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual bool implementsCall() const;
@@ -105,7 +105,7 @@
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual const ClassInfo *classInfo() const { return &info; }
1.40.8.1 +31 -9 JavaScriptCore/kjs/object.cpp
Index: object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object.cpp,v
retrieving revision 1.40
retrieving revision 1.40.8.1
diff -u -r1.40 -r1.40.8.1
--- object.cpp 26 Jan 2005 21:38:10 -0000 1.40
+++ object.cpp 2 Aug 2005 21:26:20 -0000 1.40.8.1
@@ -282,30 +282,52 @@
// ECMA 8.6.2.4
bool ObjectImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
{
+ if (hasOwnProperty(exec, propertyName))
+ return true;
+
+ if (_proto->dispatchType() != ObjectType) {
+ return false;
+ }
+
+ // Look in the prototype
+ return static_cast<ObjectImp *>(_proto)->hasProperty(exec, propertyName);
+}
+
+bool ObjectImp::hasProperty(ExecState *exec, unsigned propertyName) const
+{
+ if (hasOwnProperty(exec, propertyName))
+ return true;
+
+ if (_proto->dispatchType() != ObjectType) {
+ return false;
+ }
+
+ // Look in the prototype
+ return static_cast<ObjectImp *>(_proto)->hasProperty(exec, propertyName);
+}
+
+bool ObjectImp::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
+{
if (_prop.get(propertyName))
return true;
// Look in the static hashtable of properties
if (findPropertyHashEntry(propertyName))
- return true;
+ return true;
// non-standard netscape extension
if (propertyName == specialPrototypePropertyName)
return true;
- if (_proto->dispatchType() != ObjectType) {
- return false;
- }
-
- // Look in the prototype
- return static_cast<ObjectImp *>(_proto)->hasProperty(exec, propertyName);
+ return false;
}
-bool ObjectImp::hasProperty(ExecState *exec, unsigned propertyName) const
+bool ObjectImp::hasOwnProperty(ExecState *exec, unsigned propertyName) const
{
- return hasProperty(exec, Identifier::from(propertyName));
+ return hasOwnProperty(exec, Identifier::from(propertyName));
}
+
// ECMA 8.6.2.5
bool ObjectImp::deleteProperty(ExecState */*exec*/, const Identifier &propertyName)
{
1.32.8.1 +24 -2 JavaScriptCore/kjs/object.h
Index: object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object.h,v
retrieving revision 1.32
retrieving revision 1.32.8.1
diff -u -r1.32 -r1.32.8.1
--- object.h 26 Jan 2005 21:38:10 -0000 1.32
+++ object.h 2 Aug 2005 21:26:20 -0000 1.32.8.1
@@ -181,6 +181,18 @@
bool hasProperty(ExecState *exec, unsigned propertyName) const;
/**
+ * Checks to see whether the object has a property with the specified name.
+ *
+ * See ECMA 15.2.4.5
+ *
+ * @param exec The current execution state
+ * @param propertyName The name of the property to check for
+ * @return true if the object has the property, otherwise false
+ */
+ bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
+ bool hasOwnProperty(ExecState *exec, unsigned propertyName) const;
+
+ /**
* Removes the specified property from the object.
*
* See ECMA 8.6.2.5
@@ -512,9 +524,13 @@
*
* @see Object::hasProperty()
*/
- virtual bool hasProperty(ExecState *exec,
+ bool hasProperty(ExecState *exec,
const Identifier &propertyName) const;
- virtual bool hasProperty(ExecState *exec, unsigned propertyName) const;
+ bool hasProperty(ExecState *exec, unsigned propertyName) const;
+
+ virtual bool hasOwnProperty(ExecState *exec,
+ const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, unsigned propertyName) const;
/**
* Implementation of the [[Delete]] internal property (implemented by all
@@ -682,6 +698,12 @@
inline bool Object::hasProperty(ExecState *exec, unsigned propertyName) const
{ return imp()->hasProperty(exec, propertyName); }
+ inline bool Object::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
+ { return imp()->hasOwnProperty(exec, propertyName); }
+
+ inline bool Object::hasOwnProperty(ExecState *exec, unsigned propertyName) const
+ { return imp()->hasOwnProperty(exec, propertyName); }
+
inline bool Object::deleteProperty(ExecState *exec, const Identifier &propertyName)
{ return imp()->deleteProperty(exec,propertyName); }
1.6.16.1 +19 -9 JavaScriptCore/kjs/object_object.cpp
Index: object_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object_object.cpp,v
retrieving revision 1.6
retrieving revision 1.6.16.1
diff -u -r1.6 -r1.6.16.1
--- object_object.cpp 9 Apr 2004 20:07:47 -0000 1.6
+++ object_object.cpp 2 Aug 2005 21:26:20 -0000 1.6.16.1
@@ -37,9 +37,10 @@
FunctionPrototypeImp *funcProto)
: ObjectImp() // [[Prototype]] is Null()
{
- Value protect(this);
- putDirect(toStringPropertyName, new ObjectProtoFuncImp(exec,funcProto,ObjectProtoFuncImp::ToString, 0), DontEnum);
- putDirect(valueOfPropertyName, new ObjectProtoFuncImp(exec,funcProto,ObjectProtoFuncImp::ValueOf, 0), DontEnum);
+ Value protect(this);
+ putDirect(toStringPropertyName, new ObjectProtoFuncImp(exec,funcProto,ObjectProtoFuncImp::ToString, 0), DontEnum);
+ putDirect(valueOfPropertyName, new ObjectProtoFuncImp(exec,funcProto,ObjectProtoFuncImp::ValueOf, 0), DontEnum);
+ putDirect("hasOwnProperty", new ObjectProtoFuncImp(exec,funcProto,ObjectProtoFuncImp::HasOwnProperty,1), DontEnum);
}
@@ -60,14 +61,23 @@
return true;
}
-// ECMA 15.2.4.2 + 15.2.4.3
+// ECMA 15.2.4.2, 15.2.4.4, 15.2.4.5
-Value ObjectProtoFuncImp::call(ExecState */*exec*/, Object &thisObj, const List &/*args*/)
+Value ObjectProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
{
- if (id == ValueOf)
- return thisObj;
- else /* ToString */
- return String("[object "+thisObj.className()+"]");
+ switch (id) {
+ case ValueOf:
+ return thisObj;
+ case HasOwnProperty: {
+ // Same as hasProperty() but without checking the prototype
+ Identifier propertyName(args[0].toString(exec));
+ bool exists = thisObj.hasOwnProperty(exec, propertyName);
+ return Value(exists ? BooleanImp::staticTrue : BooleanImp::staticFalse);
+ }
+ case ToString:
+ default:
+ return String("[object " + thisObj.className() + "]");
+ }
}
// ------------------------------ ObjectObjectImp --------------------------------
1.3.72.1 +1 -1 JavaScriptCore/kjs/object_object.h
Index: object_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/object_object.h,v
retrieving revision 1.3
retrieving revision 1.3.72.1
diff -u -r1.3 -r1.3.72.1
--- object_object.h 15 Apr 2002 23:41:17 -0000 1.3
+++ object_object.h 2 Aug 2005 21:26:20 -0000 1.3.72.1
@@ -53,7 +53,7 @@
virtual bool implementsCall() const;
virtual Value call(ExecState *exec, Object &thisObj, const List &args);
- enum { ToString, ValueOf };
+ enum { ToString, ValueOf, HasOwnProperty };
private:
int id;
};
1.31.8.3 +2 -2 JavaScriptCore/kjs/string_object.cpp
Index: string_object.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/string_object.cpp,v
retrieving revision 1.31.8.2
retrieving revision 1.31.8.3
diff -u -r1.31.8.2 -r1.31.8.3
--- string_object.cpp 22 Jul 2005 03:09:33 -0000 1.31.8.2
+++ string_object.cpp 2 Aug 2005 21:26:20 -0000 1.31.8.3
@@ -76,7 +76,7 @@
ObjectImp::put(exec, propertyName, value, attr);
}
-bool StringInstanceImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
+bool StringInstanceImp::hasOwnProperty(ExecState *exec, const Identifier &propertyName) const
{
if (propertyName == lengthPropertyName)
return true;
@@ -89,7 +89,7 @@
return true;
}
- return ObjectImp::hasProperty(exec, propertyName);
+ return ObjectImp::hasOwnProperty(exec, propertyName);
}
bool StringInstanceImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
1.7.8.1 +1 -1 JavaScriptCore/kjs/string_object.h
Index: string_object.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/string_object.h,v
retrieving revision 1.7
retrieving revision 1.7.8.1
diff -u -r1.7 -r1.7.8.1
--- string_object.h 17 Dec 2004 00:10:25 -0000 1.7
+++ string_object.h 2 Aug 2005 21:26:20 -0000 1.7.8.1
@@ -34,7 +34,7 @@
virtual Value get(ExecState *exec, const Identifier &propertyName) const;
virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
- virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
+ virtual bool hasOwnProperty(ExecState *exec, const Identifier &propertyName) const;
virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
virtual const ClassInfo *classInfo() const { return &info; }
More information about the webkit-changes
mailing list