@@ -56,7 +56,7 @@ static zval v8js_array_access_dispatch(zend_object *object, const char *method_n
56
56
57
57
58
58
59
- v8::Intercepted v8js_array_access_getter (uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) /* {{{ */
59
+ V8JS_INTERCEPTED v8js_array_access_getter (uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) /* {{{ */
60
60
{
61
61
v8::Isolate *isolate = info.GetIsolate ();
62
62
v8::Local<v8::Object> self = info.Holder ();
@@ -71,16 +71,16 @@ v8::Intercepted v8js_array_access_getter(uint32_t index, const v8::PropertyCallb
71
71
zval_ptr_dtor (&php_value);
72
72
73
73
if (ret_value.IsEmpty ()) {
74
- return v8::Intercepted:: kNo ;
74
+ return V8JS_INTERCEPTED_NO ;
75
75
} else {
76
76
info.GetReturnValue ().Set (ret_value);
77
- return v8::Intercepted:: kYes ;
77
+ return V8JS_INTERCEPTED_YES ;
78
78
}
79
79
}
80
80
/* }}} */
81
81
82
- v8::Intercepted v8js_array_access_setter (uint32_t index, v8::Local<v8::Value> value,
83
- const v8::PropertyCallbackInfo< void >& info) /* {{{ */
82
+ V8JS_INTERCEPTED v8js_array_access_setter (uint32_t index, v8::Local<v8::Value> value,
83
+ const V8JS_SETTER_PROPERTY_CALLBACK_INFO & info) /* {{{ */
84
84
{
85
85
v8::Isolate *isolate = info.GetIsolate ();
86
86
v8::Local<v8::Object> self = info.Holder ();
@@ -91,16 +91,22 @@ v8::Intercepted v8js_array_access_setter(uint32_t index, v8::Local<v8::Value> va
91
91
ZVAL_UNDEF (&zvalue);
92
92
93
93
if (v8js_to_zval (value, &zvalue, 0 , isolate) != SUCCESS) {
94
- return v8::Intercepted:: kNo ;
94
+ return V8JS_INTERCEPTED_NO ;
95
95
}
96
96
97
97
zval php_value = v8js_array_access_dispatch (object, " offsetSet" , 2 , index , zvalue);
98
98
zval_ptr_dtor (&php_value);
99
99
100
+ #if !PHP_V8_HAS_INTERCEPTED
101
+ /* simply pass back the value to tell we intercepted the call
102
+ * as the offsetSet function returns void. */
103
+ info.GetReturnValue ().Set (value);
104
+ #endif
105
+
100
106
/* if PHP wanted to hold on to this value, zend_call_function would
101
107
* have bumped the refcount. */
102
108
zval_ptr_dtor (&zvalue);
103
- return v8::Intercepted:: kYes ;
109
+ return V8JS_INTERCEPTED_YES ;
104
110
}
105
111
/* }}} */
106
112
@@ -160,7 +166,7 @@ static void v8js_array_access_length(v8::Local<v8::String> property, const v8::P
160
166
}
161
167
/* }}} */
162
168
163
- v8::Intercepted v8js_array_access_deleter (uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean >& info) /* {{{ */
169
+ V8JS_INTERCEPTED v8js_array_access_deleter (uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean >& info) /* {{{ */
164
170
{
165
171
v8::Isolate *isolate = info.GetIsolate ();
166
172
v8::Local<v8::Object> self = info.Holder ();
@@ -174,11 +180,11 @@ v8::Intercepted v8js_array_access_deleter(uint32_t index, const v8::PropertyCall
174
180
zval_ptr_dtor (&php_value);
175
181
176
182
info.GetReturnValue ().Set (V8JS_BOOL (true ));
177
- return v8::Intercepted:: kYes ;
183
+ return V8JS_INTERCEPTED_YES ;
178
184
}
179
185
/* }}} */
180
186
181
- v8::Intercepted v8js_array_access_query (uint32_t index, const v8::PropertyCallbackInfo<v8::Integer>& info) /* {{{ */
187
+ V8JS_INTERCEPTED v8js_array_access_query (uint32_t index, const v8::PropertyCallbackInfo<v8::Integer>& info) /* {{{ */
182
188
{
183
189
v8::Isolate *isolate = info.GetIsolate ();
184
190
v8::Local<v8::Object> self = info.Holder ();
@@ -189,10 +195,10 @@ v8::Intercepted v8js_array_access_query(uint32_t index, const v8::PropertyCallba
189
195
* otherwise we're expected to return an empty handle. */
190
196
if (v8js_array_access_isset_p (object, index )) {
191
197
info.GetReturnValue ().Set (V8JS_UINT (v8::PropertyAttribute::None));
192
- return v8::Intercepted:: kYes ;
198
+ return V8JS_INTERCEPTED_YES ;
193
199
}
194
200
195
- return v8::Intercepted:: kNo ;
201
+ return V8JS_INTERCEPTED_NO ;
196
202
}
197
203
/* }}} */
198
204
@@ -222,7 +228,7 @@ void v8js_array_access_enumerator(const v8::PropertyCallbackInfo<v8::Array>& inf
222
228
223
229
224
230
225
- v8::Intercepted v8js_array_access_named_getter (v8::Local<v8::Name> property_name, const v8::PropertyCallbackInfo<v8::Value> &info) /* {{{ */
231
+ V8JS_INTERCEPTED v8js_array_access_named_getter (v8::Local<v8::Name> property_name, const v8::PropertyCallbackInfo<v8::Value> &info) /* {{{ */
226
232
{
227
233
v8::Local<v8::String> property = v8::Local<v8::String>::Cast (property_name);
228
234
v8::Isolate *isolate = info.GetIsolate ();
@@ -231,7 +237,7 @@ v8::Intercepted v8js_array_access_named_getter(v8::Local<v8::Name> property_name
231
237
232
238
if (strcmp (name, " length" ) == 0 ) {
233
239
v8js_array_access_length (property, info);
234
- return v8::Intercepted:: kYes ;
240
+ return V8JS_INTERCEPTED_YES ;
235
241
}
236
242
237
243
v8::Local<v8::Value> ret_value = v8js_named_property_callback (info.GetIsolate (), info.Holder (), property, V8JS_PROP_GETTER);
@@ -255,7 +261,7 @@ v8::Intercepted v8js_array_access_named_getter(v8::Local<v8::Name> property_name
255
261
}
256
262
257
263
info.GetReturnValue ().Set (ret_value);
258
- return v8::Intercepted:: kYes ;
264
+ return V8JS_INTERCEPTED_YES ;
259
265
}
260
266
/* }}} */
261
267
0 commit comments