Skip to content

Instantly share code, notes, and snippets.

@annevk
Created July 28, 2017 09:29
Show Gist options
  • Save annevk/fc52104c77cbe3ea02dbf8c00cfefda1 to your computer and use it in GitHub Desktop.
Save annevk/fc52104c77cbe3ea02dbf8c00cfefda1 to your computer and use it in GitHub Desktop.
Globals for promises, streams, exceptions, and objects in general

Due to unfortunate legacy reasons the HTML Standard had to define a rather complicated global setup. There's not just "the current global" (ECMAScript's current realm), but also entry and incumbent.

Which globals entry and incumbent are is not always well-defined:

There's also a more general issue with which global to use for objects in IDL and which global to use for report the exception.

Solving these problems requires a bunch of investigative testing, recommendations for changes to browsers (and corresponding bugs being filed), and recommendations for changes to standards (ideally in the form of PRs). Ideally it's solved in such a way that whenever new objects get defined in either ECMAScript or IDL, the question of what global is used for the various operations no longer arises (or arises automatically as a design question due to it no longer being something that can be ignored).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment