Skip to content

Commit c76f377

Browse files
danelphickCommit Bot
authored andcommitted
[api] Remove deprecated conversion functions
Remove Isolate versions of Value::ToNumber/ToString/ToObject/ToInteger/ToInt32 and Context versions of ToBoolean and BooleanValue (which could never throw anyway). Bug: v8:7279, v8:9183 Change-Id: Ib144f8894a2b37c44216ba2d0cb298e8f0c72a3e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585735 Reviewed-by: Yang Guo <[email protected]> Commit-Queue: Dan Elphick <[email protected]> Cr-Commit-Position: refs/heads/master@{#61071}
1 parent edffb7d commit c76f377

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

include/v8.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,9 +2489,6 @@ class V8_EXPORT Value : public Data {
24892489

24902490
V8_WARN_UNUSED_RESULT MaybeLocal<BigInt> ToBigInt(
24912491
Local<Context> context) const;
2492-
V8_DEPRECATED("ToBoolean can never throw. Use Local version.",
2493-
V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
2494-
Local<Context> context) const);
24952492
V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
24962493
Local<Context> context) const;
24972494
V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
@@ -2507,16 +2504,6 @@ class V8_EXPORT Value : public Data {
25072504
V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const;
25082505

25092506
Local<Boolean> ToBoolean(Isolate* isolate) const;
2510-
V8_DEPRECATED("Use maybe version",
2511-
Local<Number> ToNumber(Isolate* isolate) const);
2512-
V8_DEPRECATED("Use maybe version",
2513-
Local<String> ToString(Isolate* isolate) const);
2514-
V8_DEPRECATED("Use maybe version",
2515-
Local<Object> ToObject(Isolate* isolate) const);
2516-
V8_DEPRECATED("Use maybe version",
2517-
Local<Integer> ToInteger(Isolate* isolate) const);
2518-
V8_DEPRECATED("Use maybe version",
2519-
Local<Int32> ToInt32(Isolate* isolate) const);
25202507

25212508
/**
25222509
* Attempts to convert a string to an array index.
@@ -2527,9 +2514,6 @@ class V8_EXPORT Value : public Data {
25272514

25282515
bool BooleanValue(Isolate* isolate) const;
25292516

2530-
V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.",
2531-
V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
2532-
Local<Context> context) const);
25332517
V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
25342518
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
25352519
Local<Context> context) const;

src/api.cc

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3533,12 +3533,6 @@ MaybeLocal<String> Value::ToString(Local<Context> context) const {
35333533
RETURN_ESCAPED(result);
35343534
}
35353535

3536-
3537-
Local<String> Value::ToString(Isolate* isolate) const {
3538-
RETURN_TO_LOCAL_UNCHECKED(ToString(isolate->GetCurrentContext()), String);
3539-
}
3540-
3541-
35423536
MaybeLocal<String> Value::ToDetailString(Local<Context> context) const {
35433537
i::Handle<i::Object> obj = Utils::OpenHandle(this);
35443538
if (obj->IsString()) return ToApiHandle<String>(obj);
@@ -3561,11 +3555,6 @@ MaybeLocal<Object> Value::ToObject(Local<Context> context) const {
35613555
RETURN_ESCAPED(result);
35623556
}
35633557

3564-
3565-
Local<v8::Object> Value::ToObject(Isolate* isolate) const {
3566-
RETURN_TO_LOCAL_UNCHECKED(ToObject(isolate->GetCurrentContext()), Object);
3567-
}
3568-
35693558
MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
35703559
i::Handle<i::Object> obj = Utils::OpenHandle(this);
35713560
if (obj->IsBigInt()) return ToApiHandle<BigInt>(obj);
@@ -3582,11 +3571,6 @@ bool Value::BooleanValue(Isolate* v8_isolate) const {
35823571
reinterpret_cast<i::Isolate*>(v8_isolate));
35833572
}
35843573

3585-
MaybeLocal<Boolean> Value::ToBoolean(Local<Context> context) const {
3586-
return ToBoolean(context->GetIsolate());
3587-
}
3588-
3589-
35903574
Local<Boolean> Value::ToBoolean(Isolate* v8_isolate) const {
35913575
auto isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
35923576
return ToApiHandle<Boolean>(
@@ -3605,12 +3589,6 @@ MaybeLocal<Number> Value::ToNumber(Local<Context> context) const {
36053589
RETURN_ESCAPED(result);
36063590
}
36073591

3608-
3609-
Local<Number> Value::ToNumber(Isolate* isolate) const {
3610-
RETURN_TO_LOCAL_UNCHECKED(ToNumber(isolate->GetCurrentContext()), Number);
3611-
}
3612-
3613-
36143592
MaybeLocal<Integer> Value::ToInteger(Local<Context> context) const {
36153593
auto obj = Utils::OpenHandle(this);
36163594
if (obj->IsSmi()) return ToApiHandle<Integer>(obj);
@@ -3622,12 +3600,6 @@ MaybeLocal<Integer> Value::ToInteger(Local<Context> context) const {
36223600
RETURN_ESCAPED(result);
36233601
}
36243602

3625-
3626-
Local<Integer> Value::ToInteger(Isolate* isolate) const {
3627-
RETURN_TO_LOCAL_UNCHECKED(ToInteger(isolate->GetCurrentContext()), Integer);
3628-
}
3629-
3630-
36313603
MaybeLocal<Int32> Value::ToInt32(Local<Context> context) const {
36323604
auto obj = Utils::OpenHandle(this);
36333605
if (obj->IsSmi()) return ToApiHandle<Int32>(obj);
@@ -3639,12 +3611,6 @@ MaybeLocal<Int32> Value::ToInt32(Local<Context> context) const {
36393611
RETURN_ESCAPED(result);
36403612
}
36413613

3642-
3643-
Local<Int32> Value::ToInt32(Isolate* isolate) const {
3644-
RETURN_TO_LOCAL_UNCHECKED(ToInt32(isolate->GetCurrentContext()), Int32);
3645-
}
3646-
3647-
36483614
MaybeLocal<Uint32> Value::ToUint32(Local<Context> context) const {
36493615
auto obj = Utils::OpenHandle(this);
36503616
if (obj->IsSmi()) return ToApiHandle<Uint32>(obj);
@@ -3904,13 +3870,6 @@ void v8::RegExp::CheckCast(v8::Value* that) {
39043870
"Could not convert to regular expression");
39053871
}
39063872

3907-
3908-
Maybe<bool> Value::BooleanValue(Local<Context> context) const {
3909-
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
3910-
return Just(Utils::OpenHandle(this)->BooleanValue(isolate));
3911-
}
3912-
3913-
39143873
Maybe<double> Value::NumberValue(Local<Context> context) const {
39153874
auto obj = Utils::OpenHandle(this);
39163875
if (obj->IsNumber()) return Just(obj->Number());

0 commit comments

Comments
 (0)