|
@@ -25,6 +25,7 @@
|
|
|
|
|
|
extern "C" {
|
|
|
#include "php.h"
|
|
|
+#include "zend_exceptions.h"
|
|
|
}
|
|
|
|
|
|
#include "php_v8js_macros.h"
|
|
@@ -285,6 +286,13 @@ V8JS_METHOD(require)
|
|
|
return v8::ThrowException(v8::String::New("Module loader callback failed"));
|
|
|
}
|
|
|
|
|
|
+ // Check if an exception was thrown
|
|
|
+ if (EG(exception)) {
|
|
|
+ // Clear the PHP exception and throw it in V8 instead
|
|
|
+ zend_clear_exception(TSRMLS_CC);
|
|
|
+ return v8::ThrowException(v8::String::New("Module loader callback exception 456"));
|
|
|
+ }
|
|
|
+
|
|
|
// Convert the return value to string
|
|
|
if (Z_TYPE(module_code) != IS_STRING) {
|
|
|
convert_to_string(&module_code);
|