Skip to content

Commit ddaff0d

Browse files
Ensuring “event.data” is setted reliably
1 parent d77372a commit ddaff0d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/events/on.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ function on ( this: Cash, eventFullName: Record<string, EventCallback> | string,
122122

123123
}
124124

125-
event.data = data;
125+
Object.defineProperty ( event, 'data', {
126+
configurable: true,
127+
get () {
128+
return data;
129+
}
130+
});
126131

127132
const returnValue = callback.call ( thisArg, event, event.___td );
128133

0 commit comments

Comments
 (0)