|
@@ -22,128 +22,129 @@ Reviewed-By: Yang Guo <[email protected]>
|
|
|
Reviewed-By: Michaël Zasso <[email protected]>
|
|
|
|
|
|
diff --git a/include/v8.h b/include/v8.h
|
|
|
-index c5f0436eb771b6ca86fdf8e0dc195221c6b481f4..4c93d92fe36c6712a239c47e42bcb2cb6992cb57 100644
|
|
|
+index fe86e1a17f2cad844ef92f45a8da6e7fee4eba49..3450677471b7276b631ea12a4cd39514c8105b46 100644
|
|
|
--- a/include/v8.h
|
|
|
+++ b/include/v8.h
|
|
|
-@@ -1195,6 +1195,10 @@ class V8_EXPORT PrimitiveArray {
|
|
|
+@@ -1330,6 +1330,10 @@ class V8_EXPORT PrimitiveArray {
|
|
|
public:
|
|
|
static Local<PrimitiveArray> New(Isolate* isolate, int length);
|
|
|
int Length() const;
|
|
|
-+ V8_DEPRECATED("Use Isolate* version",
|
|
|
-+ void Set(int index, Local<Primitive> item));
|
|
|
-+ V8_DEPRECATED("Use Isolate* version",
|
|
|
-+ Local<Primitive> Get(int index));
|
|
|
++ V8_DEPRECATED("Use Isolate* version")
|
|
|
++ void Set(int index, Local<Primitive> item);
|
|
|
++ V8_DEPRECATED("Use Isolate* version")
|
|
|
++ Local<Primitive> Get(int index);
|
|
|
void Set(Isolate* isolate, int index, Local<Primitive> item);
|
|
|
Local<Primitive> Get(Isolate* isolate, int index);
|
|
|
};
|
|
|
-@@ -1935,6 +1939,8 @@ class V8_EXPORT StackTrace {
|
|
|
+@@ -2078,6 +2082,8 @@ class V8_EXPORT StackTrace {
|
|
|
/**
|
|
|
* Returns a StackFrame at a particular index.
|
|
|
*/
|
|
|
-+ V8_DEPRECATED("Use Isolate version",
|
|
|
-+ Local<StackFrame> GetFrame(uint32_t index) const);
|
|
|
++ V8_DEPRECATED("Use Isolate version")
|
|
|
++ Local<StackFrame> GetFrame(uint32_t index) const;
|
|
|
Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
|
|
|
|
|
|
/**
|
|
|
-@@ -2629,6 +2635,13 @@ class V8_EXPORT Value : public Data {
|
|
|
+@@ -2774,6 +2780,15 @@ class V8_EXPORT Value : public Data {
|
|
|
|
|
|
Local<Boolean> ToBoolean(Isolate* isolate) const;
|
|
|
|
|
|
-+ inline V8_DEPRECATED("Use maybe version",
|
|
|
-+ Local<Boolean> ToBoolean() const);
|
|
|
-+ inline V8_DEPRECATED("Use maybe version", Local<String> ToString() const);
|
|
|
-+ inline V8_DEPRECATED("Use maybe version", Local<Object> ToObject() const);
|
|
|
-+ inline V8_DEPRECATED("Use maybe version",
|
|
|
-+ Local<Integer> ToInteger() const);
|
|
|
++ V8_DEPRECATED("Use maybe version")
|
|
|
++ inline Local<Boolean> ToBoolean() const;
|
|
|
++ V8_DEPRECATED("Use maybe version")
|
|
|
++ inline Local<String> ToString() const;
|
|
|
++ V8_DEPRECATED("Use maybe version")
|
|
|
++ inline Local<Object> ToObject() const;
|
|
|
++ V8_DEPRECATED("Use maybe version")
|
|
|
++ inline Local<Integer> ToInteger() const;
|
|
|
+
|
|
|
/**
|
|
|
* Attempts to convert a string to an array index.
|
|
|
* Returns an empty handle if the conversion fails.
|
|
|
-@@ -2645,7 +2658,14 @@ class V8_EXPORT Value : public Data {
|
|
|
+@@ -2790,7 +2805,14 @@ class V8_EXPORT Value : public Data {
|
|
|
Local<Context> context) const;
|
|
|
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
|
|
|
|
|
|
-+ V8_DEPRECATED("Use maybe version", bool BooleanValue() const);
|
|
|
-+ V8_DEPRECATED("Use maybe version", double NumberValue() const);
|
|
|
-+ V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
|
|
|
-+ V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const);
|
|
|
-+ V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
|
|
|
++ V8_DEPRECATED("Use maybe version") bool BooleanValue() const;
|
|
|
++ V8_DEPRECATED("Use maybe version") double NumberValue() const;
|
|
|
++ V8_DEPRECATED("Use maybe version") int64_t IntegerValue() const;
|
|
|
++ V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
|
|
|
++ V8_DEPRECATED("Use maybe version") int32_t Int32Value() const;
|
|
|
+
|
|
|
/** JS == */
|
|
|
-+ V8_DEPRECATED("Use maybe version", bool Equals(Local<Value> that) const);
|
|
|
++ V8_DEPRECATED("Use maybe version") bool Equals(Local<Value> that) const;
|
|
|
V8_WARN_UNUSED_RESULT Maybe<bool> Equals(Local<Context> context,
|
|
|
Local<Value> that) const;
|
|
|
bool StrictEquals(Local<Value> that) const;
|
|
|
-@@ -2752,6 +2772,8 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -2897,6 +2919,8 @@ class V8_EXPORT String : public Name {
|
|
|
* Returns the number of bytes in the UTF-8 encoded
|
|
|
* representation of this string.
|
|
|
*/
|
|
|
-+ V8_DEPRECATED("Use Isolate version instead", int Utf8Length() const);
|
|
|
++ V8_DEPRECATED("Use Isolate version instead") int Utf8Length() const;
|
|
|
+
|
|
|
int Utf8Length(Isolate* isolate) const;
|
|
|
|
|
|
/**
|
|
|
-@@ -2808,12 +2830,23 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -2953,12 +2977,22 @@ class V8_EXPORT String : public Name {
|
|
|
// 16-bit character codes.
|
|
|
int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1,
|
|
|
int options = NO_OPTIONS) const;
|
|
|
-+ V8_DEPRECATED("Use Isolate* version",
|
|
|
-+ int Write(uint16_t* buffer, int start = 0, int length = -1,
|
|
|
-+ int options = NO_OPTIONS) const);
|
|
|
++ V8_DEPRECATED("Use Isolate* version")
|
|
|
++ int Write(uint16_t* buffer, int start = 0, int length = -1,
|
|
|
++ int options = NO_OPTIONS) const;
|
|
|
// One byte characters.
|
|
|
int WriteOneByte(Isolate* isolate, uint8_t* buffer, int start = 0,
|
|
|
int length = -1, int options = NO_OPTIONS) const;
|
|
|
-+ V8_DEPRECATED("Use Isolate* version",
|
|
|
-+ int WriteOneByte(uint8_t* buffer, int start = 0,
|
|
|
-+ int length = -1, int options = NO_OPTIONS)
|
|
|
-+ const);
|
|
|
++ V8_DEPRECATED("Use Isolate* version")
|
|
|
++ int WriteOneByte(uint8_t* buffer, int start = 0,
|
|
|
++ int length = -1, int options = NO_OPTIONS) const;
|
|
|
// UTF-8 encoded characters.
|
|
|
int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
|
|
|
int* nchars_ref = nullptr, int options = NO_OPTIONS) const;
|
|
|
-+ V8_DEPRECATED("Use Isolate* version",
|
|
|
-+ int WriteUtf8(char* buffer, int length = -1,
|
|
|
-+ int* nchars_ref = nullptr,
|
|
|
-+ int options = NO_OPTIONS) const);
|
|
|
++ V8_DEPRECATED("Use Isolate* version")
|
|
|
++ int WriteUtf8(char* buffer, int length = -1,
|
|
|
++ int* nchars_ref = nullptr,
|
|
|
++ int options = NO_OPTIONS) const;
|
|
|
|
|
|
/**
|
|
|
* A zero length string.
|
|
|
-@@ -2981,6 +3014,9 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -3126,6 +3160,8 @@ class V8_EXPORT String : public Name {
|
|
|
*/
|
|
|
static Local<String> Concat(Isolate* isolate, Local<String> left,
|
|
|
Local<String> right);
|
|
|
-+ static V8_DEPRECATED("Use Isolate* version",
|
|
|
-+ Local<String> Concat(Local<String> left,
|
|
|
-+ Local<String> right));
|
|
|
++ V8_DEPRECATED("Use Isolate* version")
|
|
|
++ static Local<String> Concat(Local<String> left, Local<String> right);
|
|
|
|
|
|
/**
|
|
|
* Creates a new external string using the data defined in the given
|
|
|
-@@ -3045,6 +3081,8 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -3190,6 +3226,8 @@ class V8_EXPORT String : public Name {
|
|
|
*/
|
|
|
class V8_EXPORT Utf8Value {
|
|
|
public:
|
|
|
-+ V8_DEPRECATED("Use Isolate version",
|
|
|
-+ explicit Utf8Value(Local<v8::Value> obj));
|
|
|
++ V8_DEPRECATED("Use Isolate version")
|
|
|
++ explicit Utf8Value(Local<v8::Value> obj);
|
|
|
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
|
|
|
~Utf8Value();
|
|
|
char* operator*() { return str_; }
|
|
|
-@@ -3068,6 +3106,7 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -3213,6 +3251,8 @@ class V8_EXPORT String : public Name {
|
|
|
*/
|
|
|
class V8_EXPORT Value {
|
|
|
public:
|
|
|
-+ V8_DEPRECATED("Use Isolate version", explicit Value(Local<v8::Value> obj));
|
|
|
++ V8_DEPRECATED("Use Isolate version")
|
|
|
++ explicit Value(Local<v8::Value> obj);
|
|
|
Value(Isolate* isolate, Local<v8::Value> obj);
|
|
|
~Value();
|
|
|
uint16_t* operator*() { return str_; }
|
|
|
-@@ -5407,6 +5446,8 @@ class V8_EXPORT BooleanObject : public Object {
|
|
|
+@@ -5689,6 +5729,8 @@ class V8_EXPORT BooleanObject : public Object {
|
|
|
class V8_EXPORT StringObject : public Object {
|
|
|
public:
|
|
|
static Local<Value> New(Isolate* isolate, Local<String> value);
|
|
|
-+ V8_DEPRECATED("Use Isolate* version",
|
|
|
-+ static Local<Value> New(Local<String> value));
|
|
|
++ V8_DEPRECATED("Use Isolate* version")
|
|
|
++ static Local<Value> New(Local<String> value);
|
|
|
|
|
|
Local<String> ValueOf() const;
|
|
|
|
|
|
-@@ -10741,6 +10782,29 @@ template <class T> Value* Value::Cast(T* value) {
|
|
|
+@@ -11131,6 +11173,29 @@ template <class T> Value* Value::Cast(T* value) {
|
|
|
}
|
|
|
|
|
|
|
|
@@ -174,10 +175,10 @@ index c5f0436eb771b6ca86fdf8e0dc195221c6b481f4..4c93d92fe36c6712a239c47e42bcb2cb
|
|
|
#ifdef V8_ENABLE_CHECKS
|
|
|
CheckCast(value);
|
|
|
diff --git a/src/api/api.cc b/src/api/api.cc
|
|
|
-index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f0d03f652 100644
|
|
|
+index f6f2ba988d95660637f6733dafdd12db7acaa992..d753abd5d2d7e788b7dd96a200d5be0d85f87fe3 100644
|
|
|
--- a/src/api/api.cc
|
|
|
+++ b/src/api/api.cc
|
|
|
-@@ -2206,6 +2206,10 @@ int PrimitiveArray::Length() const {
|
|
|
+@@ -2199,6 +2199,10 @@ int PrimitiveArray::Length() const {
|
|
|
return array->length();
|
|
|
}
|
|
|
|
|
@@ -188,7 +189,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
void PrimitiveArray::Set(Isolate* v8_isolate, int index,
|
|
|
Local<Primitive> item) {
|
|
|
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
|
|
-@@ -2219,6 +2223,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index,
|
|
|
+@@ -2212,6 +2216,10 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index,
|
|
|
array->set(index, *i_item);
|
|
|
}
|
|
|
|
|
@@ -199,7 +200,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
Local<Primitive> PrimitiveArray::Get(Isolate* v8_isolate, int index) {
|
|
|
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
|
|
i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
|
|
|
-@@ -2960,6 +2968,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
|
|
|
+@@ -2975,6 +2983,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
|
|
|
|
|
|
// --- S t a c k T r a c e ---
|
|
|
|
|
@@ -210,7 +211,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
|
|
|
uint32_t index) const {
|
|
|
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
|
|
-@@ -3547,6 +3559,34 @@ MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
|
|
|
+@@ -3562,6 +3574,34 @@ MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
|
|
|
RETURN_ESCAPED(result);
|
|
|
}
|
|
|
|
|
@@ -245,7 +246,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
bool Value::BooleanValue(Isolate* v8_isolate) const {
|
|
|
return Utils::OpenHandle(this)->BooleanValue(
|
|
|
reinterpret_cast<i::Isolate*>(v8_isolate));
|
|
|
-@@ -3894,6 +3934,11 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
|
|
|
+@@ -3951,6 +3991,11 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
|
|
|
return Local<Uint32>();
|
|
|
}
|
|
|
|
|
@@ -257,7 +258,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
|
|
|
i::Isolate* isolate = Utils::OpenHandle(*context)->GetIsolate();
|
|
|
auto self = Utils::OpenHandle(this);
|
|
|
-@@ -5111,6 +5156,10 @@ bool String::ContainsOnlyOneByte() const {
|
|
|
+@@ -5168,6 +5213,10 @@ bool String::ContainsOnlyOneByte() const {
|
|
|
return helper.Check(*str);
|
|
|
}
|
|
|
|
|
@@ -268,7 +269,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
int String::Utf8Length(Isolate* isolate) const {
|
|
|
i::Handle<i::String> str = Utils::OpenHandle(this);
|
|
|
str = i::String::Flatten(reinterpret_cast<i::Isolate*>(isolate), str);
|
|
|
-@@ -5263,6 +5312,14 @@ static int WriteUtf8Impl(i::Vector<const Char> string, char* write_start,
|
|
|
+@@ -5320,6 +5369,14 @@ static int WriteUtf8Impl(i::Vector<const Char> string, char* write_start,
|
|
|
}
|
|
|
} // anonymous namespace
|
|
|
|
|
@@ -283,7 +284,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity,
|
|
|
int* nchars_ref, int options) const {
|
|
|
i::Handle<i::String> str = Utils::OpenHandle(this);
|
|
|
-@@ -5301,6 +5358,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
|
|
|
+@@ -5358,6 +5415,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
|
|
|
return end - start;
|
|
|
}
|
|
|
|
|
@@ -301,7 +302,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
int String::WriteOneByte(Isolate* isolate, uint8_t* buffer, int start,
|
|
|
int length, int options) const {
|
|
|
return WriteHelper(reinterpret_cast<i::Isolate*>(isolate), this, buffer,
|
|
|
-@@ -6218,6 +6286,11 @@ MaybeLocal<String> String::NewFromTwoByte(Isolate* isolate,
|
|
|
+@@ -6269,6 +6337,11 @@ MaybeLocal<String> String::NewFromTwoByte(Isolate* isolate,
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -313,7 +314,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
|
|
|
Local<String> right) {
|
|
|
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
|
|
-@@ -6488,6 +6561,10 @@ bool v8::BooleanObject::ValueOf() const {
|
|
|
+@@ -6539,6 +6612,10 @@ bool v8::BooleanObject::ValueOf() const {
|
|
|
return js_primitive_wrapper->value().IsTrue(isolate);
|
|
|
}
|
|
|
|
|
@@ -324,7 +325,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate,
|
|
|
Local<String> value) {
|
|
|
i::Handle<i::String> string = Utils::OpenHandle(*value);
|
|
|
-@@ -8874,6 +8951,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) {
|
|
|
+@@ -9078,6 +9155,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) {
|
|
|
return microtask_queue->IsRunningMicrotasks();
|
|
|
}
|
|
|
|
|
@@ -334,7 +335,7 @@ index e9e46fd117dbf67a0fb7bdf560e152daa8624ff8..11ca1064085568986b8d21250dd8617f
|
|
|
String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
|
|
: str_(nullptr), length_(0) {
|
|
|
if (obj.IsEmpty()) return;
|
|
|
-@@ -8891,6 +8971,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
|
|
+@@ -9095,6 +9175,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
|
|
|
|
|
String::Utf8Value::~Utf8Value() { i::DeleteArray(str_); }
|
|
|
|