exception_clearing.phpt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. --TEST--
  2. Test V8::executeString() : Exception clearing test
  3. --SKIPIF--
  4. <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. $v8 = new V8Js(null, array(), array(), false);
  8. var_dump($v8->getPendingException());
  9. $v8->clearPendingException();
  10. var_dump($v8->getPendingException());
  11. $v8->executeString('fooobar', 'throw_0');
  12. var_dump($v8->getPendingException());
  13. $v8->clearPendingException();
  14. var_dump($v8->getPendingException());
  15. ?>
  16. ===EOF===
  17. --EXPECTF--
  18. Deprecated: V8Js::__construct(): Disabling exception reporting is deprecated, $report_uncaught_exceptions != true in %s%eexception_clearing.php on line 3
  19. Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 5
  20. NULL
  21. Deprecated: Function V8Js::clearPendingException() is deprecated in %s%eexception_clearing.php on line 7
  22. Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 8
  23. NULL
  24. Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 11
  25. object(V8JsScriptException)#%d (13) {
  26. ["message":protected]=>
  27. string(49) "throw_0:1: ReferenceError: fooobar is not defined"
  28. ["string":"Exception":private]=>
  29. string(0) ""
  30. ["code":protected]=>
  31. int(0)
  32. ["file":protected]=>
  33. string(%d) "%s"
  34. ["line":protected]=>
  35. int(10)
  36. ["trace":"Exception":private]=>
  37. array(1) {
  38. [0]=>
  39. array(6) {
  40. ["file"]=>
  41. string(%d) "%s"
  42. ["line"]=>
  43. int(10)
  44. ["function"]=>
  45. string(13) "executeString"
  46. ["class"]=>
  47. string(4) "V8Js"
  48. ["type"]=>
  49. string(2) "->"
  50. ["args"]=>
  51. array(2) {
  52. [0]=>
  53. string(7) "fooobar"
  54. [1]=>
  55. string(7) "throw_0"
  56. }
  57. }
  58. }
  59. ["previous":"Exception":private]=>
  60. NULL
  61. ["JsFileName":protected]=>
  62. string(7) "throw_0"
  63. ["JsLineNumber":protected]=>
  64. int(1)
  65. ["JsStartColumn":protected]=>
  66. int(0)
  67. ["JsEndColumn":protected]=>
  68. int(1)
  69. ["JsSourceLine":protected]=>
  70. string(7) "fooobar"
  71. ["JsTrace":protected]=>
  72. string(57) "ReferenceError: fooobar is not defined
  73. at throw_0:1:1"
  74. }
  75. Deprecated: Function V8Js::clearPendingException() is deprecated in %s%eexception_clearing.php on line 13
  76. Deprecated: Function V8Js::getPendingException() is deprecated in %s%eexception_clearing.php on line 14
  77. NULL
  78. ===EOF===