-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support invocation with no this
#16
Comments
Although |
It conflicts with #13 Seems the answer is tc39/ecma262#544 |
The language is currently inconsistent. I think |
@bakkot by the link above you could find the explanation why |
@zloirock The link above does not contain the claim that I'd be curious to hear if @domenic still agrees with the position he expressed in that thread. Either way, though, I stand by the OP and my previous comment. |
Per discussion here and the next few days, I'm inclined to ignore the receiver entirely - i.e. no explicit affordances for subclassing. This is consistent with the set methods proposal (union, etc). |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [core-js](https://github.com/zloirock/core-js) | dependencies | minor | [`3.34.0` -> `3.35.0`](https://renovatebot.com/diffs/npm/core-js/3.34.0/3.35.0) | --- ### Release Notes <details> <summary>zloirock/core-js (core-js)</summary> ### [`v3.35.0`](https://github.com/zloirock/core-js/blob/HEAD/CHANGELOG.md#3350---20231229) [Compare Source](zloirock/core-js@v3.34.0...v3.35.0) - [`{ Map, Set, WeakMap, WeakSet }.{ from, of }`](https://github.com/tc39/proposal-setmap-offrom) became non-generic, following [this](tc39/proposal-setmap-offrom#16 (comment)) and some other notes. Now they can be invoked without `this`, but no longer return subclass instances - Fixed handling some cases of non-enumerable symbol keys from `Symbol` polyfill - Removed unneeded NodeJS domains-related logic from `queueMicrotask` polyfill - Fixed subclassing of wrapped `ArrayBuffer` - Refactoring, many different minor optimizations - Compat data improvements: - [`Array.fromAsync`](https://github.com/tc39/proposal-array-from-async) marked as [supported from V8 ~ Chrome 121](https://bugs.chromium.org/p/v8/issues/detail?id=13321#c13) - It seems that the ancient [`Array.prototype.push` bug](https://bugs.chromium.org/p/v8/issues/detail?id=12681) is fixed in V8 ~ Chrome 122 (Hallelujah!) - [`ArrayBuffer.prototype.transfer` and friends proposal](https://github.com/tc39/proposal-arraybuffer-transfer) features marked as [supported from FF 122](https://bugzilla.mozilla.org/show_bug.cgi?id=1865103#c8) and Bun 1.0.19 - [`Object.groupBy` and `Map.groupBy`](https://github.com/tc39/proposal-array-grouping) marked as supported from Bun 1.0.19 - Since [`Iterator` helpers proposal](https://github.com/tc39/proposal-iterator-helpers) methods are still not disabled in Deno, the web compatibility issue why it was disabled in Chromium makes no sense for Deno and fixed in the spec, they marked as supported from Deno 1.37 - Added Opera Android 80 and updated [Opera Android 79](https://forums.opera.com/topic/68490/opera-for-android-79) compat data mapping - Added Samsung Internet 24 compat data mapping </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/Droplet/pulls/253 Reviewed-by: Vylpes <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
It's nice to be able to treat functions like
Set.from
as actual functions which can be passed around, so that you can do stuff likelet sets = [ [0, 1], [2, 3] ].map(Set.from)
. As currently spec'd this does not work because of theIf IsConstructor(C) is false, throw a TypeError exception.
step.I think it would make sense to match the behavior of
Array.from
, which has the behavior of using the realm-default constructor forArray
when thethis
value is not constructible. That way you get the subclassing behavior (whereclass MyMap extends Map {}; MyMap.of() instanceof MyMap /* true */;
) while still allowing the functional-style invocation above.The text was updated successfully, but these errors were encountered: