-
Notifications
You must be signed in to change notification settings - Fork 303
/
Copy pathevent_target.cc
515 lines (405 loc) · 19.9 KB
/
event_target.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
/*
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
*/
#include "event_target.h"
#include <utility>
#include "bindings/qjs/bom/window.h"
#include "bindings/qjs/dom/text_node.h"
#include "bindings/qjs/qjs_patch.h"
#include "document.h"
#include "element.h"
#include "event.h"
#include "kraken_bridge.h"
#define PROPAGATION_STOPPED 1
#define PROPAGATION_CONTINUE 0
#if UNIT_TEST
#include "kraken_test_env.h"
#endif
namespace kraken::binding::qjs {
static std::atomic<int32_t> globalEventTargetId{0};
std::once_flag kEventTargetInitFlag;
void bindEventTarget(ExecutionContext* context) {
auto* constructor = EventTarget::instance(context);
// Set globalThis and Window's prototype to EventTarget's prototype to support EventTarget methods in global.
JS_SetPrototype(context->ctx(), context->global(), constructor->jsObject);
context->defineGlobalProperty("EventTarget", constructor->jsObject);
}
JSClassID EventTarget::kEventTargetClassId{0};
EventTarget::EventTarget(ExecutionContext* context, const char* name) : HostClass(context, name) {}
EventTarget::EventTarget(ExecutionContext* context) : HostClass(context, "EventTarget") {
std::call_once(kEventTargetInitFlag, []() { JS_NewClassID(&kEventTargetClassId); });
}
JSValue EventTarget::instanceConstructor(JSContext* ctx, JSValue func_obj, JSValue this_val, int argc, JSValue* argv) {
auto eventTarget = new EventTargetInstance(this, kEventTargetClassId, "EventTarget");
return eventTarget->jsObject;
}
JSClassID EventTarget::classId() {
assert_m(false, "classId is not implemented");
return 0;
}
JSClassID EventTarget::classId(JSValue& value) {
JSClassID classId = JSValueGetClassId(value);
return classId;
}
JSValue EventTarget::addEventListener(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
if (argc < 2) {
return JS_ThrowTypeError(ctx, "Failed to addEventListener: type and listener are required.");
}
auto* eventTargetInstance = static_cast<EventTargetInstance*>(JS_GetOpaque(this_val, EventTarget::classId(this_val)));
if (eventTargetInstance == nullptr) {
return JS_ThrowTypeError(ctx, "Failed to addEventListener: this is not an EventTarget object.");
}
JSValue eventTypeValue = argv[0];
JSValue callback = argv[1];
if (!JS_IsString(eventTypeValue) || !JS_IsObject(callback) || !JS_IsFunction(ctx, callback)) {
return JS_UNDEFINED;
}
// EventType atom will be freed when eventTarget finalized.
JSAtom eventType = JS_ValueToAtom(ctx, eventTypeValue);
// Dart needs to be notified for the first registration event.
if (!eventTargetInstance->m_eventListenerMap.contains(eventType) || eventTargetInstance->m_eventHandlerMap.contains(eventType)) {
int32_t contextId = eventTargetInstance->prototype()->contextId();
NativeString args_01{};
buildUICommandArgs(ctx, eventTypeValue, args_01);
eventTargetInstance->m_context->uiCommandBuffer()->addCommand(eventTargetInstance->m_eventTargetId, UICommand::addEvent, args_01, nullptr);
}
bool success = eventTargetInstance->m_eventListenerMap.add(eventType, JS_DupValue(ctx, callback));
// Callback didn't saved to eventListenerMap.
if (!success) {
JS_FreeAtom(ctx, eventType);
JS_FreeValue(ctx, callback);
}
return JS_UNDEFINED;
}
JSValue EventTarget::removeEventListener(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
if (argc < 2) {
return JS_ThrowTypeError(ctx, "Failed to removeEventListener: at least type and listener are required.");
}
auto* eventTargetInstance = static_cast<EventTargetInstance*>(JS_GetOpaque(this_val, EventTarget::classId(this_val)));
if (eventTargetInstance == nullptr) {
return JS_ThrowTypeError(ctx, "Failed to addEventListener: this is not an EventTarget object.");
}
JSValue eventTypeValue = argv[0];
JSValue callback = argv[1];
if (!JS_IsString(eventTypeValue) || !JS_IsObject(callback) || !JS_IsObject(callback)) {
return JS_ThrowTypeError(ctx, "Failed to removeEventListener: eventName should be an string.");
}
JSAtom eventType = JS_ValueToAtom(ctx, eventTypeValue);
auto& eventHandlers = eventTargetInstance->m_eventListenerMap;
if (!eventTargetInstance->m_eventListenerMap.contains(eventType)) {
JS_FreeAtom(ctx, eventType);
return JS_UNDEFINED;
}
if (eventHandlers.remove(eventType, callback)) {
JS_FreeAtom(ctx, eventType);
JS_FreeValue(ctx, callback);
}
if (eventHandlers.empty() && eventTargetInstance->m_eventHandlerMap.contains(eventType)) {
// Dart needs to be notified for handles is empty.
int32_t contextId = eventTargetInstance->prototype()->contextId();
NativeString args_01{};
buildUICommandArgs(ctx, eventTypeValue, args_01);
eventTargetInstance->m_context->uiCommandBuffer()->addCommand(eventTargetInstance->m_eventTargetId, UICommand::removeEvent, args_01, nullptr);
}
JS_FreeAtom(ctx, eventType);
return JS_UNDEFINED;
}
JSValue EventTarget::dispatchEvent(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
if (argc != 1) {
return JS_ThrowTypeError(ctx, "Failed to dispatchEvent: first arguments should be an event object");
}
auto* eventTargetInstance = static_cast<EventTargetInstance*>(JS_GetOpaque(this_val, EventTarget::classId(this_val)));
if (eventTargetInstance == nullptr) {
return JS_ThrowTypeError(ctx, "Failed to addEventListener: this is not an EventTarget object.");
}
JSValue eventValue = argv[0];
auto eventInstance = reinterpret_cast<EventInstance*>(JS_GetOpaque(eventValue, EventTarget::classId(eventValue)));
#if ANDROID_32_BIT
eventInstance->nativeEvent->target = reinterpret_cast<int64_t>(eventTargetInstance);
#else
eventInstance->nativeEvent->target = eventTargetInstance;
#endif
return JS_NewBool(ctx, eventTargetInstance->dispatchEvent(eventInstance));
}
bool EventTargetInstance::dispatchEvent(EventInstance* event) {
auto* pEventType = reinterpret_cast<NativeString*>(event->nativeEvent->type);
std::u16string u16EventType = std::u16string(reinterpret_cast<const char16_t*>(pEventType->string), pEventType->length);
std::string eventType = toUTF8(u16EventType);
// protect this util event trigger finished.
JS_DupValue(m_ctx, jsObject);
internalDispatchEvent(event);
JS_FreeValue(m_ctx, jsObject);
return event->cancelled();
}
bool EventTargetInstance::internalDispatchEvent(EventInstance* eventInstance) {
std::u16string u16EventType = std::u16string(reinterpret_cast<const char16_t*>(eventInstance->type()->string), eventInstance->type()->length);
std::string eventTypeStr = toUTF8(u16EventType);
JSAtom eventType = JS_NewAtom(m_ctx, eventTypeStr.c_str());
// Modify the currentTarget to this.
eventInstance->setCurrentTarget(this);
// Dispatch event listeners writen by addEventListener
auto _dispatchEvent = [&eventInstance, this](JSValue handler) {
if (!JS_IsFunction(m_ctx, handler))
return;
if (eventInstance->propagationImmediatelyStopped())
return;
/* 'handler' might be destroyed when calling itself (if it frees the
handler), so must take extra care */
JS_DupValue(m_ctx, handler);
// The third params `thisObject` to null equals global object.
JSValue returnedValue = JS_Call(m_ctx, handler, JS_NULL, 1, &eventInstance->jsObject);
JS_FreeValue(m_ctx, handler);
m_context->handleException(&returnedValue);
m_context->drainPendingPromiseJobs();
JS_FreeValue(m_ctx, returnedValue);
};
if (m_eventListenerMap.contains(eventType)) {
const EventListenerVector* vector = m_eventListenerMap.find(eventType);
for (auto& eventHandler : *vector) {
_dispatchEvent(eventHandler);
}
}
// Dispatch event listener white by 'on' prefix property.
if (m_eventHandlerMap.contains(eventType)) {
auto* window = static_cast<EventTargetInstance*>(JS_GetOpaque(context()->global(), 1));
// Let special error event handling be true if event is an ErrorEvent.
bool specialErrorEventHanding = eventTypeStr == "error" && eventInstance->currentTarget() == window;
if (specialErrorEventHanding) {
auto _dispatchErrorEvent = [&eventInstance, this, eventTypeStr](JSValue handler) {
JSValue error = JS_GetPropertyStr(m_ctx, eventInstance->jsObject, "error");
JSValue messageValue = JS_GetPropertyStr(m_ctx, error, "message");
JSValue lineNumberValue = JS_GetPropertyStr(m_ctx, error, "lineNumber");
JSValue fileNameValue = JS_GetPropertyStr(m_ctx, error, "fileName");
JSValue columnValue = JS_NewUint32(m_ctx, 0);
JSValue args[]{messageValue, fileNameValue, lineNumberValue, columnValue, error};
JSValue returnValue = JS_Call(m_ctx, handler, eventInstance->jsObject, 5, args);
m_context->drainPendingPromiseJobs();
m_context->handleException(&returnValue);
JS_FreeValue(m_ctx, error);
JS_FreeValue(m_ctx, messageValue);
JS_FreeValue(m_ctx, fileNameValue);
JS_FreeValue(m_ctx, lineNumberValue);
JS_FreeValue(m_ctx, columnValue);
};
_dispatchErrorEvent(m_eventHandlerMap.getProperty(eventType));
} else {
_dispatchEvent(m_eventHandlerMap.getProperty(eventType));
}
}
JS_FreeAtom(m_ctx, eventType);
// do not dispatch event when event has been canceled
// true is prevented.
return eventInstance->cancelled();
}
EventTargetInstance::EventTargetInstance(EventTarget* eventTarget, JSClassID classId, JSClassExoticMethods& exoticMethods, std::string name)
: Instance(eventTarget, name, &exoticMethods, classId, finalize) {
m_eventTargetId = globalEventTargetId++;
}
EventTargetInstance::EventTargetInstance(EventTarget* eventTarget, JSClassID classId, std::string name) : Instance(eventTarget, std::move(name), nullptr, classId, finalize) {
m_eventTargetId = globalEventTargetId++;
}
EventTargetInstance::EventTargetInstance(EventTarget* eventTarget, JSClassID classId, std::string name, int64_t eventTargetId)
: Instance(eventTarget, std::move(name), nullptr, classId, finalize), m_eventTargetId(eventTargetId) {}
JSClassID EventTargetInstance::classId() {
assert_m(false, "classId is not implemented");
return 0;
}
EventTargetInstance::~EventTargetInstance() {
#if UNIT_TEST
// Callback to unit test specs before eventTarget finalized.
if (TEST_getEnv(m_context->uniqueId)->onEventTargetDisposed != nullptr) {
TEST_getEnv(m_context->uniqueId)->onEventTargetDisposed(this);
}
#endif
m_context->uiCommandBuffer()->addCommand(m_eventTargetId, UICommand::disposeEventTarget, nullptr, false);
getDartMethod()->flushUICommand();
delete nativeEventTarget;
}
int EventTargetInstance::hasProperty(JSContext* ctx, JSValue obj, JSAtom atom) {
auto* eventTarget = static_cast<EventTargetInstance*>(JS_GetOpaque(obj, JSValueGetClassId(obj)));
auto* prototype = static_cast<EventTarget*>(eventTarget->prototype());
if (JS_HasProperty(ctx, prototype->m_prototypeObject, atom))
return true;
JSValue atomString = JS_AtomToString(ctx, atom);
JSString* p = JS_VALUE_GET_STRING(atomString);
// There are still one reference_count in atom. It's safe to free here.
JS_FreeValue(ctx, atomString);
if (!p->is_wide_char && p->u.str8[0] == 'o' && p->u.str8[1] == 'n') {
const char* eventTypeName = reinterpret_cast<const char*>(p->u.str8);
if (EventTypeNames::isEventTypeName(eventTypeName)) {
return true;
}
return !JS_IsNull(eventTarget->getAttributesEventHandler(p));
}
return eventTarget->m_properties.contains(atom);
}
JSValue EventTargetInstance::getProperty(JSContext* ctx, JSValue obj, JSAtom atom, JSValue receiver) {
auto* eventTarget = static_cast<EventTargetInstance*>(JS_GetOpaque(obj, JSValueGetClassId(obj)));
JSValue prototype = JS_GetPrototype(ctx, eventTarget->jsObject);
if (JS_HasProperty(ctx, prototype, atom)) {
JSValue ret = JS_GetPropertyInternal(ctx, prototype, atom, eventTarget->jsObject, 0);
JS_FreeValue(ctx, prototype);
return ret;
}
JS_FreeValue(ctx, prototype);
JSValue atomString = JS_AtomToString(ctx, atom);
JSString* p = JS_VALUE_GET_STRING(atomString);
// There are still one reference_count in atom. It's safe to free here.
JS_FreeValue(ctx, atomString);
if (!p->is_wide_char && p->u.str8[0] == 'o' && p->u.str8[1] == 'n') {
return eventTarget->getAttributesEventHandler(p);
}
if (eventTarget->m_properties.contains(atom)) {
return JS_DupValue(ctx, eventTarget->m_properties.getProperty(atom));
}
// For plugin elements, try to auto generate properties and functions from dart response.
if (isJavaScriptExtensionElementInstance(eventTarget->context(), eventTarget->jsObject)) {
const char* cmethod = JS_AtomToCString(eventTarget->m_ctx, atom);
// Property starts with underscore are taken as private property in javascript object.
if (cmethod[0] == '_') {
JS_FreeCString(eventTarget->m_ctx, cmethod);
return JS_UNDEFINED;
}
JSValue result = eventTarget->getBindingProperty(cmethod);
JS_FreeCString(ctx, cmethod);
return result;
}
return JS_UNDEFINED;
}
int EventTargetInstance::setProperty(JSContext* ctx, JSValue obj, JSAtom atom, JSValue value, JSValue receiver, int flags) {
auto* eventTarget = static_cast<EventTargetInstance*>(JS_GetOpaque(obj, JSValueGetClassId(obj)));
JSValue prototype = JS_GetPrototype(ctx, eventTarget->jsObject);
// Check there are setter functions on prototype.
if (JS_HasProperty(ctx, prototype, atom)) {
// Read setter function from prototype Object.
JSPropertyDescriptor descriptor;
JS_GetOwnProperty(ctx, &descriptor, prototype, atom);
JSValue setterFunc = descriptor.setter;
assert_m(JS_IsFunction(ctx, setterFunc), "Setter on prototype should be an function.");
JSValue ret = JS_Call(ctx, setterFunc, eventTarget->jsObject, 1, &value);
if (JS_IsException(ret))
return -1;
JS_FreeValue(ctx, ret);
JS_FreeValue(ctx, descriptor.setter);
JS_FreeValue(ctx, descriptor.getter);
JS_FreeValue(ctx, prototype);
return 1;
}
JS_FreeValue(ctx, prototype);
JSValue atomString = JS_AtomToString(ctx, atom);
JSString* p = JS_VALUE_GET_STRING(atomString);
if (!p->is_wide_char && p->len > 2 && p->u.str8[0] == 'o' && p->u.str8[1] == 'n') {
eventTarget->setAttributesEventHandler(p, value);
} else {
eventTarget->m_properties.setProperty(JS_DupAtom(ctx, atom), JS_DupValue(ctx, value));
if (isJavaScriptExtensionElementInstance(eventTarget->context(), eventTarget->jsObject) && !p->is_wide_char && p->u.str8[0] != '_') {
std::unique_ptr<NativeString> args_01 = atomToNativeString(ctx, atom);
std::unique_ptr<NativeString> args_02 = jsValueToNativeString(ctx, value);
eventTarget->m_context->uiCommandBuffer()->addCommand(eventTarget->m_eventTargetId, UICommand::setAttribute, *args_01, *args_02, nullptr);
}
}
JS_FreeValue(ctx, atomString);
return 0;
}
int EventTargetInstance::deleteProperty(JSContext* ctx, JSValue obj, JSAtom prop) {
return 0;
}
JSValue EventTargetInstance::invokeBindingMethod(const char* method, int32_t argc, NativeValue* argv) {
if (nativeEventTarget->invokeBindingMethod == nullptr) {
return JS_ThrowTypeError(m_ctx, "Failed to call dart method: invokeBindingMethod not initialized.");
}
std::u16string methodString;
fromUTF8(method, methodString);
NativeString m{reinterpret_cast<const uint16_t*>(methodString.c_str()), static_cast<uint32_t>(methodString.size())};
NativeValue nativeValue{};
nativeEventTarget->invokeBindingMethod(nativeEventTarget, &nativeValue, &m, argc, argv);
JSValue returnValue = nativeValueToJSValue(m_context, nativeValue);
return returnValue;
}
void EventTargetInstance::setAttributesEventHandler(JSString* p, JSValue value) {
char eventType[p->len + 1 - 2];
memcpy(eventType, &p->u.str8[2], p->len + 1 - 2);
JSAtom atom = JS_NewAtom(m_ctx, eventType);
// When evaluate scripts like 'element.onclick = null', we needs to remove the event handlers callbacks
if (JS_IsNull(value)) {
m_eventHandlerMap.erase(atom);
JS_FreeAtom(m_ctx, atom);
return;
}
m_eventHandlerMap.setProperty(atom, JS_DupValue(m_ctx, value));
if (JS_IsFunction(m_ctx, value) && m_eventListenerMap.empty()) {
int32_t contextId = m_context->getContextId();
std::unique_ptr<NativeString> args_01 = atomToNativeString(m_ctx, atom);
int32_t type = JS_IsFunction(m_ctx, value) ? UICommand::addEvent : UICommand::removeEvent;
m_context->uiCommandBuffer()->addCommand(m_eventTargetId, type, *args_01, nullptr);
}
}
JSValue EventTargetInstance::getAttributesEventHandler(JSString* p) {
char eventType[p->len + 1 - 2];
memcpy(eventType, &p->u.str8[2], p->len + 1 - 2);
JSAtom atom = JS_NewAtom(m_ctx, eventType);
if (!m_eventHandlerMap.contains(atom)) {
JS_FreeAtom(m_ctx, atom);
return JS_NULL;
}
JSValue handler = JS_DupValue(m_ctx, m_eventHandlerMap.getProperty(atom));
JS_FreeAtom(m_ctx, atom);
return handler;
}
void EventTargetInstance::finalize(JSRuntime* rt, JSValue val) {
auto* eventTarget = static_cast<EventTargetInstance*>(JS_GetOpaque(val, EventTarget::classId(val)));
delete eventTarget;
}
JSValue EventTargetInstance::getBindingProperty(const char* prop) {
getDartMethod()->flushUICommand();
NativeValue args[] = {Native_NewCString(prop)};
return invokeBindingMethod(GetPropertyMagic, 1, args);
}
void EventTargetInstance::setBindingProperty(const char* prop, NativeValue value) {
// If not flush UICommands, the element may not be created.
getDartMethod()->flushUICommand();
NativeValue args[] = {Native_NewCString(prop), value};
invokeBindingMethod(SetPropertyMagic, 2, args);
}
// JSValues are stored in this class are no visible to QuickJS GC.
// We needs to gc which JSValues are still holding.
void EventTargetInstance::trace(JSRuntime* rt, JSValue val, JS_MarkFunc* mark_func) {
// Trace m_eventListeners.
m_eventListenerMap.trace(rt, JS_UNDEFINED, mark_func);
// Trace m_eventHandlers.
m_eventHandlerMap.trace(rt, JS_UNDEFINED, mark_func);
// Trace properties.
m_properties.trace(rt, JS_UNDEFINED, mark_func);
}
void EventTargetInstance::copyNodeProperties(EventTargetInstance* newNode, EventTargetInstance* referenceNode) {
referenceNode->m_properties.copyWith(&newNode->m_properties);
}
int32_t NativeEventTarget::dispatchEventImpl(int32_t contextId, NativeEventTarget* nativeEventTarget, NativeString* nativeEventType, void* rawEvent, int32_t isCustomEvent) {
assert_m(nativeEventTarget->instance != nullptr, "NativeEventTarget should have owner");
EventTargetInstance* eventTargetInstance = nativeEventTarget->instance;
auto* runtime = ExecutionContext::runtime();
// Should avoid dispatch event is ctx is invalid.
if (!isContextValid(contextId)) {
return 1;
}
// We should avoid trigger event if eventTarget are no long live on heap.
if (!JS_IsLiveObject(runtime, eventTargetInstance->jsObject)) {
return 1;
}
ExecutionContext* context = eventTargetInstance->context();
std::u16string u16EventType = std::u16string(reinterpret_cast<const char16_t*>(nativeEventType->string), nativeEventType->length);
std::string eventType = toUTF8(u16EventType);
auto* raw = static_cast<RawEvent*>(rawEvent);
// NativeEvent members are memory aligned corresponding to NativeEvent.
// So we can reinterpret_cast raw bytes pointer to NativeEvent type directly.
auto* nativeEvent = reinterpret_cast<NativeEvent*>(raw->bytes);
EventInstance* eventInstance = Event::buildEventInstance(eventType, context, nativeEvent, isCustomEvent == 1);
eventTargetInstance->dispatchEvent(eventInstance);
bool propagationStopped = eventInstance->propagationStopped();
JS_FreeValue(context->ctx(), eventInstance->jsObject);
// FIXME: The return value is first propagationStopped instead of cancelable, and then implement a separate method to synchronize propagationStopped.
// Dispatches a synthetic event event to target and returns true if either event’s cancelable attribute value is false or its preventDefault() method was not invoked; otherwise false.
// https://dom.spec.whatwg.org/#ref-for-dom-eventtarget-dispatchevent%E2%91%A2
return propagationStopped ? PROPAGATION_STOPPED : PROPAGATION_CONTINUE;
}
} // namespace kraken::binding::qjs