A RetroSearch Logo

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

Search Query:

Showing content from https://github.com/heycam/webidl/issues/129 below:

Should probably spec a hasInstance for DOM interface objects · Issue #129 · whatwg/webidl · GitHub

Skip to content Navigation Menu

Saved searches Use saved searches to filter your results more quickly

Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Additional navigation options

Should probably spec a hasInstance for DOM interface objects #129

Description

Right now we have a [[HasInstance]] thing at http://heycam.github.io/webidl/#es-interface-hasinstance but that's gone in ES6.

Proposed prose with similar semantics is something like:

  1. Let F be the this value.
  2. Let V be the first argument we were passed.
  3. If F is not an object, return false.
  4. If F is not an interface object, return false (or delegate to OrdinaryHasInstance?)
  5. If V is not an object, return false.
  6. If V is an object that implements the interface for which F is the interface object (defined in terms of brands, whatever), return true.
  7. Return OrdinaryHasInstance(F, V).

@domenic, thoughts?

An open question is whether Node[Symbol.hasInstance] == Element[Symbol.hasInstance] should test true or false. We could go either way, given the above prose, since they would implement the same algorithm...

You can’t perform that action at this time.


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.3