Skip to content

Commit 09f69ca

Browse files
committed
Relax test to work on V8 without i18n support
1 parent 6723ff2 commit 09f69ca

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/issue_306_basic.phpt

+14-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@ Test V8::executeString() : Issue #306 V8 crashing on toLocaleString()
77

88
$v8 = new V8Js();
99

10-
$v8 = new V8Js;
1110
$expr = 'new Date("10/11/2009").toLocaleString("en-us", { month: "long" });';
12-
var_dump( $v8->executeString($expr, null, V8Js::FLAG_FORCE_ARRAY) );
11+
$result = $v8->executeString($expr);
12+
13+
// V8 can be compiled with i18n support and without;
14+
// without i18n support however toLocaleString doesn't really work,
15+
// it just returns the date string...
16+
17+
if ($result === 'October') {
18+
var_dump(true);
19+
} else {
20+
$expr = 'new Date("10/11/2009").toString();';
21+
var_dump($v8->executeString($expr) === $result);
22+
}
1323

1424
?>
1525
===EOF===
1626
--EXPECT--
17-
string(7) "October"
18-
===EOF===
27+
bool(true)
28+
===EOF===

0 commit comments

Comments
 (0)