mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-08 22:11:52 +00:00
Use v8's CopyablePersistentTraits for v8 >= 3.22.0
This commit is contained in:
parent
619231913c
commit
386465570d
@ -28,6 +28,9 @@ extern "C" {
|
|||||||
#include <v8.h>
|
#include <v8.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#if PHP_V8_API_VERSION < 3022000
|
||||||
|
/* CopyablePersistentTraits is only part of V8 from 3.22.0 on,
|
||||||
|
to be compatible with lower versions add our own (compatible) version. */
|
||||||
namespace v8 {
|
namespace v8 {
|
||||||
template<class T>
|
template<class T>
|
||||||
struct CopyablePersistentTraits {
|
struct CopyablePersistentTraits {
|
||||||
@ -40,7 +43,7 @@ namespace v8 {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef std::pair<struct php_v8js_ctx *, const char *> TemplateCacheKey;
|
typedef std::pair<struct php_v8js_ctx *, const char *> TemplateCacheKey;
|
||||||
typedef v8::Persistent<v8::FunctionTemplate, v8::CopyablePersistentTraits<v8::FunctionTemplate> > TemplateCacheEntry;
|
typedef v8::Persistent<v8::FunctionTemplate, v8::CopyablePersistentTraits<v8::FunctionTemplate> > TemplateCacheEntry;
|
||||||
|
Loading…
Reference in New Issue
Block a user