Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S sweet-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • sweet-js
  • sweet-core
  • Merge requests
  • !737

Handle forwarding bindings better

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Tim Disney requested to merge fix/736 into master Jul 17, 2017
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 8

fixes #736 (closed)

Turns out there was an even simpler repro:

// mod.js
export var x = 1;

// main.js
import { x } from './mod.js';

The issue is the design of module hygiene assumes bundling of all the modules #662 and so sets up a forwarding binding for each imported name. This greatly simplifies module bundling (just emit each module and bindings take care of themselves) but since we don't have bundling yet we run into this problem.

The solution is a little hacky, only add forwarding bindings to import names when:

  • not the entrypoint or
  • importing for phase > 0 or
  • importing a compiletime binding

Don't merge just yet, I still need to add tests.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/736