conversionPenaltyScore should accumulate
Showing the changes to libraries/script-engine/src/v8/ScriptObjectV8Proxy.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1040,7 +1040,7 @@ void ScriptMethodV8Proxy::call(const v8::FunctionCallbackInfo<v8::Value>& argume · 1039 unmodified lines | |||
| 1040 | } else { | 1040 | } else { |
| 1041 | qVarArgLists[i].append(varArgVal); | 1041 | qVarArgLists[i].append(varArgVal); |
| 1042 | const QVariant& converted = qVarArgLists[i].back(); | 1042 | const QVariant& converted = qVarArgLists[i].back(); |
| 1043 | conversionPenaltyScore = _engine->computeCastPenalty(V8ScriptValue(_engine, argVal), methodArgTypeId); | 1043 | conversionPenaltyScore += _engine->computeCastPenalty(V8ScriptValue(_engine, argVal), methodArgTypeId); |
| 1044 | 1044 | ||
| 1045 | // a lot of type conversion assistance thanks to https://stackoverflow.com/questions/28457819/qt-invoke-method-with-qvariant | 1045 | // a lot of type conversion assistance thanks to https://stackoverflow.com/questions/28457819/qt-invoke-method-with-qvariant |
| 1046 | // A const_cast is needed because calling data() would detach the QVariant. | 1046 | // A const_cast is needed because calling data() would detach the QVariant. |