HE Shi-Jun

Results 543 comments of HE Shi-Jun

Yeah, so I think `Function.xxx` should be the first choice for helpers proposals. But if we are considering some syntax proposal, for example, extensions or call-this proposal, we could consider...

@lifaon74 Thank you for the wonderful example. I'm planning update the proposal in next TC39 meeting. My idea is moving from `function.sent` meta property to receive parameter. So your example...

@nikolaybotev Yes, see the old issue: https://github.com/tc39/proposal-function.sent/issues/3

Yeah, because `Function` is also a function, I generally dislike any new instance method on `Function.prototype`. For `once`, there is also a small readability problem of ```js let f =...

> I'm for `Function.prototype.once` for consistency with `.bind`. I don't think `F.p.bind` create any strong consistency requirements, `F.p.bind` have too many design flaws. 🤪

Yeah, consider decorator advanced to stage 3, I hope we could revisit function decorators in future meetings.

@ljharb Detecting whether being called as a decorator rely on the structural type of the parameter, which is not accurate. Some mechanism like `new.target` may be better. And there is...

U+2103 后面加空白不是就不能保持全部是方块字了?

Yes, you can do same with callback, but the motivation of this proposal it to provide better syntax for callback/blocks. Note this proposal also include a nest block feature, so...

@Dan503 This is the old proposal, the recent stage 1 proposal is here: https://github.com/tc39/proposal-type-annotations