mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 12:51:52 +00:00
cleanup: remove no longer needed modules_base from ctx, refs #349
This commit is contained in:
parent
e8fe553bde
commit
313ad1e258
@ -200,7 +200,6 @@ static void v8js_free_storage(zend_object *object) /* {{{ */
|
|||||||
}
|
}
|
||||||
|
|
||||||
c->modules_stack.~vector();
|
c->modules_stack.~vector();
|
||||||
c->modules_base.~vector();
|
|
||||||
|
|
||||||
zval_ptr_dtor(&c->zval_snapshot_blob);
|
zval_ptr_dtor(&c->zval_snapshot_blob);
|
||||||
|
|
||||||
@ -226,7 +225,6 @@ static zend_object* v8js_new(zend_class_entry *ce) /* {{{ */
|
|||||||
new(&c->array_tmpl) v8::Persistent<v8::FunctionTemplate>();
|
new(&c->array_tmpl) v8::Persistent<v8::FunctionTemplate>();
|
||||||
|
|
||||||
new(&c->modules_stack) std::vector<char*>();
|
new(&c->modules_stack) std::vector<char*>();
|
||||||
new(&c->modules_base) std::vector<char*>();
|
|
||||||
new(&c->modules_loaded) std::map<char *, v8js_persistent_value_t, cmp_str>;
|
new(&c->modules_loaded) std::map<char *, v8js_persistent_value_t, cmp_str>;
|
||||||
|
|
||||||
new(&c->template_cache) std::map<const zend_string *,v8js_function_tmpl_t>();
|
new(&c->template_cache) std::map<const zend_string *,v8js_function_tmpl_t>();
|
||||||
|
@ -57,7 +57,6 @@ struct v8js_ctx {
|
|||||||
zval module_loader;
|
zval module_loader;
|
||||||
|
|
||||||
std::vector<char *> modules_stack;
|
std::vector<char *> modules_stack;
|
||||||
std::vector<char *> modules_base;
|
|
||||||
std::map<char *, v8js_persistent_value_t, cmp_str> modules_loaded;
|
std::map<char *, v8js_persistent_value_t, cmp_str> modules_loaded;
|
||||||
std::map<const zend_string *,v8js_function_tmpl_t> template_cache;
|
std::map<const zend_string *,v8js_function_tmpl_t> template_cache;
|
||||||
|
|
||||||
|
@ -472,7 +472,6 @@ V8JS_METHOD(require)
|
|||||||
|
|
||||||
// Add this module and path to the stack
|
// Add this module and path to the stack
|
||||||
c->modules_stack.push_back(normalised_module_id);
|
c->modules_stack.push_back(normalised_module_id);
|
||||||
c->modules_base.push_back(normalised_path);
|
|
||||||
|
|
||||||
// Run script to evaluate closure
|
// Run script to evaluate closure
|
||||||
v8::Local<v8::Value> module_function = script->Run();
|
v8::Local<v8::Value> module_function = script->Run();
|
||||||
@ -501,7 +500,6 @@ V8JS_METHOD(require)
|
|||||||
|
|
||||||
// Remove this module and path from the stack
|
// Remove this module and path from the stack
|
||||||
c->modules_stack.pop_back();
|
c->modules_stack.pop_back();
|
||||||
c->modules_base.pop_back();
|
|
||||||
|
|
||||||
efree(normalised_path);
|
efree(normalised_path);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user