A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/whatwg/webidl/issues/581 below:

Allow overload resolution to "round down"? · Issue #581 · whatwg/webidl · GitHub

In simplifying document.open() (see whatwg/html#3946) we would ideally like to have two overloads:

partial interface Document {
  [CEReactions] Document open();
  WindowProxy open(USVString url, DOMString name, DOMString features);
}

However, according to the overload resolution algorithm, if we did this, calls to document.open("historical", "historical") would throw pretty quickly:

  1. Effective overload set = { open(), open(url, name, features) }

  2. Let maxarg be the length of the longest type list of the entries in S = 3.

  3. Let n be the size of args = 2.

  4. Initialize argcount to be min(maxarg, n) = 2.

  5. Remove from S all entries whose type list is not of length argcount. S = empty set

  6. If S is empty, then throw a TypeError.

Would it be possible to tweak this to allow ignoring extra arguments? That seems more JavaScriptey to me...

Pointers to previous discussions appreciated.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4