mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-03 14:31:53 +00:00
Initialize ICU as (meanwhile) needed
This commit is contained in:
parent
5cf93a2970
commit
c957be8b2a
@ -3,7 +3,7 @@ PHP_ARG_WITH(v8js, for V8 Javascript Engine,
|
|||||||
|
|
||||||
if test "$PHP_V8JS" != "no"; then
|
if test "$PHP_V8JS" != "no"; then
|
||||||
SEARCH_PATH="/usr/local /usr"
|
SEARCH_PATH="/usr/local /usr"
|
||||||
SEARCH_FOR="include/v8.h"
|
SEARCH_FOR="$PHP_LIBDIR/libv8.$SHLIB_DL_SUFFIX_NAME"
|
||||||
|
|
||||||
if test -r $PHP_V8JS/$SEARCH_FOR; then
|
if test -r $PHP_V8JS/$SEARCH_FOR; then
|
||||||
case $host_os in
|
case $host_os in
|
||||||
@ -25,6 +25,8 @@ if test "$PHP_V8JS" != "no"; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED([PHP_V8_EXEC_PATH], "$V8_DIR/$SEARCH_FOR", [Full path to libv8 library file])
|
||||||
|
|
||||||
if test -z "$V8_DIR"; then
|
if test -z "$V8_DIR"; then
|
||||||
AC_MSG_RESULT([not found])
|
AC_MSG_RESULT([not found])
|
||||||
AC_MSG_ERROR([Please reinstall the v8 distribution])
|
AC_MSG_ERROR([Please reinstall the v8 distribution])
|
||||||
|
18
tests/issue_306_basic.phpt
Normal file
18
tests/issue_306_basic.phpt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
--TEST--
|
||||||
|
Test V8::executeString() : Issue #306 V8 crashing on toLocaleString()
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$v8 = new V8Js();
|
||||||
|
|
||||||
|
$v8 = new V8Js;
|
||||||
|
$expr = 'new Date("10/11/2009").toLocaleString("en-us", { month: "long" });';
|
||||||
|
var_dump( $v8->executeString($expr, null, V8Js::FLAG_FORCE_ARRAY) );
|
||||||
|
|
||||||
|
?>
|
||||||
|
===EOF===
|
||||||
|
--EXPECT--
|
||||||
|
string(7) "October"
|
||||||
|
===EOF===
|
@ -76,6 +76,11 @@ void v8js_v8_init() /* {{{ */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PHP_V8_EXEC_PATH
|
||||||
|
/* Initialize ICU */
|
||||||
|
v8::V8::InitializeICUDefaultLocation(PHP_V8_EXEC_PATH, nullptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize V8 */
|
/* Initialize V8 */
|
||||||
v8::V8::Initialize();
|
v8::V8::Initialize();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user