History

Fixed build warnings

ksuprynowicz committed 3 years ago

Commit 3f1a7601 parent 15500496 files · +53 −26Browse files

Showing the changes to libraries/script-engine/src/v8/ScriptObjectV8Proxy.cpp (1 of 6 files). Show all

Unified · Split

libraries/script-engine/src/v8/ScriptObjectV8Proxy.cpp+24−10
@@ -32,7 +32,7 @@ Q_DECLARE_METATYPE(QSharedPointer<ScriptVariantV8Proxy>) · 31 unmodified lines
3232 // Value of internal field with index 0 when object contains ScriptObjectV8Proxy pointer in internal field 1
3333 static const void *internalPointsToQObjectProxy = (void *)0x13370000;
3434 static const void *internalPointsToQVariantProxy = (void *)0x13371000;
35−static const void *internalPointsToSignalProxy = (void *)0x13372000;
35+//static const void *internalPointsToSignalProxy = (void *)0x13372000;
3636 static const void *internalPointsToMethodProxy = (void *)0x13373000;
3737
3838 // Used strictly to replace the "this" object value for property access. May expand to a full context element
@@ -328,7 +328,7 @@ QString ScriptObjectV8Proxy::name() const { · 289 unmodified lines
328328 ScriptObjectV8Proxy::QueryFlags ScriptObjectV8Proxy::queryProperty(const V8ScriptValue& object, const V8ScriptString& name, QueryFlags flags, uint* id) {
329329 v8::HandleScope handleScope(_engine->getIsolate());
330330 // V8TODO: this might be inefficient when there's large number of properties
331− v8::Local<v8::Context> context = _engine->getContext();
331+ //v8::Local<v8::Context> context = _engine->getContext();
332332 v8::String::Utf8Value nameStr(_engine->getIsolate(), name.constGet());
333333
334334 // check for methods
@@ -473,7 +473,7 @@ V8ScriptValue ScriptObjectV8Proxy::property(const V8ScriptValue& object, const V · 138 unmodified lines
473473 qDebug(scriptengine) << "Method with QMetaType::UnknownType " << metaObject->className() << " " << (*iter).name();
474474 }
475475 } //V8TODO: is new method created during every call? It needs to be cached instead
476− bool isMethodDefined = false;
476+ //bool isMethodDefined = false;
477477 v8::Local<v8::Value> property;
478478 if(_v8Object.Get(_engine->getIsolate())->GetInternalField(2).As<v8::Object>()->Get(_engine->getContext(), name.constGet()).ToLocal(&property)) {
479479 if (!property->IsUndefined()) {
@@ -1140,14 +1140,24 @@ void ScriptSignalV8Proxy::connect(ScriptValue arg0, ScriptValue arg1) { · 660 unmodified lines
11401140 bool foundIt = false;
11411141 for (int idx = 0; idx < length && !foundIt; ++idx) {
11421142 v8::Local<v8::Value> entry = destArray->Get(destFunctionContext, idx).ToLocalChecked();
1143− newArray->Set(destFunctionContext, idx, entry);
1143+ if (!newArray->Set(destFunctionContext, idx, entry).FromMaybe(false)) {
1144+ Q_ASSERT(false);
1145+ }
1146+ }
1147+ if (!newArray->Set(destFunctionContext, length, v8ThisObject.get()).FromMaybe(false)) {
1148+ Q_ASSERT(false);
1149+ }
1150+ if (!destFunction->Set(destFunctionContext, destDataName, newArray).FromMaybe(false)) {
1151+ Q_ASSERT(false);
11441152 }
1145− newArray->Set(destFunctionContext, length, v8ThisObject.get());
1146− destFunction->Set(destFunctionContext, destDataName, newArray);
11471153 } else {
11481154 v8::Local<v8::Array> newArray = v8::Array::New(isolate, 1);
1149− newArray->Set(destFunctionContext, 0, v8ThisObject.get());
1150− destFunction->Set(destFunctionContext, destDataName, newArray);
1155+ if (!newArray->Set(destFunctionContext, 0, v8ThisObject.get()).FromMaybe(false)) {
1156+ Q_ASSERT(false);
1157+ }
1158+ if (destFunction->Set(destFunctionContext, destDataName, newArray).FromMaybe(false)) {
1159+ Q_ASSERT(false);
1160+ }
11511161 }
11521162 /*{
11531163 V8ScriptValueList args;
@@ -1245,12 +1255,16 @@ void ScriptSignalV8Proxy::disconnect(ScriptValue arg0, ScriptValue arg1) { · 91 unmodified lines
12451255 //args << idx << 1;
12461256 //destData.property("splice").call(destData, args);
12471257 } else {
1248− newArray->Set(destFunctionContext, newIndex, entry);
1258+ if (!newArray->Set(destFunctionContext, newIndex, entry).FromMaybe(false)) {
1259+ Q_ASSERT(false);
1260+ }
12491261 newIndex++;
12501262 }
12511263 }
12521264 Q_ASSERT(foundIt);
1253− destFunction->Set(destFunctionContext, destDataName, newArray);
1265+ if (!destFunction->Set(destFunctionContext, destDataName, newArray).FromMaybe(false)) {
1266+ Q_ASSERT(false);
1267+ }
12541268 } else {
12551269 Q_ASSERT(false);
12561270 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t