Forráskód Böngészése

Test whether error handler is removed correctly, if outermost frame is left

Stefan Siegl 11 éve
szülő
commit
1d8ae1f458
1 módosított fájl, 32 hozzáadás és 0 törlés
  1. 32 0
      tests/fatal_error_uninstall_in_first_frame.phpt

+ 32 - 0
tests/fatal_error_uninstall_in_first_frame.phpt

@@ -0,0 +1,32 @@
+--TEST--
+Test V8::executeString() : Fatal Error handler must be uninstalled when leaving outermost frame
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+
+$js = new V8Js();
+
+$js->bar = function() {
+	echo "nothing.\n";
+};
+
+$js->foo = function() {
+	global $js;
+	// call to JS context, this must not touch the error handling context
+	$js->executeString("PHP.bar();");
+};
+
+$js->executeString("PHP.foo();");
+
+// V8JS handler must be removed, just throw error ...
+// if V8JS handler is not removed, it should trigger segfault in V8 :)
+$bar = null;
+$bar->foo();
+
+?>
+===EOF===
+--EXPECTF--
+nothing.
+
+Fatal error: Call to a member function foo() on a non-object in %s/fatal_error_uninstall_in_first_frame.php on line 20