2012-04-27 16:26:15 +00:00
|
|
|
--TEST--
|
2013-04-13 23:36:31 +00:00
|
|
|
Test V8::executeString() : V8JsScriptException
|
2012-04-27 16:26:15 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$JS = <<< EOT
|
|
|
|
this_function_does_not_exist();
|
|
|
|
EOT;
|
|
|
|
|
|
|
|
$v8 = new V8Js();
|
|
|
|
|
|
|
|
try {
|
|
|
|
$v8->executeString($JS, 'exception.js');
|
2013-04-13 23:36:31 +00:00
|
|
|
} catch (V8JsScriptException $e) {
|
2012-04-27 16:26:15 +00:00
|
|
|
var_dump($e);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
===EOF===
|
|
|
|
--EXPECTF--
|
2013-10-29 19:26:16 +00:00
|
|
|
object(V8JsScriptException)#%d (11) {
|
2012-04-27 16:26:15 +00:00
|
|
|
["message":protected]=>
|
|
|
|
string(75) "exception.js:1: ReferenceError: this_function_does_not_exist is not defined"
|
|
|
|
["string":"Exception":private]=>
|
|
|
|
string(0) ""
|
|
|
|
["code":protected]=>
|
|
|
|
int(0)
|
|
|
|
["file":protected]=>
|
|
|
|
string(%d) "%s"
|
|
|
|
["line":protected]=>
|
|
|
|
int(10)
|
|
|
|
["trace":"Exception":private]=>
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
|
|
|
array(6) {
|
|
|
|
["file"]=>
|
|
|
|
string(%d) "%s"
|
|
|
|
["line"]=>
|
|
|
|
int(10)
|
|
|
|
["function"]=>
|
|
|
|
string(13) "executeString"
|
|
|
|
["class"]=>
|
|
|
|
string(4) "V8Js"
|
|
|
|
["type"]=>
|
|
|
|
string(2) "->"
|
|
|
|
["args"]=>
|
|
|
|
array(2) {
|
|
|
|
[0]=>
|
|
|
|
string(31) "this_function_does_not_exist();"
|
|
|
|
[1]=>
|
|
|
|
string(12) "exception.js"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
["previous":"Exception":private]=>
|
|
|
|
NULL
|
|
|
|
["JsFileName":protected]=>
|
|
|
|
string(12) "exception.js"
|
|
|
|
["JsLineNumber":protected]=>
|
|
|
|
int(1)
|
|
|
|
["JsSourceLine":protected]=>
|
|
|
|
string(31) "this_function_does_not_exist();"
|
|
|
|
["JsTrace":protected]=>
|
|
|
|
string(83) "ReferenceError: this_function_does_not_exist is not defined
|
|
|
|
at exception.js:1:1"
|
|
|
|
}
|
|
|
|
===EOF===
|