Re: [whatwg/webidl] Allow dictionaries and callbacks to be distinguishable (Issue #1191)

I suspect this change could be made in a web-compatible way, but FWIW you could technically use a callback function as a dictionary, since functions are objects.

```
let silly = Object.assign(e => {}, {once: true});
document.body.addEventListener('click', silly, silly);
```

Probably just making these distinguishable and keeping the current logic whereby the IsCallable check happens before the dictionary conversion.

As a consistency point, EventTarget/addEventListener looks more like your second example -- but I don't think that pattern is ubiquitous.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1191#issuecomment-1250139587
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1191/1250139587@github.com>

Received on Saturday, 17 September 2022 20:59:24 UTC