Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit ec1d341

Browse files
committed
To not enter isolate when calling V8\Isolate::IsDead()
1 parent f3c1af8 commit ec1d341

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Diff for: src/php_v8_isolate.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static PHP_METHOD(V8Isolate, IsDead) {
493493
}
494494

495495
PHP_V8_ISOLATE_FETCH_WITH_CHECK(getThis(), php_v8_isolate);
496-
PHP_V8_ENTER_ISOLATE(php_v8_isolate); // TODO: can we just fetch isolate object here and do not eneter it?
496+
PHP_V8_DECLARE_ISOLATE(php_v8_isolate);
497497

498498
RETURN_BOOL(isolate->IsDead());
499499
}

Diff for: tests/V8Isolate_IsDead.phpt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
V8\Isolate::IsDead()
3+
--SKIPIF--
4+
<?php if (!extension_loaded("v8")) print "skip"; ?>
5+
--FILE--
6+
<?php
7+
8+
/** @var \Phpv8Testsuite $helper */
9+
$helper = require '.testsuite.php';
10+
11+
require '.v8-helpers.php';
12+
$v8_helper = new PhpV8Helpers($helper);
13+
14+
15+
$isolate = new V8\Isolate();
16+
$helper->method_export($isolate, 'IsDead');
17+
18+
19+
?>
20+
--EXPECT--
21+
V8\Isolate->IsDead(): bool(false)

0 commit comments

Comments
 (0)