issue_127_001.phpt 481 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Test V8Function::__call() : Check v8::TryCatch behaviour
  3. --SKIPIF--
  4. <?php
  5. if(!function_exists('json_encode')) {
  6. die('SKIP');
  7. }
  8. require_once(dirname(__FILE__) . '/skipif.inc');
  9. ?>
  10. --FILE--
  11. <?php
  12. $sandbox = new V8Js();
  13. $cb = $sandbox->executeString('(function() { return oh; });');
  14. try {
  15. $cb();
  16. } catch(\Exception $e) {
  17. echo "caught: ".$e->getMessage()."\n";
  18. }
  19. ?>
  20. ===EOF===
  21. --EXPECT--
  22. caught: V8Js::compileString():1: ReferenceError: oh is not defined
  23. ===EOF===