2021-02-04 16:59:58 +08:00
|
|
|
#include <QDebug>
|
2021-02-08 14:36:05 +08:00
|
|
|
#include <QJSValueIterator>
|
|
|
|
|
|
|
|
#include "../utils/DoricUtils.h"
|
|
|
|
#include "DoricNativeJSE.h"
|
2021-02-04 16:59:58 +08:00
|
|
|
|
|
|
|
DoricNativeJSE::DoricNativeJSE() {
|
2021-03-31 10:36:45 +08:00
|
|
|
v8Executor = new V8Executor();
|
|
|
|
// nativeExecutor = new NativeExecutor();
|
2021-02-04 16:59:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
QString DoricNativeJSE::loadJS(QString script, QString source) {
|
2021-03-31 10:36:45 +08:00
|
|
|
// return nativeExecutor->loadJS(script, source);
|
|
|
|
return v8Executor->loadJS(script, source);
|
2021-02-04 16:59:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void DoricNativeJSE::injectGlobalJSObject(QString name, QObject *object) {
|
2021-03-31 10:36:45 +08:00
|
|
|
// nativeExecutor->injectGlobalJSObject(name, object);
|
|
|
|
v8Executor->injectGlobalJSObject(name, object);
|
2021-02-04 16:59:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void DoricNativeJSE::injectGlobalJSFunction(QString name, QObject *function,
|
|
|
|
QString property) {
|
2021-03-31 10:36:45 +08:00
|
|
|
// nativeExecutor->injectGlobalJSFunction(name, function, property);
|
|
|
|
// v8Executor->injectGlobalJSFunction(name, function, property);
|
2021-02-04 16:59:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
QJSValue DoricNativeJSE::invokeObject(QString objectName, QString functionName,
|
|
|
|
QVariantList arguments) {
|
2021-03-31 10:36:45 +08:00
|
|
|
return QJSValue::UndefinedValue;
|
|
|
|
// return nativeExecutor->invokeObject(objectName, functionName, arguments);
|
|
|
|
// return v8Executor->invokeObject(objectName, functionName, arguments);
|
2021-02-04 16:59:58 +08:00
|
|
|
}
|