@@ -53,7 +53,7 @@ extern const zend_function_entry v8js_methods[];
53
53
typedef struct _v8js_script {
54
54
char *name;
55
55
v8js_ctx *ctx;
56
- v8::Persistent <v8::Script, v8::CopyablePersistentTraits<v8::Script> > *script;
56
+ v8::Global <v8::Script> *script;
57
57
} v8js_script;
58
58
59
59
static void v8js_script_free (v8js_script *res);
@@ -95,11 +95,11 @@ static void v8js_free_storage(zend_object *object) /* {{{ */
95
95
}
96
96
97
97
c->object_name .Reset ();
98
- c->object_name .~Persistent ();
98
+ c->object_name .~Global ();
99
99
c->global_template .Reset ();
100
- c->global_template .~Persistent ();
100
+ c->global_template .~Global ();
101
101
c->array_tmpl .Reset ();
102
- c->array_tmpl .~Persistent ();
102
+ c->array_tmpl .~Global ();
103
103
104
104
/* Clear persistent call_impl & method_tmpls templates */
105
105
for (std::map<v8js_function_tmpl_t *, v8js_function_tmpl_t >::iterator it = c->call_impls .begin ();
@@ -133,7 +133,7 @@ static void v8js_free_storage(zend_object *object) /* {{{ */
133
133
if (!c->context .IsEmpty ()) {
134
134
c->context .Reset ();
135
135
}
136
- c->context .~Persistent ();
136
+ c->context .~Global ();
137
137
138
138
/* Dispose yet undisposed weak refs */
139
139
for (std::map<zend_object *, v8js_persistent_obj_t >::iterator it = c->weak_objects .begin ();
@@ -208,10 +208,10 @@ static zend_object* v8js_new(zend_class_entry *ce) /* {{{ */
208
208
209
209
c->std .handlers = &v8js_object_handlers;
210
210
211
- new (&c->object_name ) v8::Persistent <v8::String>();
212
- new (&c->context ) v8::Persistent <v8::Context>();
213
- new (&c->global_template ) v8::Persistent <v8::FunctionTemplate>();
214
- new (&c->array_tmpl ) v8::Persistent <v8::FunctionTemplate>();
211
+ new (&c->object_name ) v8::Global <v8::String>();
212
+ new (&c->context ) v8::Global <v8::Context>();
213
+ new (&c->global_template ) v8::Global <v8::FunctionTemplate>();
214
+ new (&c->array_tmpl ) v8::Global <v8::FunctionTemplate>();
215
215
216
216
new (&c->modules_stack ) std::vector<char *>();
217
217
new (&c->modules_loaded ) std::map<char *, v8js_persistent_value_t , cmp_str>;
@@ -541,7 +541,7 @@ static void v8js_compile_script(zval *this_ptr, const zend_string *str, const ze
541
541
return ;
542
542
}
543
543
res = (v8js_script *)emalloc (sizeof (v8js_script));
544
- res->script = new v8::Persistent <v8::Script, v8::CopyablePersistentTraits<v8::Script> >(c->isolate , script.ToLocalChecked ());
544
+ res->script = new v8::Global <v8::Script>(c->isolate , script.ToLocalChecked ());
545
545
546
546
v8::String::Utf8Value _sname (isolate, sname);
547
547
res->name = estrndup (ToCString (_sname), _sname.length ());
0 commit comments