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
  • Issues
  • #721
Closed
Open
Issue created Jun 11, 2017 by Tim Disney@disnetContributor

modules can be `invoke`d too many times

A module imported for syntax is currently re-invoked for each module that imports it.

For example, given some modules like:

// lib.js
export const x = 1;

// mod.js
import { x } from './lib' for syntax;

export syntax m = ctx => {
  x;
  return #`1`;
}

// main.js
import { x } from './lib' for syntax;
import { m } from './mod';

syntax n = ctx => {
  x;
  return #`2`;
}

we get an error:

evalmachine.<anonymous>:1
const x_1 = 1;
^

SyntaxError: Identifier 'x_1' has already been declared

/cc @gabejohnson I think this is the root cause of the error you mentioned the other day.

Assignee
Assign to
Time tracking