extensions_error.phpt 792 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Test V8::registerExtension() : Register extension with errors
  3. --SKIPIF--
  4. <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
  5. --FILE--
  6. <?php
  7. $handlebarsJs = "var root = typeof global !== 'undefined' ? global : window, \$Handlebars = 'test';";
  8. echo "-- registerExtension --\n";
  9. V8Js::registerExtension('handlebars', $handlebarsJs, [], true);
  10. echo "-- creating V8Js object --\n";
  11. $v8 = new V8Js();
  12. var_dump($v8);
  13. ?>
  14. ===EOF===
  15. --EXPECTF--
  16. -- registerExtension --
  17. -- creating V8Js object --
  18. Exception thrown during bootstrapping
  19. Extension or internal compilation error%sin handlebars at line 1.
  20. Error installing extension 'handlebars'.
  21. Warning: V8Js::__construct(): Failed to create V8 context. Check that registered extensions do not have errors. in %s on line %d
  22. NULL
  23. ===EOF===