summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-04 14:22:41 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-04 14:48:14 (GMT)
commit394f62d779e6e120ce2fc19bd61ec64bd29a87a9 (patch)
treefa6da1375e83311881da4c95755d7a7276a3c58e /src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
parentcd23e93e30be026a6bd4a9d5e3d3cbec3cf97621 (diff)
downloadQt-394f62d779e6e120ce2fc19bd61ec64bd29a87a9.zip
Qt-394f62d779e6e120ce2fc19bd61ec64bd29a87a9.tar.gz
Qt-394f62d779e6e120ce2fc19bd61ec64bd29a87a9.tar.bz2
Make it possible to delete properties even though they have the DontDelete attribute
This makes it possible to delete properties in C++, even though they can't be deleted in JS.
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
index 10efd59..ded842d 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp
@@ -204,12 +204,12 @@ bool JSObject::hasProperty(ExecState* exec, unsigned propertyName) const
}
// ECMA 8.6.2.5
-bool JSObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
+bool JSObject::deleteProperty(ExecState* exec, const Identifier& propertyName, bool checkDontDelete)
{
unsigned attributes;
JSCell* specificValue;
if (m_structure->get(propertyName, attributes, specificValue) != WTF::notFound) {
- if ((attributes & DontDelete))
+ if ((attributes & DontDelete) && checkDontDelete)
return false;
removeDirect(propertyName);
return true;
@@ -217,7 +217,7 @@ bool JSObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
// Look in the static hashtable of properties
const HashEntry* entry = findPropertyHashEntry(exec, propertyName);
- if (entry && entry->attributes() & DontDelete)
+ if (entry && (entry->attributes() & DontDelete) && checkDontDelete)
return false; // this builtin property can't be deleted
// FIXME: Should the code here actually do some deletion?
@@ -230,9 +230,9 @@ bool JSObject::hasOwnProperty(ExecState* exec, const Identifier& propertyName) c
return const_cast<JSObject*>(this)->getOwnPropertySlot(exec, propertyName, slot);
}
-bool JSObject::deleteProperty(ExecState* exec, unsigned propertyName)
+bool JSObject::deleteProperty(ExecState* exec, unsigned propertyName, bool checkDontDelete)
{
- return deleteProperty(exec, Identifier::from(exec, propertyName));
+ return deleteProperty(exec, Identifier::from(exec, propertyName), checkDontDelete);
}
static ALWAYS_INLINE JSValue callDefaultValueFunction(ExecState* exec, const JSObject* object, const Identifier& propertyName)