|
@@ -89,6 +89,10 @@ static void v8js_free_storage(void *object TSRMLS_DC) /* {{{ */
|
|
zval_ptr_dtor(&c->pending_exception);
|
|
zval_ptr_dtor(&c->pending_exception);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (c->module_normaliser) {
|
|
|
|
+ zval_ptr_dtor(&c->module_normaliser);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (c->module_loader) {
|
|
if (c->module_loader) {
|
|
zval_ptr_dtor(&c->module_loader);
|
|
zval_ptr_dtor(&c->module_loader);
|
|
}
|
|
}
|
|
@@ -362,6 +366,7 @@ static PHP_METHOD(V8Js, __construct)
|
|
c->memory_limit = 0;
|
|
c->memory_limit = 0;
|
|
c->memory_limit_hit = false;
|
|
c->memory_limit_hit = false;
|
|
|
|
|
|
|
|
+ c->module_normaliser = NULL;
|
|
c->module_loader = NULL;
|
|
c->module_loader = NULL;
|
|
|
|
|
|
/* Include extensions used by this context */
|
|
/* Include extensions used by this context */
|
|
@@ -687,6 +692,24 @@ static PHP_METHOD(V8Js, clearPendingException)
|
|
}
|
|
}
|
|
/* }}} */
|
|
/* }}} */
|
|
|
|
|
|
|
|
+/* {{{ proto void V8Js::setModuleNormaliser(string base, string module_id)
|
|
|
|
+ */
|
|
|
|
+static PHP_METHOD(V8Js, setModuleNormaliser)
|
|
|
|
+{
|
|
|
|
+ v8js_ctx *c;
|
|
|
|
+ zval *callable;
|
|
|
|
+
|
|
|
|
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callable) == FAILURE) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ c = (v8js_ctx *) zend_object_store_get_object(getThis() TSRMLS_CC);
|
|
|
|
+
|
|
|
|
+ c->module_normaliser = callable;
|
|
|
|
+ Z_ADDREF_P(c->module_normaliser);
|
|
|
|
+}
|
|
|
|
+/* }}} */
|
|
|
|
+
|
|
/* {{{ proto void V8Js::setModuleLoader(string module)
|
|
/* {{{ proto void V8Js::setModuleLoader(string module)
|
|
*/
|
|
*/
|
|
static PHP_METHOD(V8Js, setModuleLoader)
|
|
static PHP_METHOD(V8Js, setModuleLoader)
|
|
@@ -1005,6 +1028,11 @@ ZEND_END_ARG_INFO()
|
|
ZEND_BEGIN_ARG_INFO(arginfo_v8js_clearpendingexception, 0)
|
|
ZEND_BEGIN_ARG_INFO(arginfo_v8js_clearpendingexception, 0)
|
|
ZEND_END_ARG_INFO()
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(arginfo_v8js_setmodulenormaliser, 0, 0, 2)
|
|
|
|
+ ZEND_ARG_INFO(0, base)
|
|
|
|
+ ZEND_ARG_INFO(0, module_id)
|
|
|
|
+ZEND_END_ARG_INFO()
|
|
|
|
+
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_v8js_setmoduleloader, 0, 0, 1)
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_v8js_setmoduleloader, 0, 0, 1)
|
|
ZEND_ARG_INFO(0, callable)
|
|
ZEND_ARG_INFO(0, callable)
|
|
ZEND_END_ARG_INFO()
|
|
ZEND_END_ARG_INFO()
|
|
@@ -1038,6 +1066,7 @@ static const zend_function_entry v8js_methods[] = { /* {{{ */
|
|
PHP_ME(V8Js, checkString, arginfo_v8js_checkstring, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
|
|
PHP_ME(V8Js, checkString, arginfo_v8js_checkstring, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
|
|
PHP_ME(V8Js, getPendingException, arginfo_v8js_getpendingexception, ZEND_ACC_PUBLIC)
|
|
PHP_ME(V8Js, getPendingException, arginfo_v8js_getpendingexception, ZEND_ACC_PUBLIC)
|
|
PHP_ME(V8Js, clearPendingException, arginfo_v8js_clearpendingexception, ZEND_ACC_PUBLIC)
|
|
PHP_ME(V8Js, clearPendingException, arginfo_v8js_clearpendingexception, ZEND_ACC_PUBLIC)
|
|
|
|
+ PHP_ME(V8Js, setModuleNormaliser, arginfo_v8js_setmodulenormaliser, ZEND_ACC_PUBLIC)
|
|
PHP_ME(V8Js, setModuleLoader, arginfo_v8js_setmoduleloader, ZEND_ACC_PUBLIC)
|
|
PHP_ME(V8Js, setModuleLoader, arginfo_v8js_setmoduleloader, ZEND_ACC_PUBLIC)
|
|
PHP_ME(V8Js, registerExtension, arginfo_v8js_registerextension, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
|
PHP_ME(V8Js, registerExtension, arginfo_v8js_registerextension, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
|
PHP_ME(V8Js, getExtensions, arginfo_v8js_getextensions, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
|
PHP_ME(V8Js, getExtensions, arginfo_v8js_getextensions, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|