From bfd2bfc2df167dcf2f2e1b94a0add57766441dda Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Tue, 31 May 2022 09:57:52 +0200 Subject: [PATCH] remove deprected V8Js::checkString function --- tests/checkstring.phpt | 24 ------------------------ v8js_class.cc | 27 --------------------------- 2 files changed, 51 deletions(-) delete mode 100644 tests/checkstring.phpt diff --git a/tests/checkstring.phpt b/tests/checkstring.phpt deleted file mode 100644 index dc2ff5b..0000000 --- a/tests/checkstring.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test V8::executeString() : Script validator test ---SKIPIF-- - ---FILE-- -checkString('print("Hello World!");')); - -try { - var_dump($v8->checkString('print("Hello World!);')); -} catch (V8JsScriptException $e) { - var_dump($e->getMessage()); -} -?> -===EOF=== ---EXPECTF-- -Deprecated: %s V8Js::checkString() is deprecated in %s on line %d -bool(true) - -Deprecated: %s V8Js::checkString() is deprecated in %s on line %d -string(%d) "V8Js::checkString():1: SyntaxError: %s" -===EOF=== diff --git a/v8js_class.cc b/v8js_class.cc index badbe11..6fdfa07 100644 --- a/v8js_class.cc +++ b/v8js_class.cc @@ -669,32 +669,6 @@ static PHP_METHOD(V8Js, executeScript) } /* }}} */ -/* {{{ proto mixed V8Js::checkString(string script) - */ -static PHP_METHOD(V8Js, checkString) -{ - zend_string *str = NULL; - zend_string *identifier = zend_string_init("V8Js::checkString()", 19, 0); - - v8js_script *res = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { - return; - } - - v8js_compile_script(getThis(), str, identifier, &res); - zend_string_release(identifier); - - if (!res) { - RETURN_FALSE; - } - - v8js_script_free(res); - efree(res); - RETURN_TRUE; -} -/* }}} */ - /* {{{ proto void V8Js::setModuleNormaliser(string base, string module_id) */ static PHP_METHOD(V8Js, setModuleNormaliser) @@ -987,7 +961,6 @@ const zend_function_entry v8js_methods[] = { /* {{{ */ PHP_ME(V8Js, executeString, arginfo_v8js_executestring, ZEND_ACC_PUBLIC) PHP_ME(V8Js, compileString, arginfo_v8js_compilestring, ZEND_ACC_PUBLIC) PHP_ME(V8Js, executeScript, arginfo_v8js_executescript, ZEND_ACC_PUBLIC) - PHP_ME(V8Js, checkString, arginfo_v8js_checkstring, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) PHP_ME(V8Js, setModuleNormaliser, arginfo_v8js_setmodulenormaliser, ZEND_ACC_PUBLIC) PHP_ME(V8Js, setModuleLoader, arginfo_v8js_setmoduleloader, ZEND_ACC_PUBLIC) PHP_ME(V8Js, setTimeLimit, arginfo_v8js_settimelimit, ZEND_ACC_PUBLIC)