Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules can be invoked too many times #721

Closed
disnet opened this issue Jun 11, 2017 · 0 comments · Fixed by #724
Closed

modules can be invoked too many times #721

disnet opened this issue Jun 11, 2017 · 0 comments · Fixed by #724
Assignees

Comments

@disnet
Copy link
Member

disnet commented Jun 11, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant