Commit 9ae5a9a1 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[api] Remove deprecated Object::Get/Set methods

Bug: v8:9183
Change-Id: I40c1cd1f55efc353af19cdee48e85ddc8085586c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664059
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62344}
parent fdf3f14d
......@@ -3288,8 +3288,6 @@ enum class IntegrityLevel { kFrozen, kSealed };
*/
class V8_EXPORT Object : public Value {
public:
V8_DEPRECATED("Use maybe version",
bool Set(Local<Value> key, Local<Value> value));
/**
* Set only return Just(true) or Empty(), so if it should never fail, use
* result.Check().
......@@ -3297,8 +3295,6 @@ class V8_EXPORT Object : public Value {
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
Local<Value> key, Local<Value> value);
V8_DEPRECATED("Use maybe version",
bool Set(uint32_t index, Local<Value> value));
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
Local<Value> value);
......@@ -3342,11 +3338,9 @@ class V8_EXPORT Object : public Value {
V8_WARN_UNUSED_RESULT Maybe<bool> DefineProperty(
Local<Context> context, Local<Name> key, PropertyDescriptor& descriptor);
V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
Local<Value> key);
V8_DEPRECATED("Use maybe version", Local<Value> Get(uint32_t index));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
uint32_t index);
......
......@@ -237,18 +237,10 @@ namespace v8 {
#define RETURN_ON_FAILED_EXECUTION_PRIMITIVE(T) \
EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE(isolate, Nothing<T>())
#define RETURN_TO_LOCAL_UNCHECKED(maybe_local, T) \
return maybe_local.FromMaybe(Local<T>());
#define RETURN_ESCAPED(value) return handle_scope.Escape(value);
namespace {
Local<Context> ContextFromNeverReadOnlySpaceObject(
i::Handle<i::JSReceiver> obj) {
return reinterpret_cast<v8::Isolate*>(obj->GetIsolate())->GetCurrentContext();
}
class InternalEscapableScope : public v8::EscapableHandleScope {
public:
explicit inline InternalEscapableScope(i::Isolate* isolate)
......@@ -3884,11 +3876,6 @@ Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context,
return Just(true);
}
bool v8::Object::Set(v8::Local<Value> key, v8::Local<Value> value) {
auto context = ContextFromNeverReadOnlySpaceObject(Utils::OpenHandle(this));
return Set(context, key, value).FromMaybe(false);
}
Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context, uint32_t index,
v8::Local<Value> value) {
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
......@@ -3902,11 +3889,6 @@ Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context, uint32_t index,
return Just(true);
}
bool v8::Object::Set(uint32_t index, v8::Local<Value> value) {
auto context = ContextFromNeverReadOnlySpaceObject(Utils::OpenHandle(this));
return Set(context, index, value).FromMaybe(false);
}
Maybe<bool> v8::Object::CreateDataProperty(v8::Local<v8::Context> context,
v8::Local<Name> key,
v8::Local<Value> value) {
......@@ -4124,11 +4106,6 @@ MaybeLocal<Value> v8::Object::Get(Local<v8::Context> context,
RETURN_ESCAPED(Utils::ToLocal(result));
}
Local<Value> v8::Object::Get(v8::Local<Value> key) {
auto context = ContextFromNeverReadOnlySpaceObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(Get(context, key), Value);
}
MaybeLocal<Value> v8::Object::Get(Local<Context> context, uint32_t index) {
PREPARE_FOR_EXECUTION(context, Object, Get, Value);
auto self = Utils::OpenHandle(this);
......@@ -4139,11 +4116,6 @@ MaybeLocal<Value> v8::Object::Get(Local<Context> context, uint32_t index) {
RETURN_ESCAPED(Utils::ToLocal(result));
}
Local<Value> v8::Object::Get(uint32_t index) {
auto context = ContextFromNeverReadOnlySpaceObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(Get(context, index), Value);
}
MaybeLocal<Value> v8::Object::GetPrivate(Local<Context> context,
Local<Private> key) {
return Get(context, Local<Value>(reinterpret_cast<Value*>(*key)));
......@@ -10419,7 +10391,6 @@ void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info,
#undef EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE
#undef RETURN_ON_FAILED_EXECUTION
#undef RETURN_ON_FAILED_EXECUTION_PRIMITIVE
#undef RETURN_TO_LOCAL_UNCHECKED
#undef RETURN_ESCAPED
#undef SET_FIELD_WRAPPED
#undef NEW_STRING
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment