mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 00:44:38 +02:00
Hide private methods from script engine
This commit is contained in:
parent
dba38acb9f
commit
8c9a88b2d9
1 changed files with 2 additions and 1 deletions
|
@ -271,7 +271,7 @@ void ScriptObjectV8Proxy::investigate() {
|
||||||
QMetaMethod method = metaObject->method(idx);
|
QMetaMethod method = metaObject->method(idx);
|
||||||
|
|
||||||
// perhaps keep this comment? Calls (like AudioScriptingInterface::playSound) seem to expect non-public methods to be script-accessible
|
// perhaps keep this comment? Calls (like AudioScriptingInterface::playSound) seem to expect non-public methods to be script-accessible
|
||||||
/* if (method.access() != QMetaMethod::Public) continue;*/
|
if (method.access() == QMetaMethod::Private) continue;
|
||||||
|
|
||||||
bool isSignal = false;
|
bool isSignal = false;
|
||||||
QByteArray szName = method.name();
|
QByteArray szName = method.name();
|
||||||
|
@ -389,6 +389,7 @@ ScriptObjectV8Proxy::QueryFlags ScriptObjectV8Proxy::queryProperty(const V8Scrip
|
||||||
v8::Local<v8::Context> context = _engine->getContext();
|
v8::Local<v8::Context> context = _engine->getContext();
|
||||||
v8::Context::Scope contextScope(context);
|
v8::Context::Scope contextScope(context);
|
||||||
QString nameStr(*v8::String::Utf8Value(isolate, name.constGet()));
|
QString nameStr(*v8::String::Utf8Value(isolate, name.constGet()));
|
||||||
|
// V8TODO: registering methods on V8 side would make API calls a lot faster
|
||||||
|
|
||||||
// check for methods
|
// check for methods
|
||||||
MethodNameMap::const_iterator method = _methodNameMap.find(nameStr);
|
MethodNameMap::const_iterator method = _methodNameMap.find(nameStr);
|
||||||
|
|
Loading…
Reference in a new issue