Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

Communication Channel opened by import.meta #20

@jridgewell

Description

@jridgewell

Part of the discussion was about a communication channel opened by import.meta. It centers on the cached object being reused in a second evaluation of the module as part of Steps 3 and 4.f.

However, the module that this object is cached on is not reused another evaluation of the module. GetActiveScriptOrModule() grabs the active module from the execution context. I don't believe there can ever be a second evaluation of the same module that would reuse this execution context.

With that, I don't see import.meta being any different than a module-scoped const declaration at the beginning of the module. Something like:

const __SPECIAL_MODULE_SCOPED_IMPORT_META__ = { url: 'https://example.com' };

function foo() {
  // import.meta.url
  __SPECIAL_MODULE_SCOPED_IMPORT_META__.url
}

I don't think there are any communication channels opened by this proposal.

/cc @erights

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions