Showing the changes to libraries/script-engine/src/v8/ScriptValueV8Wrapper.cpp (1 of 4 files). Show all
Unified · Split
| @@ -206,7 +206,7 @@ ScriptValue ScriptValueV8Wrapper::property(quint32 arrayIndex, const ScriptValue · 205 unmodified lines | ||
| 206 | 206 | return ScriptValue(new ScriptValueV8Wrapper(_engine, std::move(result))); |
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | − qCritical() << "Failed to get property, parent of value: " << arrayIndex << " is not a V8 object, reported type: " << QString(*v8::String::Utf8Value(isolate, _value.constGet()->TypeOf(isolate))); | |
| 209 | + qDebug() << "Failed to get property, parent of value: " << arrayIndex << " is not a V8 object, reported type: " << QString(*v8::String::Utf8Value(isolate, _value.constGet()->TypeOf(isolate))); | |
| 210 | 210 | return _engine->undefinedValue(); |
| 211 | 211 | /*v8::Local<v8::Value> nullValue = v8::Null(_engine->getIsolate()); |
| 212 | 212 | V8ScriptValue nullScriptValue(_engine->getIsolate(), std::move(nullValue)); |
| @@ -241,7 +241,14 @@ void ScriptValueV8Wrapper::setProperty(const QString& name, const ScriptValue& v · 28 unmodified lines | ||
| 241 | 241 | qDebug(scriptengine) << "Failed to set property"; |
| 242 | 242 | } |
| 243 | 243 | } else { |
| 244 | − qDebug(scriptengine) << "Failed to set property - parent is not an object"; | |
| 244 | + v8::Local<v8::String> details; | |
| 245 | + QString detailsString(""); | |
| 246 | + if(_value.get()->ToDetailString(_engine->getContext()).ToLocal(&details)) { | |
| 247 | + v8::String::Utf8Value utf8Value(isolate,details); | |
| 248 | + detailsString = *utf8Value; | |
| 249 | + } | |
| 250 | + qDebug(scriptengine) << "Failed to set property:" + name + " - parent is not an object. Parent details: " + " Type: " + QString(*v8::String::Utf8Value(isolate, _value.constGet()->TypeOf(isolate))); | |
| 251 | + qDebug(scriptengine) << _engine->currentContext()->backtrace(); | |
| 245 | 252 | } |
| 246 | 253 | //V8TODO: what about flags? |
| 247 | 254 | //_value.setProperty(name, unwrapped, (V8ScriptValue::PropertyFlags)(int)flags); |
| @@ -260,7 +267,7 @@ void ScriptValueV8Wrapper::setProperty(quint32 arrayIndex, const ScriptValue& va · 12 unmodified lines | ||
| 260 | 267 | qDebug(scriptengine) << "Failed to set property"; |
| 261 | 268 | } |
| 262 | 269 | } else { |
| 263 | − qDebug(scriptengine) << "Failed to set property - parent is not an object"; | |
| 270 | + qDebug(scriptengine) << "Failed to set property: " + QString(arrayIndex) + " - parent is not an object"; | |
| 264 | 271 | } |
| 265 | 272 | //V8TODO: what about flags? |
| 266 | 273 | //_value.setProperty(arrayIndex, unwrapped, (V8ScriptValue::PropertyFlags)(int)flags); |