summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-04 14:47:08 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-04 14:48:15 (GMT)
commit28e8cb97ed2813a6baac36f1795b3ba9c71892c2 (patch)
tree2110883da644ecb4e8694414dd38319dc42c2393 /src/script/api
parent394f62d779e6e120ce2fc19bd61ec64bd29a87a9 (diff)
downloadQt-28e8cb97ed2813a6baac36f1795b3ba9c71892c2.zip
Qt-28e8cb97ed2813a6baac36f1795b3ba9c71892c2.tar.gz
Qt-28e8cb97ed2813a6baac36f1795b3ba9c71892c2.tar.bz2
adapt to commit 014c4c63066fd3920594e6a58b02f314b5c88cdf
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp13
-rw-r--r--src/script/api/qscriptvalue.cpp12
2 files changed, 13 insertions, 12 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index bebb972..088cf77 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -365,7 +365,8 @@ public:
virtual void put(JSC::ExecState* exec, const JSC::Identifier& propertyName,
JSC::JSValue, JSC::PutPropertySlot&);
virtual bool deleteProperty(JSC::ExecState*,
- const JSC::Identifier& propertyName);
+ const JSC::Identifier& propertyName,
+ bool checkDontDelete = true);
virtual bool getPropertyAttributes(JSC::ExecState*, const JSC::Identifier&,
unsigned&) const;
virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, bool includeNonEnumerable = false);
@@ -400,8 +401,8 @@ public:
JSC::JSValue value, JSC::PutPropertySlot& slot)
{ originalGlobalObject->JSC::JSGlobalObject::put(exec, propertyName, value, slot); }
virtual bool deleteProperty(JSC::ExecState* exec,
- const JSC::Identifier& propertyName)
- { return originalGlobalObject->JSC::JSGlobalObject::deleteProperty(exec, propertyName); }
+ const JSC::Identifier& propertyName, bool checkDontDelete = true)
+ { return originalGlobalObject->JSC::JSGlobalObject::deleteProperty(exec, propertyName, checkDontDelete); }
virtual bool getPropertyAttributes(JSC::ExecState* exec, const JSC::Identifier& propertyName,
unsigned& attributes) const
{ return originalGlobalObject->JSC::JSGlobalObject::getPropertyAttributes(exec, propertyName, attributes); }
@@ -727,11 +728,11 @@ void GlobalObject::put(JSC::ExecState* exec, const JSC::Identifier& propertyName
}
bool GlobalObject::deleteProperty(JSC::ExecState* exec,
- const JSC::Identifier& propertyName)
+ const JSC::Identifier& propertyName, bool checkDontDelete)
{
if (customGlobalObject)
- return customGlobalObject->deleteProperty(exec, propertyName);
- return JSC::JSGlobalObject::deleteProperty(exec, propertyName);
+ return customGlobalObject->deleteProperty(exec, propertyName, checkDontDelete);
+ return JSC::JSGlobalObject::deleteProperty(exec, propertyName, checkDontDelete);
}
bool GlobalObject::getPropertyAttributes(JSC::ExecState* exec, const JSC::Identifier& propertyName,
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 24ff050..ae1235e 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -1786,7 +1786,7 @@ void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value,
JSC::ExecState *exec = eng_p->currentFrame;
JSC::JSValue jscValue = eng_p->scriptValueToJSCValue(value);
if (!jscValue) {
- JSC::asObject(d->jscValue)->deleteProperty(exec, arrayIndex);
+ JSC::asObject(d->jscValue)->deleteProperty(exec, arrayIndex, /*checkDontDelete=*/false);
} else {
if ((flags & QScriptValue::PropertyGetter) || (flags & QScriptValue::PropertySetter)) {
Q_ASSERT_X(false, Q_FUNC_INFO, "property getters and setters not implemented");
@@ -1870,15 +1870,15 @@ void QScriptValue::setProperty(const QScriptString &name,
// deleting getter/setter
if ((flags & QScriptValue::PropertyGetter) && (flags & QScriptValue::PropertySetter)) {
// deleting both: just delete the property
- thisObject->deleteProperty(exec, id);
+ thisObject->deleteProperty(exec, id, /*checkDontDelete=*/false);
} else if (flags & QScriptValue::PropertyGetter) {
// preserve setter, if there is one
- thisObject->deleteProperty(exec, id);
+ thisObject->deleteProperty(exec, id, /*checkDontDelete=*/false);
if (setter && setter.isObject())
thisObject->defineSetter(exec, id, JSC::asObject(setter));
} else { // flags & QScriptValue::PropertySetter
// preserve getter, if there is one
- thisObject->deleteProperty(exec, id);
+ thisObject->deleteProperty(exec, id, /*checkDontDelete=*/false);
if (getter && getter.isObject())
thisObject->defineGetter(exec, id, JSC::asObject(getter));
}
@@ -1908,10 +1908,10 @@ void QScriptValue::setProperty(const QScriptString &name,
}
if (!jscValue) {
// ### check if it's a getter/setter property
- thisObject->deleteProperty(exec, id);
+ thisObject->deleteProperty(exec, id, /*checkDontDelete=*/false);
} else if (flags != QScriptValue::KeepExistingFlags) {
if (thisObject->hasOwnProperty(exec, id))
- thisObject->deleteProperty(exec, id); // ### hmmm - can't we just update the attributes?
+ thisObject->deleteProperty(exec, id, /*checkDontDelete=*/false); // ### hmmm - can't we just update the attributes?
unsigned attribs = 0;
if (flags & QScriptValue::ReadOnly)
attribs |= JSC::ReadOnly;