mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:09:24 +02:00
Fixed C++ function calls for V8
This commit is contained in:
parent
e80ee4a1f0
commit
136a6f0033
3 changed files with 6 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include "ScriptEngineLogging.h"
|
#include "ScriptEngineLogging.h"
|
||||||
|
|
||||||
|
//V8TODO name is misleading, it's actually undefined
|
||||||
class ScriptValueProxyNull final : public ScriptValueProxy {
|
class ScriptValueProxyNull final : public ScriptValueProxy {
|
||||||
public:
|
public:
|
||||||
virtual void release() override;
|
virtual void release() override;
|
||||||
|
|
|
@ -50,9 +50,9 @@ int ScriptContextV8Wrapper::argumentCount() const {
|
||||||
//Q_ASSERT(_functionCallbackInfo);A
|
//Q_ASSERT(_functionCallbackInfo);A
|
||||||
// V8TODO
|
// V8TODO
|
||||||
if (_functionCallbackInfo) {
|
if (_functionCallbackInfo) {
|
||||||
return _functionCallbackInfo->kArgsLength;
|
return _functionCallbackInfo->Length();
|
||||||
} else if (_propertyCallbackInfo) {
|
} else if (_propertyCallbackInfo) {
|
||||||
return _propertyCallbackInfo->kArgsLength;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return Q_METAMETHOD_INVOKE_MAX_ARGS;
|
return Q_METAMETHOD_INVOKE_MAX_ARGS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1157,7 +1157,9 @@ ScriptValue ScriptEngineV8::newFunction(ScriptEngine::FunctionSignature fun, int
|
||||||
//V8TODO: this scriptContext needs to have FunctionCallbackInfo added
|
//V8TODO: this scriptContext needs to have FunctionCallbackInfo added
|
||||||
ScriptValue result = function(&scriptContext, scriptEngine);
|
ScriptValue result = function(&scriptContext, scriptEngine);
|
||||||
ScriptValueV8Wrapper* unwrapped = ScriptValueV8Wrapper::unwrap(result);
|
ScriptValueV8Wrapper* unwrapped = ScriptValueV8Wrapper::unwrap(result);
|
||||||
info.GetReturnValue().Set(unwrapped->toV8Value().constGet());
|
if (unwrapped) {
|
||||||
|
info.GetReturnValue().Set(unwrapped->toV8Value().constGet());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
//auto functionTemplate = v8::FunctionTemplate::New(_v8Isolate, v8FunctionCallback, v8::Local<v8::Value>(), v8::Local<v8::Signature>(), length);
|
//auto functionTemplate = v8::FunctionTemplate::New(_v8Isolate, v8FunctionCallback, v8::Local<v8::Value>(), v8::Local<v8::Signature>(), length);
|
||||||
//auto functionData = v8::Object::New(_v8Isolate);
|
//auto functionData = v8::Object::New(_v8Isolate);
|
||||||
|
|
Loading…
Reference in a new issue