diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-17 09:38:17 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-17 09:38:17 (GMT) |
commit | 525251ecded0a57e6b456cc787094a5703d7ff13 (patch) | |
tree | 329e118e56656d4fa3bc8055dab6a8c20ef05333 /src/script/api | |
parent | 6272ef01f0985fa22262733eddd37c3c39de0a1a (diff) | |
download | Qt-525251ecded0a57e6b456cc787094a5703d7ff13.zip Qt-525251ecded0a57e6b456cc787094a5703d7ff13.tar.gz Qt-525251ecded0a57e6b456cc787094a5703d7ff13.tar.bz2 |
set correct property flags in newFunction()
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 5ffb04e..0a3fbf1 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -1415,9 +1415,10 @@ QScriptValue QScriptEngine::newFunction(QScriptEngine::FunctionSignature fun, JSC::ExecState* exec = d->currentFrame; JSC::JSValue function = new (exec)QScript::FunctionWrapper(this, length, JSC::Identifier(exec, ""), fun); QScriptValue result = d->scriptValueFromJSCValue(function); - result.setProperty(QLatin1String("prototype"), prototype); + result.setProperty(QLatin1String("prototype"), prototype, QScriptValue::Undeletable); const_cast<QScriptValue&>(prototype) - .setProperty(QLatin1String("constructor"), result, QScriptValue::SkipInEnumeration); + .setProperty(QLatin1String("constructor"), result, + QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); return result; } |