Skip to content

Commit 46c7d0d

Browse files
committed
deps: increase V8 deprecation levels
Bump from `V8_DEPRECATE_SOON` to `V8_DEPRECATE` for APIs that are removed in V8 7.0+. Also, provide the replacement APIs in cases where they were absent on Node 10. Refs: #23122 PR-URL: #23159 Reviewed-By: Michaël Zasso <[email protected]>
1 parent 950ccee commit 46c7d0d

File tree

4 files changed

+66
-47
lines changed

4 files changed

+66
-47
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# Reset this number to 0 on major V8 upgrades.
3535
# Increment by one for each non-official patch applied to deps/v8.
36-
'v8_embedder_string': '-node.34',
36+
'v8_embedder_string': '-node.35',
3737

3838
# Enable disassembler for `--print-code` v8 options
3939
'v8_enable_disassembler': 1,

deps/v8/include/libplatform/libplatform.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ V8_PLATFORM_EXPORT std::unique_ptr<v8::Platform> NewDefaultPlatform(
4141
InProcessStackDumping::kDisabled,
4242
std::unique_ptr<v8::TracingController> tracing_controller = {});
4343

44-
V8_PLATFORM_EXPORT V8_DEPRECATE_SOON(
44+
V8_PLATFORM_EXPORT V8_DEPRECATED(
4545
"Use NewDefaultPlatform instead",
4646
v8::Platform* CreateDefaultPlatform(
4747
int thread_pool_size = 0,

deps/v8/include/v8.h

+51-45
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,12 @@ class V8_EXPORT PrimitiveArray {
10191019
public:
10201020
static Local<PrimitiveArray> New(Isolate* isolate, int length);
10211021
int Length() const;
1022-
void Set(int index, Local<Primitive> item);
1023-
Local<Primitive> Get(int index);
1022+
V8_DEPRECATED("Use Isolate* version",
1023+
void Set(int index, Local<Primitive> item));
1024+
V8_DEPRECATED("Use Isolate* version",
1025+
Local<Primitive> Get(int index));
1026+
void Set(Isolate* isolate, int index, Local<Primitive> item);
1027+
Local<Primitive> Get(Isolate* isolate, int index);
10241028
};
10251029

10261030
/**
@@ -1735,8 +1739,8 @@ class V8_EXPORT StackTrace {
17351739
/**
17361740
* Returns a StackFrame at a particular index.
17371741
*/
1738-
V8_DEPRECATE_SOON("Use Isolate version",
1739-
Local<StackFrame> GetFrame(uint32_t index) const);
1742+
V8_DEPRECATED("Use Isolate version",
1743+
Local<StackFrame> GetFrame(uint32_t index) const);
17401744
Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
17411745

17421746
/**
@@ -2432,25 +2436,25 @@ class V8_EXPORT Value : public Data {
24322436
Local<Context> context) const;
24332437
V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const;
24342438

2435-
V8_DEPRECATE_SOON("Use maybe version",
2436-
Local<Boolean> ToBoolean(Isolate* isolate) const);
2437-
V8_DEPRECATE_SOON("Use maybe version",
2438-
Local<Number> ToNumber(Isolate* isolate) const);
2439-
V8_DEPRECATE_SOON("Use maybe version",
2440-
Local<String> ToString(Isolate* isolate) const);
2441-
V8_DEPRECATE_SOON("Use maybe version",
2442-
Local<Object> ToObject(Isolate* isolate) const);
2443-
V8_DEPRECATE_SOON("Use maybe version",
2444-
Local<Integer> ToInteger(Isolate* isolate) const);
2445-
V8_DEPRECATE_SOON("Use maybe version",
2446-
Local<Int32> ToInt32(Isolate* isolate) const);
2447-
2448-
inline V8_DEPRECATE_SOON("Use maybe version",
2449-
Local<Boolean> ToBoolean() const);
2450-
inline V8_DEPRECATE_SOON("Use maybe version", Local<String> ToString() const);
2451-
inline V8_DEPRECATE_SOON("Use maybe version", Local<Object> ToObject() const);
2452-
inline V8_DEPRECATE_SOON("Use maybe version",
2453-
Local<Integer> ToInteger() const);
2439+
V8_DEPRECATED("Use maybe version",
2440+
Local<Boolean> ToBoolean(Isolate* isolate) const);
2441+
V8_DEPRECATED("Use maybe version",
2442+
Local<Number> ToNumber(Isolate* isolate) const);
2443+
V8_DEPRECATED("Use maybe version",
2444+
Local<String> ToString(Isolate* isolate) const);
2445+
V8_DEPRECATED("Use maybe version",
2446+
Local<Object> ToObject(Isolate* isolate) const);
2447+
V8_DEPRECATED("Use maybe version",
2448+
Local<Integer> ToInteger(Isolate* isolate) const);
2449+
V8_DEPRECATED("Use maybe version",
2450+
Local<Int32> ToInt32(Isolate* isolate) const);
2451+
2452+
inline V8_DEPRECATED("Use maybe version",
2453+
Local<Boolean> ToBoolean() const);
2454+
inline V8_DEPRECATED("Use maybe version", Local<String> ToString() const);
2455+
inline V8_DEPRECATED("Use maybe version", Local<Object> ToObject() const);
2456+
inline V8_DEPRECATED("Use maybe version",
2457+
Local<Integer> ToInteger() const);
24542458

24552459
/**
24562460
* Attempts to convert a string to an array index.
@@ -2467,14 +2471,14 @@ class V8_EXPORT Value : public Data {
24672471
Local<Context> context) const;
24682472
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
24692473

2470-
V8_DEPRECATE_SOON("Use maybe version", bool BooleanValue() const);
2471-
V8_DEPRECATE_SOON("Use maybe version", double NumberValue() const);
2472-
V8_DEPRECATE_SOON("Use maybe version", int64_t IntegerValue() const);
2473-
V8_DEPRECATE_SOON("Use maybe version", uint32_t Uint32Value() const);
2474-
V8_DEPRECATE_SOON("Use maybe version", int32_t Int32Value() const);
2474+
V8_DEPRECATED("Use maybe version", bool BooleanValue() const);
2475+
V8_DEPRECATED("Use maybe version", double NumberValue() const);
2476+
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
2477+
V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const);
2478+
V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
24752479

24762480
/** JS == */
2477-
V8_DEPRECATE_SOON("Use maybe version", bool Equals(Local<Value> that) const);
2481+
V8_DEPRECATED("Use maybe version", bool Equals(Local<Value> that) const);
24782482
V8_WARN_UNUSED_RESULT Maybe<bool> Equals(Local<Context> context,
24792483
Local<Value> that) const;
24802484
bool StrictEquals(Local<Value> that) const;
@@ -2580,7 +2584,7 @@ class V8_EXPORT String : public Name {
25802584
* Returns the number of bytes in the UTF-8 encoded
25812585
* representation of this string.
25822586
*/
2583-
V8_DEPRECATE_SOON("Use Isolate version instead", int Utf8Length() const);
2587+
V8_DEPRECATED("Use Isolate version instead", int Utf8Length() const);
25842588

25852589
int Utf8Length(Isolate* isolate) const;
25862590

@@ -2638,23 +2642,23 @@ class V8_EXPORT String : public Name {
26382642
// 16-bit character codes.
26392643
int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1,
26402644
int options = NO_OPTIONS) const;
2641-
V8_DEPRECATE_SOON("Use Isolate* version",
2642-
int Write(uint16_t* buffer, int start = 0, int length = -1,
2643-
int options = NO_OPTIONS) const);
2645+
V8_DEPRECATED("Use Isolate* version",
2646+
int Write(uint16_t* buffer, int start = 0, int length = -1,
2647+
int options = NO_OPTIONS) const);
26442648
// One byte characters.
26452649
int WriteOneByte(Isolate* isolate, uint8_t* buffer, int start = 0,
26462650
int length = -1, int options = NO_OPTIONS) const;
2647-
V8_DEPRECATE_SOON("Use Isolate* version",
2648-
int WriteOneByte(uint8_t* buffer, int start = 0,
2649-
int length = -1, int options = NO_OPTIONS)
2650-
const);
2651+
V8_DEPRECATED("Use Isolate* version",
2652+
int WriteOneByte(uint8_t* buffer, int start = 0,
2653+
int length = -1, int options = NO_OPTIONS)
2654+
const);
26512655
// UTF-8 encoded characters.
26522656
int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
26532657
int* nchars_ref = NULL, int options = NO_OPTIONS) const;
2654-
V8_DEPRECATE_SOON("Use Isolate* version",
2655-
int WriteUtf8(char* buffer, int length = -1,
2656-
int* nchars_ref = NULL,
2657-
int options = NO_OPTIONS) const);
2658+
V8_DEPRECATED("Use Isolate* version",
2659+
int WriteUtf8(char* buffer, int length = -1,
2660+
int* nchars_ref = NULL,
2661+
int options = NO_OPTIONS) const);
26582662

26592663
/**
26602664
* A zero length string.
@@ -2818,9 +2822,9 @@ class V8_EXPORT String : public Name {
28182822
*/
28192823
static Local<String> Concat(Isolate* isolate, Local<String> left,
28202824
Local<String> right);
2821-
static V8_DEPRECATE_SOON("Use Isolate* version",
2822-
Local<String> Concat(Local<String> left,
2823-
Local<String> right));
2825+
static V8_DEPRECATED("Use Isolate* version",
2826+
Local<String> Concat(Local<String> left,
2827+
Local<String> right));
28242828

28252829
/**
28262830
* Creates a new external string using the data defined in the given
@@ -5044,7 +5048,9 @@ class V8_EXPORT BooleanObject : public Object {
50445048
*/
50455049
class V8_EXPORT StringObject : public Object {
50465050
public:
5047-
static Local<Value> New(Local<String> value);
5051+
static Local<Value> New(Isolate* isolate, Local<String> value);
5052+
V8_DEPRECATED("Use Isolate* version",
5053+
static Local<Value> New(Local<String> value));
50485054

50495055
Local<String> ValueOf() const;
50505056

deps/v8/src/api.cc

+13
Original file line numberDiff line numberDiff line change
@@ -2227,6 +2227,10 @@ int PrimitiveArray::Length() const {
22272227
return array->length();
22282228
}
22292229

2230+
void PrimitiveArray::Set(Isolate* isolate, int index, Local<Primitive> item) {
2231+
return Set(index, item);
2232+
}
2233+
22302234
void PrimitiveArray::Set(int index, Local<Primitive> item) {
22312235
i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
22322236
i::Isolate* isolate = array->GetIsolate();
@@ -2239,6 +2243,10 @@ void PrimitiveArray::Set(int index, Local<Primitive> item) {
22392243
array->set(index, *i_item);
22402244
}
22412245

2246+
Local<Primitive> PrimitiveArray::Get(Isolate* isolate, int index) {
2247+
return Get(index);
2248+
}
2249+
22422250
Local<Primitive> PrimitiveArray::Get(int index) {
22432251
i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
22442252
i::Isolate* isolate = array->GetIsolate();
@@ -6880,6 +6888,11 @@ bool v8::BooleanObject::ValueOf() const {
68806888
}
68816889

68826890

6891+
Local<v8::Value> v8::StringObject::New(Isolate* isolate, Local<String> value) {
6892+
return New(value);
6893+
}
6894+
6895+
68836896
Local<v8::Value> v8::StringObject::New(Local<String> value) {
68846897
i::Handle<i::String> string = Utils::OpenHandle(*value);
68856898
i::Isolate* isolate = string->GetIsolate();

0 commit comments

Comments
 (0)