J. S. Choi

Results 211 comments of J. S. Choi

@ljharb: We would probably SameValue semantics, although SameValueZero may also be reasonable. ```js const fn = (function (x) { return }).once(); const o = {}; fn(o); // Prints 1. fn(o);...

@ljharb: Could you clarify what sort of situation you’re thinking of? I’m assuming you’re talking about event targets in the DOM. Two different clicks will create two different event objects....

Yes, that is right; there’s just no way around the dilemma: If we want to pass the arguments, we either must either completely ignore them on subsequent calls (and possibly...

Yes, and to continue pointing at the [real-world examples in the explainer](https://github.com/tc39-transfer/proposal-function-once/blob/main/README.md#real-world-examples), we should look at what real-world scenarios other than EventTargets/EventEmitters would actually use their first calls’ arguments. With...

Ignoring the issue of what value to return (#2), I’d like to revisit caching the *arguments* of the first call and checking them on any subsequent call. This would ameliorate...

@ljharb: I was using `===` semantics. But you are right, I had forgotten about object mutability. Curses, that was the best chance I saw of passing, and not ignoring, arguments...

> I just found @js-choi's bind proposal repo - from what I understand, there's plans to present that one soon. I do like that proposal repo a little better -...

Youenn Fablet of WebKit has published a [blog post regarding WebKit’s policies on service workers](https://webkit.org/blog/8090/workers-at-your-service/). Maximiliano Firtman has also independently published a [blog post with further details on how iOS ...

I haven’t thought about it too much, so I removed that part from the explainer and slides. We can bikeshed about this before it reaches Stage 2. ```js function g...

I suppose one may view once functions as state machines with two states—uncalled and already-called. In that sense, once functions are different from bound functions, async functions, etc. It may...