0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-28 10:11:52 +00:00
Commit Graph

1161 Commits

Author SHA1 Message Date
Stefan Siegl
c2a2cc341f Initialize libv8_platform for Windows as well
V8 doesn't work without libplatform anymore, even under
Windows.

Furthermore adapted two tests to \r\n vs. \n line
ending differences
2016-01-06 11:58:40 +00:00
Stefan Siegl
317f01f588 Merge pull request #195 from phpv8/fix-vc14-build
Reorder includes for Visual Studio 2015, closes #194
2016-01-06 10:40:01 +01:00
Stefan Siegl
6143b693b8 Include concrt.h only on _WIN32 2016-01-06 10:10:22 +01:00
Stefan Siegl
98205461be Reorder includes for Visual Studio 2015, closes #194
C++ headers need to go first, since PHP headers redefine
"inline" which causes trouble with the C++ header files.
2016-01-06 09:01:35 +00:00
Stefan Siegl
5fd9f3d000 Merge pull request #193 from stesie/fix-cpp-functional-memleak
defer bailout until std::function dtor
2016-01-01 20:50:41 +01:00
Stefan Siegl
a83c49266e defer bailout until std::function dtor
std::function allocates some heap memory, at least with some
implementations and expects the dtor to run.  Hence defer the
bailout until the dtor ran.
2016-01-01 19:10:04 +01:00
Stefan Siegl
beedb680db Merge pull request #192 from stesie/fix-v8-relock
Fix v8::Unlocker behaviour and related memory leaks
2016-01-01 00:28:06 +01:00
Stefan Siegl
8de27fd2ce free v8::Persistent<v8::Script> on bailout 2016-01-01 00:01:49 +01:00
Stefan Siegl
a520f49335 exit v8::HandleScope and v8::IsolateScope before bailing out
This fixes some memory leaks.
2015-12-31 23:44:01 +01:00
Stefan Siegl
2d9c831eeb Move zend_try block into v8::Unlocker block
If the v8::Unlocker block is within the zend_try block, then
v8::~Unlocker (dtor) is not called and hence V8 doesn't
re-aquire the lock.

Besides before we re-entered the isolate within zend_try
and hence *before* taking the lock.
2015-12-31 23:42:01 +01:00
Stefan Siegl
362eb0b806 Merge pull request #190 from stesie/warn-only-on-v8-errors
Don't abort PHP on fatal V8 errors, just warn about it
2015-12-31 21:42:00 +01:00
Stefan Siegl
27343d2f65 Merge pull request #191 from stesie/fix-double-free-exception
Fix use-after-free error wrt. pending exception
2015-12-31 21:41:58 +01:00
Stefan Siegl
7ab66751e3 Merge pull request #188 from stesie/fix-double-free
Fix double free
2015-12-31 20:56:18 +01:00
Stefan Siegl
cb94958afd Merge pull request #189 from stesie/merge-php5-to-php7
Merge version 0.4.0 features to php7 branch
2015-12-31 20:56:10 +01:00
Stefan Siegl
2d34adb91f Merge remote-tracking branch 'origin/master'
This primarily ports features introduced with V8Js 0.4.0
to the PHP7 branch.
2015-12-31 20:25:24 +01:00
Stefan Siegl
61febfb589 Merge pull request #186 from stesie/issue-185
Provide correct "this" on V8Object method invocation, closes #185
2015-12-30 22:33:49 +01:00
Stefan Siegl
c0d15af9cc Ignore .o files
These appear if you directly compile V8Js into PHP
2015-12-30 17:54:25 +01:00
Stefan Siegl
de23e8dba4 Don't abort PHP on fatal V8 errors, just warn about it
This way the PHP script can handle V8 errors gracefully
(and e.g. provide feedback to the user).

This especially changes behaviour when circular extension
dependencies happen (PHP code can go on, just V8 fails
to start).  This also fixes memory leaks of V8 and V8Js
itself caused by bailing out directly otherwise.
2015-12-30 17:53:46 +01:00
Stefan Siegl
7e1f2e9355 Fix use-after-free error wrt. pending exception
Don't dtor pending exception, PHP's exception handling does after all.
2015-12-30 17:46:29 +01:00
Stefan Siegl
64bfa552ad Fix double free
Fix double free of `php_value` and free `php_ret_value` instead
(which otherwise leaks).
2015-12-30 15:54:47 +01:00
Stefan Siegl
30fe9937de Merge pull request #187 from stesie/fix-regexp-vardump
Fix output of var_dump on regexp (V8 > 4.8)
2015-12-30 15:34:58 +01:00
Stefan Siegl
3108d3947d Fix output of var_dump on regexp (V8 > 4.8)
Newer V8 versions' toString() converts RegExp objects
just to [object RegExp] (instead of the actual regexp
as before).  Work-around by calling GetSource() on the
regexp and create former outhway that way.
2015-12-30 14:59:37 +01:00
Stefan Siegl
3c5508b956 Provide correct "this" on V8Object method invocation, closes #185 2015-12-26 12:16:17 +01:00
Stefan Siegl
d9e4ae5abe Bump version to 0.4.0 2015-12-07 13:26:44 +01:00
Stefan Siegl
28f061101e Merge pull request #184 from stesie/cust-module-normalisation
Allow custom module path normalisation
2015-12-06 14:48:50 +01:00
Stefan Siegl
67a9de01bd Allow custom module normalisation 2015-12-06 13:55:13 +01:00
Stefan Siegl
f258980399 Accept empty string as module source
This might be perfectly valid, if you're using a third-party module,
which requires a module yet doesn't use it in the code paths hit
and hence you just want to stub it out.
2015-12-06 13:25:43 +01:00
Stefan Siegl
4853c6d17f Set script identifier as String, not Symbol
Otherwise long module identifiers might get cut off.
2015-12-06 13:23:14 +01:00
Stefan Siegl
bf58fe67c1 wrap module loading in zend_try/zend_catch, closes #178 2015-12-04 22:09:04 +01:00
Stefan Siegl
39fff2301e Use module id as JsFileName for V8
This way the information to V8JsScriptException instances are way
more clear since they contain the name of the module that caused
the exception.
2015-12-04 21:46:54 +01:00
Stefan Siegl
2f0b8e2873 Make var_dump command available to modules as well 2015-12-04 21:37:51 +01:00
Stefan Siegl
ad4d8e4110 v8js.cc: fix file permissions 2015-12-04 21:14:06 +01:00
Stefan Siegl
09ac23c5a3 Bump version to 1.0.0 2015-12-04 21:07:47 +01:00
Stefan Siegl
227ad57163 prefer V8JS_ZSTR over V8JS_STRL(Z_STRVAL), refs #180 2015-12-04 20:14:47 +01:00
Stefan Siegl
d9eb68b6f9 use ZSTR_LEN, ZSTR_VAL where possible, refs #180 2015-12-04 19:55:20 +01:00
Stefan Siegl
97a9a2cc74 tests/pthreads_001: don't test pthread ext internals 2015-12-04 19:22:29 +01:00
Stefan Siegl
059e0500fb Merge remote-tracking branch 'origin/master' into php7 2015-11-29 12:21:40 +01:00
Stefan Siegl
f73abfac62 Merge pull request #177 from stesie/fix-vardump-test
Fix tests/var_dump.phpt
2015-11-28 17:31:19 +01:00
Stefan Siegl
670554306a Fix tests/var_dump.phpt
Recent V8 versions (e.g. 4.8.253 or 4.9.19) consider
`IsFunction() = true` for Closure objects from PHP; but earlier
versions didn't.

This ensures consistent var_dump behaviour (sticking to the
behaviour with older V8 versions).
2015-11-28 15:27:35 +01:00
Stefan Siegl
4376d59942 Merge pull request #175 from kynx/readme-osx
Updated README.MacOS to recommend installing extension via brew
2015-11-20 21:53:09 +01:00
Matt Kynaston
e5ee35a30e Updated README.MacOS to recommend installing extension via brew 2015-11-20 18:19:23 +00:00
Stefan Siegl
ff172f48ce Add link to omahaproxy 2015-11-20 18:55:26 +01:00
Stefan Siegl
ca6e0e241b Merge pull request #174 from aphofstede/patch-1
Update README.Linux.md to include PHP extension instruction.
2015-11-20 18:48:13 +01:00
Alexander Hofstede
1642ce48ba Update README.Linux.md
Added a note about adding the extension to PHP config, especially for CLI, which needs to be configured separately in some PHP7 installs.
2015-11-20 22:51:18 +07:00
Stefan Siegl
33d2de53c7 Merge pull request #173 from kynx/function-properties
Added ability to set properties on V8Function
2015-11-03 21:40:48 +01:00
Stefan Siegl
7f194fb63a Merge pull request #171 from stesie/fix-gcc5-build
Improve -Wno-c++11-narrowing/-Wno-narrowing detection
2015-11-03 21:28:27 +01:00
Matt Kynaston
a58f944804 Experiment to see if #172 is easy to fix 2015-11-03 17:35:30 +00:00
Stefan Siegl
7805abfb18 Improve -Wno-c++11-narrowing/-Wno-narrowing detection 2015-10-18 18:03:04 +02:00
Stefan Siegl
b29bb886bb Bump version to 0.3.0 2015-10-11 22:00:33 +02:00
Stefan Siegl
3085db6aeb Merge remote-tracking branch 'origin/master' into php7 2015-10-11 19:51:59 +02:00