History

update code to support libnode24

RTUnreal committed 3 months ago

Commit f8fb2101 parent 26a7de46 files · +29 −22Browse 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+17−12
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 //
1414
1515 #include "ScriptObjectV8Proxy.h"
16+#include <v8-template.h>
1617
1718 #include <QElapsedTimer>
1819 #include <QtCore/QList>
@@ -490,14 +491,14 @@ ScriptValue::PropertyFlags ScriptObjectV8Proxy::propertyFlags(const V8ScriptValu · 471 unmodified lines
490491 return ScriptValue::PropertyFlags();
491492 }
492493
493−void ScriptObjectV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
494+v8::Intercepted ScriptObjectV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
494495 v8::HandleScope handleScope(info.GetIsolate());
495496 v8::String::Utf8Value utf8Value(info.GetIsolate(), name);
496497 v8::Local<v8::Value> objectV8 = info.This();
497498 ScriptObjectV8Proxy *proxy = ScriptObjectV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
498499 if (!proxy) {
499500 qCDebug(scriptengine_v8) << "Proxy object not found when getting: " << *utf8Value;
500− return;
501+ return v8::Intercepted::kYes;
501502 }
502503 V8ScriptValue object(proxy->_engine, objectV8);
503504 if (!name->IsString() && !name->IsSymbol()) {
@@ -516,7 +517,7 @@ void ScriptObjectV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCall · 12 unmodified lines
516517 if (flags) {
517518 V8ScriptValue value = proxy->property(object, nameString, id);
518519 info.GetReturnValue().Set(value.get());
519− return;
520+ return v8::Intercepted::kYes;
520521 }
521522 }
522523
@@ -526,16 +527,17 @@ void ScriptObjectV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCall · 3 unmodified lines
526527 } else {
527528 qCDebug(scriptengine_v8) << "Value not found: " << *utf8Value;
528529 }
530+ return v8::Intercepted::kYes;
529531 }
530532
531−void ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) {
533+v8::Intercepted ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) {
532534 v8::HandleScope handleScope(info.GetIsolate());
533535 v8::String::Utf8Value utf8Value(info.GetIsolate(), name);
534536 v8::Local<v8::Value> objectV8 = info.This();
535537 ScriptObjectV8Proxy *proxy = ScriptObjectV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
536538 if (!proxy) {
537539 qCDebug(scriptengine_v8) << "Proxy object not found when setting: " << *utf8Value;
538− return;
540+ return v8::Intercepted::kYes;
539541 }
540542 V8ScriptValue object(proxy->_engine, objectV8);
541543 if (!name->IsString() && !name->IsSymbol()) {
@@ -553,7 +555,7 @@ void ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> v · 11 unmodified lines
553555 if (flags) {
554556 proxy->setProperty(object, nameString, id, V8ScriptValue(proxy->_engine, value));
555557 info.GetReturnValue().Set(value);
556− return;
558+ return v8::Intercepted::kYes;
557559 }
558560 }
559561
@@ -562,6 +564,7 @@ void ScriptObjectV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> v · 2 unmodified lines
562564 } else {
563565 qCDebug(scriptengine_v8) << "Set failed: " << *utf8Value;
564566 }
567+ return v8::Intercepted::kYes;
565568 }
566569
567570 void ScriptObjectV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {
@@ -832,14 +835,14 @@ QVariant* ScriptVariantV8Proxy::unwrapQVariantPointer(v8::Isolate* isolate, cons · 264 unmodified lines
832835 }
833836
834837
835−void ScriptVariantV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
838+v8::Intercepted ScriptVariantV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
836839 v8::HandleScope handleScope(info.GetIsolate());
837840 v8::String::Utf8Value utf8Name(info.GetIsolate(), name);
838841 v8::Local<v8::Value> objectV8 = info.This();
839842 ScriptVariantV8Proxy *proxy = ScriptVariantV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
840843 if (!proxy) {
841844 qCDebug(scriptengine_v8) << "Proxy object not found when getting: " << *utf8Name;
842− return;
845+ return v8::Intercepted::kYes;
843846 }
844847 V8ScriptValue object(proxy->_engine, proxy->_v8Object.Get(info.GetIsolate()));
845848
@@ -852,21 +855,22 @@ void ScriptVariantV8Proxy::v8Get(v8::Local<v8::Name> name, const v8::PropertyCal · 6 unmodified lines
852855 if (flags) {
853856 V8ScriptValue value = proxy->property(object, nameString, id);
854857 info.GetReturnValue().Set(value.get());
855− return;
858+ return v8::Intercepted::kYes;
856859 }
857860 }
858861
859862 qCDebug(scriptengine_v8) << "Value not found: " << *utf8Name;
863+ return v8::Intercepted::kYes;
860864 }
861865
862−void ScriptVariantV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) {
866+v8::Intercepted ScriptVariantV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) {
863867 v8::HandleScope handleScope(info.GetIsolate());
864868 v8::String::Utf8Value utf8Name(info.GetIsolate(), name);
865869 v8::Local<v8::Value> objectV8 = info.This();
866870 ScriptVariantV8Proxy *proxy = ScriptVariantV8Proxy::unwrapProxy(info.GetIsolate(), objectV8);
867871 if (!proxy) {
868872 qCDebug(scriptengine_v8) << "Proxy object not found when getting: " << *utf8Name;
869− return;
873+ return v8::Intercepted::kYes;
870874 }
871875
872876 V8ScriptValue object(proxy->_engine, objectV8);
@@ -884,10 +888,11 @@ void ScriptVariantV8Proxy::v8Set(v8::Local<v8::Name> name, v8::Local<v8::Value> · 11 unmodified lines
884888 if (flags) {
885889 proxy->setProperty(object, nameString, id, V8ScriptValue(proxy->_engine, value));
886890 info.GetReturnValue().Set(value);
887− return;
891+ return v8::Intercepted::kYes;
888892 }
889893 }
890894 qCDebug(scriptengine_v8) << "Set failed: " << *utf8Name;
895+ return v8::Intercepted::kYes;
891896 }
892897
893898 void ScriptVariantV8Proxy::v8GetPropertyNames(const v8::PropertyCallbackInfo<v8::Array>& info) {