|
@@ -22,7 +22,7 @@ Reviewed-By: Yang Guo <[email protected]>
|
|
|
Reviewed-By: Michaël Zasso <[email protected]>
|
|
|
|
|
|
diff --git a/include/v8.h b/include/v8.h
|
|
|
-index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748bad6655710 100644
|
|
|
+index 6d5a9a08a6d5fb98893f996e1f0b9432e3899853..dc5d3ba4c06d19948b5610ce830ab51bdcf45cb7 100644
|
|
|
--- a/include/v8.h
|
|
|
+++ b/include/v8.h
|
|
|
@@ -1108,6 +1108,10 @@ class V8_EXPORT PrimitiveArray {
|
|
@@ -36,7 +36,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
void Set(Isolate* isolate, int index, Local<Primitive> item);
|
|
|
Local<Primitive> Get(Isolate* isolate, int index);
|
|
|
};
|
|
|
-@@ -1816,6 +1820,8 @@ class V8_EXPORT StackTrace {
|
|
|
+@@ -1844,6 +1848,8 @@ class V8_EXPORT StackTrace {
|
|
|
/**
|
|
|
* Returns a StackFrame at a particular index.
|
|
|
*/
|
|
@@ -45,7 +45,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
|
|
|
|
|
|
/**
|
|
|
-@@ -2509,6 +2515,13 @@ class V8_EXPORT Value : public Data {
|
|
|
+@@ -2537,6 +2543,13 @@ class V8_EXPORT Value : public Data {
|
|
|
|
|
|
Local<Boolean> ToBoolean(Isolate* isolate) const;
|
|
|
|
|
@@ -59,7 +59,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
/**
|
|
|
* Attempts to convert a string to an array index.
|
|
|
* Returns an empty handle if the conversion fails.
|
|
|
-@@ -2525,7 +2538,14 @@ class V8_EXPORT Value : public Data {
|
|
|
+@@ -2553,7 +2566,14 @@ class V8_EXPORT Value : public Data {
|
|
|
Local<Context> context) const;
|
|
|
V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
|
|
|
|
|
@@ -74,7 +74,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
V8_WARN_UNUSED_RESULT Maybe<bool> Equals(Local<Context> context,
|
|
|
Local<Value> that) const;
|
|
|
bool StrictEquals(Local<Value> that) const;
|
|
|
-@@ -2632,6 +2652,8 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -2660,6 +2680,8 @@ class V8_EXPORT String : public Name {
|
|
|
* Returns the number of bytes in the UTF-8 encoded
|
|
|
* representation of this string.
|
|
|
*/
|
|
@@ -83,7 +83,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
int Utf8Length(Isolate* isolate) const;
|
|
|
|
|
|
/**
|
|
|
-@@ -2688,12 +2710,23 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -2716,12 +2738,23 @@ 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;
|
|
@@ -107,7 +107,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
|
|
|
/**
|
|
|
* A zero length string.
|
|
|
-@@ -2861,6 +2894,9 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -2889,6 +2922,9 @@ class V8_EXPORT String : public Name {
|
|
|
*/
|
|
|
static Local<String> Concat(Isolate* isolate, Local<String> left,
|
|
|
Local<String> right);
|
|
@@ -117,7 +117,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
|
|
|
/**
|
|
|
* Creates a new external string using the data defined in the given
|
|
|
-@@ -2925,6 +2961,8 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -2953,6 +2989,8 @@ class V8_EXPORT String : public Name {
|
|
|
*/
|
|
|
class V8_EXPORT Utf8Value {
|
|
|
public:
|
|
@@ -126,7 +126,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
|
|
|
~Utf8Value();
|
|
|
char* operator*() { return str_; }
|
|
|
-@@ -2948,6 +2986,7 @@ class V8_EXPORT String : public Name {
|
|
|
+@@ -2976,6 +3014,7 @@ class V8_EXPORT String : public Name {
|
|
|
*/
|
|
|
class V8_EXPORT Value {
|
|
|
public:
|
|
@@ -134,7 +134,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
Value(Isolate* isolate, Local<v8::Value> obj);
|
|
|
~Value();
|
|
|
uint16_t* operator*() { return str_; }
|
|
|
-@@ -5275,6 +5314,8 @@ class V8_EXPORT BooleanObject : public Object {
|
|
|
+@@ -5303,6 +5342,8 @@ class V8_EXPORT BooleanObject : public Object {
|
|
|
class V8_EXPORT StringObject : public Object {
|
|
|
public:
|
|
|
static Local<Value> New(Isolate* isolate, Local<String> value);
|
|
@@ -143,7 +143,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
|
|
|
Local<String> ValueOf() const;
|
|
|
|
|
|
-@@ -10461,6 +10502,29 @@ template <class T> Value* Value::Cast(T* value) {
|
|
|
+@@ -10491,6 +10532,29 @@ template <class T> Value* Value::Cast(T* value) {
|
|
|
}
|
|
|
|
|
|
|
|
@@ -174,7 +174,7 @@ index a1043c455e226fd9773dce536748de7bb5779977..aafd041326f1ba85bdba8bc3a16748ba
|
|
|
#ifdef V8_ENABLE_CHECKS
|
|
|
CheckCast(value);
|
|
|
diff --git a/src/api/api.cc b/src/api/api.cc
|
|
|
-index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f88737d43638 100644
|
|
|
+index 9f115276c549429e2f9a9e7b3289e8ac79e8e766..e934f1452c83a57066f21ebd007b9283acaa40aa 100644
|
|
|
--- a/src/api/api.cc
|
|
|
+++ b/src/api/api.cc
|
|
|
@@ -2182,6 +2182,10 @@ int PrimitiveArray::Length() const {
|
|
@@ -199,7 +199,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
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);
|
|
|
-@@ -2890,6 +2898,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
|
|
|
+@@ -2922,6 +2930,10 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
|
|
|
|
|
|
// --- S t a c k T r a c e ---
|
|
|
|
|
@@ -210,7 +210,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
|
|
|
uint32_t index) const {
|
|
|
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
|
|
-@@ -3477,6 +3489,34 @@ MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
|
|
|
+@@ -3509,6 +3521,34 @@ MaybeLocal<BigInt> Value::ToBigInt(Local<Context> context) const {
|
|
|
RETURN_ESCAPED(result);
|
|
|
}
|
|
|
|
|
@@ -245,7 +245,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
bool Value::BooleanValue(Isolate* v8_isolate) const {
|
|
|
return Utils::OpenHandle(this)->BooleanValue(
|
|
|
reinterpret_cast<i::Isolate*>(v8_isolate));
|
|
|
-@@ -3824,6 +3864,11 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
|
|
|
+@@ -3856,6 +3896,11 @@ MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
|
|
|
return Local<Uint32>();
|
|
|
}
|
|
|
|
|
@@ -257,7 +257,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
|
|
|
i::Isolate* isolate = Utils::OpenHandle(*context)->GetIsolate();
|
|
|
auto self = Utils::OpenHandle(this);
|
|
|
-@@ -5036,6 +5081,10 @@ bool String::ContainsOnlyOneByte() const {
|
|
|
+@@ -5068,6 +5113,10 @@ bool String::ContainsOnlyOneByte() const {
|
|
|
return helper.Check(*str);
|
|
|
}
|
|
|
|
|
@@ -268,7 +268,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
int String::Utf8Length(Isolate* isolate) const {
|
|
|
i::Handle<i::String> str = Utils::OpenHandle(this);
|
|
|
str = i::String::Flatten(reinterpret_cast<i::Isolate*>(isolate), str);
|
|
|
-@@ -5188,6 +5237,14 @@ static int WriteUtf8Impl(i::Vector<const Char> string, char* write_start,
|
|
|
+@@ -5220,6 +5269,14 @@ static int WriteUtf8Impl(i::Vector<const Char> string, char* write_start,
|
|
|
}
|
|
|
} // anonymous namespace
|
|
|
|
|
@@ -283,7 +283,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity,
|
|
|
int* nchars_ref, int options) const {
|
|
|
i::Handle<i::String> str = Utils::OpenHandle(this);
|
|
|
-@@ -5226,6 +5283,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
|
|
|
+@@ -5258,6 +5315,17 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
|
|
|
return end - start;
|
|
|
}
|
|
|
|
|
@@ -301,7 +301,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
int String::WriteOneByte(Isolate* isolate, uint8_t* buffer, int start,
|
|
|
int length, int options) const {
|
|
|
return WriteHelper(reinterpret_cast<i::Isolate*>(isolate), this, buffer,
|
|
|
-@@ -6143,6 +6211,11 @@ MaybeLocal<String> String::NewFromTwoByte(Isolate* isolate,
|
|
|
+@@ -6175,6 +6243,11 @@ MaybeLocal<String> String::NewFromTwoByte(Isolate* isolate,
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -313,7 +313,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
|
|
|
Local<String> right) {
|
|
|
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
|
|
-@@ -6413,6 +6486,10 @@ bool v8::BooleanObject::ValueOf() const {
|
|
|
+@@ -6445,6 +6518,10 @@ bool v8::BooleanObject::ValueOf() const {
|
|
|
return js_primitive_wrapper->value().IsTrue(isolate);
|
|
|
}
|
|
|
|
|
@@ -324,7 +324,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate,
|
|
|
Local<String> value) {
|
|
|
i::Handle<i::String> string = Utils::OpenHandle(*value);
|
|
|
-@@ -8611,6 +8688,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) {
|
|
|
+@@ -8652,6 +8729,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8_isolate) {
|
|
|
return microtask_queue->IsRunningMicrotasks();
|
|
|
}
|
|
|
|
|
@@ -334,7 +334,7 @@ index b0e754852fab7f657aa8fa86d424bd2bbc23b712..ed57632474900e2f9ad824d26f62f887
|
|
|
String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
|
|
: str_(nullptr), length_(0) {
|
|
|
if (obj.IsEmpty()) return;
|
|
|
-@@ -8628,6 +8708,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
|
|
+@@ -8669,6 +8749,9 @@ String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
|
|
|
|
|
|
String::Utf8Value::~Utf8Value() { i::DeleteArray(str_); }
|
|
|
|