@@ -105,8 +105,8 @@ IMPORT_JS_FUNCTION(swjs_set_prop, void, (const JavaScriptObjectRef _this,
105
105
/// @return A `JavaScriptValueKind` bits represented as 32bit integer for the returned value.
106
106
IMPORT_JS_FUNCTION (swjs_get_prop , uint32_t , (const JavaScriptObjectRef _this ,
107
107
const JavaScriptObjectRef prop ,
108
- JavaScriptPayload1 * payload1 ,
109
- JavaScriptPayload2 * payload2 ))
108
+ JavaScriptPayload1 * _Nonnull payload1 ,
109
+ JavaScriptPayload2 * _Nonnull payload2 ))
110
110
111
111
/// Sets a value of `_this` JavaScript object.
112
112
///
@@ -131,29 +131,29 @@ IMPORT_JS_FUNCTION(swjs_set_subscript, void, (const JavaScriptObjectRef _this,
131
131
/// get a value of `_this` JavaScript object.
132
132
IMPORT_JS_FUNCTION (swjs_get_subscript , uint32_t , (const JavaScriptObjectRef _this ,
133
133
const int index ,
134
- JavaScriptPayload1 * payload1 ,
135
- JavaScriptPayload2 * payload2 ))
134
+ JavaScriptPayload1 * _Nonnull payload1 ,
135
+ JavaScriptPayload2 * _Nonnull payload2 ))
136
136
137
137
/// Encodes the `str_obj` to bytes sequence and returns the length of bytes.
138
138
///
139
139
/// @param str_obj A JavaScript string object ref to encode.
140
140
/// @param bytes_result A result pointer of bytes sequence representation in JavaScript.
141
141
/// This value will be used to load the actual bytes using `_load_string`.
142
142
/// @result The length of bytes sequence. This value will be used to allocate Swift side string buffer to load the actual bytes.
143
- IMPORT_JS_FUNCTION (swjs_encode_string , int , (const JavaScriptObjectRef str_obj , JavaScriptObjectRef * bytes_result ))
143
+ IMPORT_JS_FUNCTION (swjs_encode_string , int , (const JavaScriptObjectRef str_obj , JavaScriptObjectRef * _Nonnull bytes_result ))
144
144
145
145
/// Decodes the given bytes sequence into JavaScript string object.
146
146
///
147
147
/// @param bytes_ptr A `uint8_t` byte sequence to decode.
148
148
/// @param length The length of `bytes_ptr`.
149
149
/// @result The decoded JavaScript string object.
150
- IMPORT_JS_FUNCTION (swjs_decode_string , JavaScriptObjectRef , (const unsigned char * bytes_ptr , const int length ))
150
+ IMPORT_JS_FUNCTION (swjs_decode_string , JavaScriptObjectRef , (const unsigned char * _Nonnull bytes_ptr , const int length ))
151
151
152
152
/// Loads the actual bytes sequence of `bytes` into `buffer` which is a Swift side memory address.
153
153
///
154
154
/// @param bytes A bytes sequence representation in JavaScript to load. This value should be derived from `_encode_string`.
155
155
/// @param buffer A Swift side string buffer to load the bytes.
156
- IMPORT_JS_FUNCTION (swjs_load_string , void , (const JavaScriptObjectRef bytes , unsigned char * buffer ))
156
+ IMPORT_JS_FUNCTION (swjs_load_string , void , (const JavaScriptObjectRef bytes , unsigned char * _Nonnull buffer ))
157
157
158
158
/// Converts the provided Int64 or UInt64 to a BigInt in slow path by splitting 64bit integer to two 32bit integers
159
159
/// to avoid depending on [JS-BigInt-integration](https://github.com/WebAssembly/JS-BigInt-integration) feature
@@ -172,10 +172,10 @@ IMPORT_JS_FUNCTION(swjs_i64_to_bigint_slow, JavaScriptObjectRef, (unsigned int l
172
172
/// @param result_payload2 A result pointer of second payload of JavaScript value of returned result or thrown exception.
173
173
/// @return A `JavaScriptValueKindAndFlags` bits represented as 32bit integer for the returned value.
174
174
IMPORT_JS_FUNCTION (swjs_call_function , uint32_t , (const JavaScriptObjectRef ref ,
175
- const RawJSValue * argv ,
175
+ const RawJSValue * _Nullable argv ,
176
176
const int argc ,
177
- JavaScriptPayload1 * result_payload1 ,
178
- JavaScriptPayload2 * result_payload2 ))
177
+ JavaScriptPayload1 * _Nonnull result_payload1 ,
178
+ JavaScriptPayload2 * _Nonnull result_payload2 ))
179
179
180
180
/// Calls JavaScript function with given arguments list without capturing any exception
181
181
///
@@ -186,10 +186,10 @@ IMPORT_JS_FUNCTION(swjs_call_function, uint32_t, (const JavaScriptObjectRef ref,
186
186
/// @param result_payload2 A result pointer of second payload of JavaScript value of returned result or thrown exception.
187
187
/// @return A `JavaScriptValueKindAndFlags` bits represented as 32bit integer for the returned value.
188
188
IMPORT_JS_FUNCTION (swjs_call_function_no_catch , uint32_t , (const JavaScriptObjectRef ref ,
189
- const RawJSValue * argv ,
189
+ const RawJSValue * _Nullable argv ,
190
190
const int argc ,
191
- JavaScriptPayload1 * result_payload1 ,
192
- JavaScriptPayload2 * result_payload2 ))
191
+ JavaScriptPayload1 * _Nonnull result_payload1 ,
192
+ JavaScriptPayload2 * _Nonnull result_payload2 ))
193
193
194
194
/// Calls JavaScript function with given arguments list and given `_this`.
195
195
///
@@ -202,10 +202,10 @@ IMPORT_JS_FUNCTION(swjs_call_function_no_catch, uint32_t, (const JavaScriptObjec
202
202
/// @return A `JavaScriptValueKindAndFlags` bits represented as 32bit integer for the returned value.
203
203
IMPORT_JS_FUNCTION (swjs_call_function_with_this , uint32_t , (const JavaScriptObjectRef _this ,
204
204
const JavaScriptObjectRef func_ref ,
205
- const RawJSValue * argv ,
205
+ const RawJSValue * _Nullable argv ,
206
206
const int argc ,
207
- JavaScriptPayload1 * result_payload1 ,
208
- JavaScriptPayload2 * result_payload2 ))
207
+ JavaScriptPayload1 * _Nonnull result_payload1 ,
208
+ JavaScriptPayload2 * _Nonnull result_payload2 ))
209
209
210
210
/// Calls JavaScript function with given arguments list and given `_this` without capturing any exception.
211
211
///
@@ -218,10 +218,10 @@ IMPORT_JS_FUNCTION(swjs_call_function_with_this, uint32_t, (const JavaScriptObje
218
218
/// @return A `JavaScriptValueKindAndFlags` bits represented as 32bit integer for the returned value.
219
219
IMPORT_JS_FUNCTION (swjs_call_function_with_this_no_catch , uint32_t , (const JavaScriptObjectRef _this ,
220
220
const JavaScriptObjectRef func_ref ,
221
- const RawJSValue * argv ,
221
+ const RawJSValue * _Nullable argv ,
222
222
const int argc ,
223
- JavaScriptPayload1 * result_payload1 ,
224
- JavaScriptPayload2 * result_payload2 ))
223
+ JavaScriptPayload1 * _Nonnull result_payload1 ,
224
+ JavaScriptPayload2 * _Nonnull result_payload2 ))
225
225
226
226
/// Calls JavaScript object constructor with given arguments list.
227
227
///
@@ -230,7 +230,7 @@ IMPORT_JS_FUNCTION(swjs_call_function_with_this_no_catch, uint32_t, (const JavaS
230
230
/// @param argc The length of `argv``.
231
231
/// @returns A reference to the constructed object.
232
232
IMPORT_JS_FUNCTION (swjs_call_new , JavaScriptObjectRef , (const JavaScriptObjectRef ref ,
233
- const RawJSValue * argv ,
233
+ const RawJSValue * _Nullable argv ,
234
234
const int argc ))
235
235
236
236
/// Calls JavaScript object constructor with given arguments list.
@@ -243,11 +243,11 @@ IMPORT_JS_FUNCTION(swjs_call_new, JavaScriptObjectRef, (const JavaScriptObjectRe
243
243
/// @param exception_payload2 A result pointer of second payload of JavaScript value of thrown exception.
244
244
/// @returns A reference to the constructed object.
245
245
IMPORT_JS_FUNCTION (swjs_call_throwing_new , JavaScriptObjectRef , (const JavaScriptObjectRef ref ,
246
- const RawJSValue * argv ,
246
+ const RawJSValue * _Nullable argv ,
247
247
const int argc ,
248
- JavaScriptRawValueKindAndFlags * exception_kind ,
249
- JavaScriptPayload1 * exception_payload1 ,
250
- JavaScriptPayload2 * exception_payload2 ))
248
+ JavaScriptRawValueKindAndFlags * _Nonnull exception_kind ,
249
+ JavaScriptPayload1 * _Nonnull exception_payload1 ,
250
+ JavaScriptPayload2 * _Nonnull exception_payload2 ))
251
251
252
252
/// Acts like JavaScript `instanceof` operator.
253
253
///
@@ -276,14 +276,14 @@ IMPORT_JS_FUNCTION(swjs_create_function, JavaScriptObjectRef, (const JavaScriptH
276
276
/// @param length The length of `elements_ptr`
277
277
/// @returns A reference to the constructed typed array
278
278
IMPORT_JS_FUNCTION (swjs_create_typed_array , JavaScriptObjectRef , (const JavaScriptObjectRef constructor ,
279
- const void * elements_ptr ,
279
+ const void * _Nullable elements_ptr ,
280
280
const int length ))
281
281
282
282
/// Copies the byte contents of a typed array into a Swift side memory buffer.
283
283
///
284
284
/// @param ref A JavaScript typed array object.
285
285
/// @param buffer A Swift side buffer into which to copy the bytes.
286
- IMPORT_JS_FUNCTION (swjs_load_typed_array , void , (const JavaScriptObjectRef ref , unsigned char * buffer ))
286
+ IMPORT_JS_FUNCTION (swjs_load_typed_array , void , (const JavaScriptObjectRef ref , unsigned char * _Nonnull buffer ))
287
287
288
288
/// Decrements reference count of `ref` retained by `SwiftRuntimeHeap` in JavaScript side.
289
289
///
0 commit comments