tc39 / proposal-global

ECMAScript Proposal, specs, and reference implementation for `global`
http://tc39.github.io/proposal-global/
MIT License
349 stars 18 forks source link

Has import.meta.window been considered? #23

Closed guybedford closed 6 years ago

guybedford commented 6 years ago

I couldn't see anything in previous discussion here, but since this contains contextual scope information, it doesn't seem a bad home for global either.

import.window could even work too possibly.

Completely understand if a unique identifier is the goal though, but wondering if this would side-step any of those frictions.

ljharb commented 6 years ago

A syntactic solution is a nonstarter, because that means it couldn’t be denied to untrusted code.

ljharb commented 6 years ago

(Also, it needs to work in Scripts, not just Modules, and import.meta is not yet stage 4)

Mouvedia commented 5 years ago

it needs to work in Scripts, not just Modules

Too bad import global from this would have been really ingenious because you can rename the default however you want.

ljharb commented 5 years ago

import would only work in Modules as well.