1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[quickjs] second param for Event constructor

This commit is contained in:
Witold Filipczyk 2024-03-10 18:55:03 +01:00
parent 48c5e80b31
commit d0e80bbe83

View File

@ -208,6 +208,16 @@ js_event_constructor(JSContext *ctx, JSValueConst new_target, int argc, JSValueC
JS_FreeCString(ctx, str); JS_FreeCString(ctx, str);
} }
} }
if (argc > 1) {
JSValue r = JS_GetPropertyStr(ctx, argv[1], "bubbles");
event->bubbles = JS_ToBool(ctx, r);
r = JS_GetPropertyStr(ctx, argv[1], "cancelable");
event->cancelable = JS_ToBool(ctx, r);
r = JS_GetPropertyStr(ctx, argv[1], "composed");
event->composed = JS_ToBool(ctx, r);
}
JS_SetOpaque(obj, event); JS_SetOpaque(obj, event);
return obj; return obj;