From a888346c3d999f81f15444343bf0018470d9a65d Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Tue, 1 Nov 2016 15:17:13 +0100
Subject: [PATCH] Fix compilation warning in core

Replace deprecated v8::Object::ForceSet by v8::Object::DefineOwnProperty
as it is suggested by the V8 API.

Change-Id: I8c49999d391149676daf42784b796fa01918874f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/renderer/web_channel_ipc_transport.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index 2ca6640c6..161d6f493 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -223,9 +223,12 @@ void WebChannelIPCTransport::dispatchWebChannelMessage(const std::vector<char> &
     }
 
     v8::Handle<v8::Object> messageObject(v8::Object::New(isolate));
-    messageObject->ForceSet(v8::String::NewFromUtf8(isolate, "data")
-                       , v8::String::NewFromUtf8(isolate, json.constData(), v8::String::kNormalString, json.size())
-                       , v8::PropertyAttribute(v8::ReadOnly | v8::DontDelete));
+    v8::Maybe<bool> wasSet = messageObject->DefineOwnProperty(
+                context,
+                v8::String::NewFromUtf8(isolate, "data"),
+                v8::String::NewFromUtf8(isolate, json.constData(), v8::String::kNormalString, json.size()),
+                v8::PropertyAttribute(v8::ReadOnly | v8::DontDelete));
+    Q_ASSERT(!wasSet.IsNothing() && wasSet.FromJust());
 
     v8::Handle<v8::Function> callback = v8::Handle<v8::Function>::Cast(onmessageCallbackValue);
     const int argc = 1;
-- 
GitLab