Support generating event objects during events

This commit is contained in:
Daniel Silverstone 2015-11-01 11:23:15 +01:00
parent c2d51384c1
commit 1284731d1a

View File

@ -430,9 +430,15 @@ static void dukky_push_event(duk_context *ctx, dom_event *evt)
/* ... events undefined */ /* ... events undefined */
duk_pop(ctx); duk_pop(ctx);
/* ... events */ /* ... events */
duk_push_object(ctx); duk_push_pointer(ctx, evt);
if (dukky_create_object(ctx, PROTO_NAME(EVENT), 1) != DUK_EXEC_SUCCESS) {
/* ... events err */
duk_pop(ctx);
/* ... events */
duk_push_object(ctx);
/* ... events eobj[meh] */
}
/* ... events eobj */ /* ... events eobj */
/** @todo fill out the event object */
duk_push_pointer(ctx, evt); duk_push_pointer(ctx, evt);
/* ... events eobj eventptr */ /* ... events eobj eventptr */
duk_dup(ctx, -2); duk_dup(ctx, -2);