diff --git a/config.m4 b/config.m4 index f012482..9da20e4 100644 --- a/config.m4 +++ b/config.m4 @@ -3,7 +3,7 @@ PHP_ARG_WITH(v8js, for V8 Javascript Engine, if test "$PHP_V8JS" != "no"; then 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 case $host_os in @@ -25,6 +25,8 @@ if test "$PHP_V8JS" != "no"; then done fi + AC_DEFINE_UNQUOTED([PHP_V8_EXEC_PATH], "$V8_DIR/$SEARCH_FOR", [Full path to libv8 library file]) + if test -z "$V8_DIR"; then AC_MSG_RESULT([not found]) AC_MSG_ERROR([Please reinstall the v8 distribution]) diff --git a/tests/issue_306_basic.phpt b/tests/issue_306_basic.phpt new file mode 100644 index 0000000..c3d0244 --- /dev/null +++ b/tests/issue_306_basic.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test V8::executeString() : Issue #306 V8 crashing on toLocaleString() +--SKIPIF-- + +--FILE-- +executeString($expr, null, V8Js::FLAG_FORCE_ARRAY) ); + +?> +===EOF=== +--EXPECT-- +string(7) "October" +===EOF=== diff --git a/v8js_v8.cc b/v8js_v8.cc index 2114d38..ab432e5 100644 --- a/v8js_v8.cc +++ b/v8js_v8.cc @@ -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 */ v8::V8::Initialize();