mirror of
https://github.com/phpv8/v8js.git
synced 2024-11-09 23:08:41 +00:00
Deprecate V8Js::checkString() in favour of compileString() and add tests.
This commit is contained in:
parent
bd7d649d90
commit
7310c93c1e
@ -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===
|
||||
|
21
tests/checkstring_compile.phpt
Normal file
21
tests/checkstring_compile.phpt
Normal file
@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Test V8::executeString() : Script validator test using compileString
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$v8 = new V8Js();
|
||||
var_dump($v8->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===
|
2
v8js.cc
2
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)
|
||||
|
Loading…
Reference in New Issue
Block a user