mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 09:21:52 +00:00
Write deprecation warning on non-empty $extensions array passed to V8Js::__construct
This commit is contained in:
parent
9734466105
commit
22bcf85348
@ -36,5 +36,7 @@ array(2) {
|
||||
bool(false)
|
||||
}
|
||||
}
|
||||
|
||||
Deprecated: V8Js::__construct(): Use of extensions is deprecated, $extensions array passed in %s%eextensions_basic.php on line 8
|
||||
Hello world!
|
||||
===EOF===
|
||||
|
@ -41,6 +41,8 @@ array(2) {
|
||||
}
|
||||
}
|
||||
|
||||
Deprecated: V8Js::__construct(): Use of extensions is deprecated, $extensions array passed in %s%eextensions_circular_dependency.php on line 8
|
||||
|
||||
Warning: Fatal V8 error in v8::Context::New(): Circular extension dependency in %s on line 8
|
||||
|
||||
Fatal error: Uncaught V8JsException: Failed to create V8 context. Check that registered extensions do not have errors. in %s:8
|
||||
|
@ -401,6 +401,11 @@ static PHP_METHOD(V8Js, __construct)
|
||||
if (exts_arr)
|
||||
{
|
||||
exts_count = zend_hash_num_elements(Z_ARRVAL_P(exts_arr));
|
||||
|
||||
if (exts_count != 0) {
|
||||
php_error_docref(NULL, E_DEPRECATED, "Use of extensions is deprecated, $extensions array passed");
|
||||
}
|
||||
|
||||
if (v8js_create_ext_strarr(&exts, exts_count, Z_ARRVAL_P(exts_arr)) == FAILURE) {
|
||||
zend_throw_exception(php_ce_v8js_exception,
|
||||
"Invalid extensions array passed", 0);
|
||||
|
Loading…
Reference in New Issue
Block a user