|
@@ -80,6 +80,7 @@ static void v8js_free_storage(zend_object *object) /* {{{ */
|
|
|
|
|
|
zval_ptr_dtor(&c->module_normaliser);
|
|
|
zval_ptr_dtor(&c->module_loader);
|
|
|
+ zval_ptr_dtor(&c->exception_filter);
|
|
|
|
|
|
/* Delete PHP global object from JavaScript */
|
|
|
if (!c->context.IsEmpty()) {
|
|
@@ -312,6 +313,7 @@ static PHP_METHOD(V8Js, __construct)
|
|
|
|
|
|
ZVAL_NULL(&c->module_normaliser);
|
|
|
ZVAL_NULL(&c->module_loader);
|
|
|
+ ZVAL_NULL(&c->exception_filter);
|
|
|
|
|
|
// Isolate execution
|
|
|
v8::Isolate *isolate = c->isolate;
|
|
@@ -701,6 +703,21 @@ static PHP_METHOD(V8Js, setModuleLoader)
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
|
|
+/* {{{ proto void V8Js::setExceptionFilter(callable factory)
|
|
|
+ */
|
|
|
+static PHP_METHOD(V8Js, setExceptionFilter)
|
|
|
+{
|
|
|
+ zval *callable;
|
|
|
+
|
|
|
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callable) == FAILURE) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ v8js_ctx *c = Z_V8JS_CTX_OBJ_P(getThis());
|
|
|
+ ZVAL_COPY(&c->exception_filter, callable);
|
|
|
+}
|
|
|
+/* }}} */
|
|
|
+
|
|
|
/* {{{ proto void V8Js::setTimeLimit(int time_limit)
|
|
|
*/
|
|
|
static PHP_METHOD(V8Js, setTimeLimit)
|
|
@@ -937,6 +954,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8js_setmoduleloader, 0, 0, 1)
|
|
|
ZEND_ARG_INFO(0, callable)
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
+ZEND_BEGIN_ARG_INFO_EX(arginfo_v8js_setexceptionfilter, 0, 0, 1)
|
|
|
+ ZEND_ARG_INFO(0, callable)
|
|
|
+ZEND_END_ARG_INFO()
|
|
|
+
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_v8js_setaverageobjectsize, 0, 0, 1)
|
|
|
ZEND_ARG_INFO(0, average_object_size)
|
|
|
ZEND_END_ARG_INFO()
|
|
@@ -963,6 +984,7 @@ const zend_function_entry v8js_methods[] = { /* {{{ */
|
|
|
PHP_ME(V8Js, executeScript, arginfo_v8js_executescript, 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, setExceptionFilter, arginfo_v8js_setexceptionfilter, ZEND_ACC_PUBLIC)
|
|
|
PHP_ME(V8Js, setTimeLimit, arginfo_v8js_settimelimit, ZEND_ACC_PUBLIC)
|
|
|
PHP_ME(V8Js, setMemoryLimit, arginfo_v8js_setmemorylimit, ZEND_ACC_PUBLIC)
|
|
|
PHP_ME(V8Js, setAverageObjectSize, arginfo_v8js_setaverageobjectsize, ZEND_ACC_PUBLIC)
|