Skip to content

Commit eb1a159

Browse files
committed
* 兼容新版v8
1 parent 8689ba1 commit eb1a159

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

v8_4_8/include/sys-info.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define V8_BASE_SYS_INFO_H_
77

88
#include <stdint.h>
9-
#include "src/base/compiler-specific.h"
9+
//#include "src/base/compiler-specific.h"
1010

1111
namespace v8 {
1212
namespace base {

v8_4_8/include/v8-debug.h

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class V8_EXPORT Debug {
155155
*/
156156
typedef void (*DebugMessageDispatchHandler)();
157157

158+
static bool SetDebugEventListener(Isolate* isolate, EventCallback that, Local<Value> data = Local<Value>()) { return SetDebugEventListener(that, data); }
158159
static bool SetDebugEventListener(EventCallback that,
159160
Local<Value> data = Local<Value>());
160161

@@ -252,6 +253,7 @@ class V8_EXPORT Debug {
252253
* least one DebugEventListener or MessageHandler is set.
253254
*/
254255
static Local<Context> GetDebugContext();
256+
static Local<Context> GetDebugContext(Isolate* isolate) { return GetDebugContext(); }
255257

256258

257259
/**

v8_4_8/include/v8.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,8 @@ class V8_EXPORT StackTrace {
15421542
* Returns a StackFrame at a particular index.
15431543
*/
15441544
Local<StackFrame> GetFrame(uint32_t index) const;
1545-
1545+
Local<StackFrame> GetFrame(v8::Isolate* isolate, uint32_t index) const { return GetFrame(index); }
1546+
15461547
/**
15471548
* Returns the number of StackFrames.
15481549
*/
@@ -2006,6 +2007,7 @@ class V8_EXPORT Value : public Data {
20062007
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToArrayIndex(
20072008
Local<Context> context) const;
20082009

2010+
bool BooleanValue(Isolate* isolate) const { return BooleanValue(); }
20092011
V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(Local<Context> context) const;
20102012
V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
20112013
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
@@ -2105,6 +2107,7 @@ class V8_EXPORT String : public Name {
21052107
* representation of this string.
21062108
*/
21072109
int Utf8Length() const;
2110+
int Utf8Length(Isolate*) const { return Utf8Length(); }
21082111

21092112
/**
21102113
* Returns whether this string is known to contain only one byte data.
@@ -2170,6 +2173,9 @@ class V8_EXPORT String : public Name {
21702173
int length = -1,
21712174
int* nchars_ref = NULL,
21722175
int options = NO_OPTIONS) const;
2176+
int WriteUtf8(Isolate* isolate, char* buffer, int length = -1, int* nchars_ref = NULL, int options = NO_OPTIONS) const {
2177+
return WriteUtf8(buffer, length, nchars_ref, options);
2178+
}
21732179

21742180
/**
21752181
* A zero length string.
@@ -2404,6 +2410,7 @@ class V8_EXPORT String : public Name {
24042410
class V8_EXPORT Utf8Value {
24052411
public:
24062412
explicit Utf8Value(Local<v8::Value> obj);
2413+
explicit Utf8Value(Isolate* isolate, Local<v8::Value> obj);
24072414
~Utf8Value();
24082415
char* operator*() { return str_; }
24092416
const char* operator*() const { return str_; }
@@ -3947,6 +3954,7 @@ class V8_EXPORT NumberObject : public Object {
39473954
class V8_EXPORT BooleanObject : public Object {
39483955
public:
39493956
static Local<Value> New(bool value);
3957+
static Local<Value> New(Isolate* isolate, bool value) { return New(value); }
39503958

39513959
bool ValueOf() const;
39523960

@@ -3963,6 +3971,7 @@ class V8_EXPORT BooleanObject : public Object {
39633971
class V8_EXPORT StringObject : public Object {
39643972
public:
39653973
static Local<Value> New(Local<String> value);
3974+
static Local<Value> New(Isolate* isolate, Local<String> value) { return New(value); }
39663975

39673976
Local<String> ValueOf() const;
39683977

@@ -4937,6 +4946,7 @@ class V8_EXPORT Exception {
49374946
* or capture the current stack trace if not available.
49384947
*/
49394948
static Local<Message> CreateMessage(Local<Value> exception);
4949+
static Local<Message> CreateMessage(Isolate* isolate, Local<Value> exception) { return CreateMessage(exception); }
49404950

49414951
/**
49424952
* Returns the original stack trace that was captured at the creation time

v8_4_8/src/api.cc

+4
Original file line numberDiff line numberDiff line change
@@ -7645,6 +7645,10 @@ void Isolate::VisitWeakHandles(PersistentHandleVisitor* visitor) {
76457645
}
76467646

76477647

7648+
String::Utf8Value::Utf8Value(Isolate* isolate, v8::Local<v8::Value> obj)
7649+
: Utf8Value(obj) {
7650+
}
7651+
76487652
String::Utf8Value::Utf8Value(v8::Local<v8::Value> obj)
76497653
: str_(NULL), length_(0) {
76507654
if (obj.IsEmpty()) return;

0 commit comments

Comments
 (0)