Skip to content

Commit

Permalink
Define "implements" checks using internal slots
Browse files Browse the repository at this point in the history
- Define an imperative algorithm for instantiating a platform object,
  which everything theoretically calls into, and which sets the primary
  interface into a new internal slot [[PrimaryInterface]].
- Define the "implements" algorithm as checking the [[PrimaryInterface]]
  internal slot.

The algorithm here is roughly in correspondence with the V8 implementation,
where operation functions are allocated with a reference to a
FunctionTemplate object (which is in corresondence with WebIDL interfaces).
When checking the receiver of a method that came from WebIDL, the original
prototype chain is traversed by looking at the FunctionTemplate's parent.
The same FunctionTemplate is used in multiple JavaScript realms.

This PR procrastinates on defining an imperative algorithm for [Global]
interfaces, which would be a bit more text. It also doesn't define which
global object is associated with platform objects, or how this association
is represented.

Fixes whatwg#97
  • Loading branch information
littledan committed Dec 9, 2018
1 parent 5a20e34 commit 98c9ef6
Showing 1 changed file with 122 additions and 75 deletions.
Loading

0 comments on commit 98c9ef6

Please sign in to comment.