We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6723ff2 commit 09f69caCopy full SHA for 09f69ca
tests/issue_306_basic.phpt
@@ -7,12 +7,22 @@ Test V8::executeString() : Issue #306 V8 crashing on toLocaleString()
7
8
$v8 = new V8Js();
9
10
-$v8 = new V8Js;
11
$expr = 'new Date("10/11/2009").toLocaleString("en-us", { month: "long" });';
12
-var_dump( $v8->executeString($expr, null, V8Js::FLAG_FORCE_ARRAY) );
+$result = $v8->executeString($expr);
+
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
+}
23
24
?>
25
===EOF===
26
--EXPECT--
-string(7) "October"
-===EOF===
27
+bool(true)
28
+===EOF===
0 commit comments