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>
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);
}
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]);
}
// ================