[M63] Switch deprecated ForceSet with DefineOwnProperty 48/177848/2 accepted/tizen/unified/20180506.043327 accepted/tizen/unified/20180510.022831 accepted/tizen/unified/20180514.060703 submit/tizen/20180504.024819 submit/tizen/20180504.050738 submit/tizen/20180509.014449 submit/tizen/20180509.200329 submit/tizen/20180511.073645
authorYoungsoo Choi <kenshin.choi@samsung.com>
Mon, 2 Apr 2018 08:52:13 +0000 (01:52 -0700)
committerjaekuk lee <juku1999@samsung.com>
Fri, 4 May 2018 05:06:13 +0000 (05:06 +0000)
ForceSet has been deprecated in v8 version 6.3.292.
So, this switches the ForceSet with DefineOwnProperty.

Change-Id: Ied9dcf71ec447b9a1dcd15c4b6ab6ed8420a20d6
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
extensions/renderer/xwalk_module_system.cc
extensions/renderer/xwalk_v8tools_module.cc

index 2218188..e2d1a9a 100755 (executable)
@@ -516,7 +516,7 @@ void XWalkModuleSystem::EnsureExtensionNamespaceIsReadOnly(
 
   v8::Handle<v8::String> v8_extension_name(
       v8::String::NewFromUtf8(context->GetIsolate(), basename.c_str()));
-  value.As<v8::Object>()->ForceSet(
+  value.As<v8::Object>()->DefineOwnProperty(context,
       v8_extension_name, value.As<v8::Object>()->Get(v8_extension_name),
       v8::ReadOnly);
 }
index 4fcad37..941851d 100755 (executable)
@@ -18,7 +18,11 @@ void ForceSetPropertyCallback(
   if (info.Length() != 3 || !info[0]->IsObject() || !info[1]->IsString()) {
     return;
   }
-  info[0].As<v8::Object>()->ForceSet(info[1], info[2]);
+  v8::Isolate* isolate = v8::Isolate::GetCurrent();
+  v8::Local<v8::Context> ctx = isolate->GetCurrentContext();
+  v8::String::Utf8Value value(info[1]);
+  v8::Local<v8::String> key = v8::String::NewFromUtf8(isolate, *value);
+  info[0].As<v8::Object>()->DefineOwnProperty(ctx, key, info[2]);
 }
 
 // ================