766 #endif |
766 #endif |
767 |
767 |
768 } // namespace QScript |
768 } // namespace QScript |
769 |
769 |
770 QScriptEnginePrivate::QScriptEnginePrivate() |
770 QScriptEnginePrivate::QScriptEnginePrivate() |
771 : registeredScriptValues(0), freeScriptValues(0), |
771 : registeredScriptValues(0), freeScriptValues(0), freeScriptValuesCount(0), |
772 registeredScriptStrings(0), inEval(false) |
772 registeredScriptStrings(0), inEval(false) |
773 { |
773 { |
774 qMetaTypeId<QScriptValue>(); |
774 qMetaTypeId<QScriptValue>(); |
775 qMetaTypeId<QList<int> >(); |
775 qMetaTypeId<QList<int> >(); |
776 #ifndef QT_NO_QOBJECT |
776 #ifndef QT_NO_QOBJECT |
2919 Q_D(QScriptEngine); |
2919 Q_D(QScriptEngine); |
2920 JSC::ExecState* exec = d->currentFrame; |
2920 JSC::ExecState* exec = d->currentFrame; |
2921 JSC::JSValue jscObject = d->scriptValueToJSCValue(object); |
2921 JSC::JSValue jscObject = d->scriptValueToJSCValue(object); |
2922 JSC::JSGlobalObject *glob = d->originalGlobalObject(); |
2922 JSC::JSGlobalObject *glob = d->originalGlobalObject(); |
2923 if (!jscObject || !jscObject.isObject()) |
2923 if (!jscObject || !jscObject.isObject()) |
2924 jscObject = glob; |
2924 jscObject = d->globalObject(); |
2925 // unsigned attribs = JSC::DontEnum; |
2925 // unsigned attribs = JSC::DontEnum; |
2926 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 5, JSC::Identifier(exec, "qsTranslate"), QScript::functionQsTranslate)); |
2926 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 5, JSC::Identifier(exec, "qsTranslate"), QScript::functionQsTranslate)); |
2927 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 2, JSC::Identifier(exec, "QT_TRANSLATE_NOOP"), QScript::functionQsTranslateNoOp)); |
2927 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 2, JSC::Identifier(exec, "QT_TRANSLATE_NOOP"), QScript::functionQsTranslateNoOp)); |
2928 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 3, JSC::Identifier(exec, "qsTr"), QScript::functionQsTr)); |
2928 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 3, JSC::Identifier(exec, "qsTr"), QScript::functionQsTr)); |
2929 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "QT_TR_NOOP"), QScript::functionQsTrNoOp)); |
2929 JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "QT_TR_NOOP"), QScript::functionQsTrNoOp)); |