diff --git a/tests/checkstring.phpt b/tests/checkstring.phpt index a19788e..b5f2790 100644 --- a/tests/checkstring.phpt +++ b/tests/checkstring.phpt @@ -15,7 +15,10 @@ try { } ?> ===EOF=== ---EXPECT-- +--EXPECTF-- +Deprecated: Function V8Js::checkString() is deprecated in %s on line %d bool(true) + +Deprecated: Function V8Js::checkString() is deprecated in %s on line %d string(60) "V8Js::checkString():1: SyntaxError: Unexpected token ILLEGAL" ===EOF=== diff --git a/tests/checkstring_compile.phpt b/tests/checkstring_compile.phpt new file mode 100644 index 0000000..2c9e188 --- /dev/null +++ b/tests/checkstring_compile.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test V8::executeString() : Script validator test using compileString +--SKIPIF-- + +--FILE-- +compileString('print("Hello World!");')); + +try { + var_dump($v8->compileString('print("Hello World!);')); +} catch (V8JsScriptException $e) { + var_dump($e->getMessage()); +} +?> +===EOF=== +--EXPECTF-- +resource(%d) of type (V8Js script) +string(62) "V8Js::compileString():1: SyntaxError: Unexpected token ILLEGAL" +===EOF=== diff --git a/v8js.cc b/v8js.cc index 4c19c60..2201ece 100644 --- a/v8js.cc +++ b/v8js.cc @@ -1732,7 +1732,7 @@ static 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) + 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, setModuleLoader, arginfo_v8js_setmoduleloader, ZEND_ACC_PUBLIC) PHP_ME(V8Js, registerExtension, arginfo_v8js_registerextension, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)