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

Don't save setter for const exports. #134

Closed
jdalton opened this issue Apr 13, 2017 · 1 comment
Closed

Don't save setter for const exports. #134

jdalton opened this issue Apr 13, 2017 · 1 comment

Comments

@jdalton
Copy link
Contributor

jdalton commented Apr 13, 2017

This would address a line item on #90. It would also be a good time to think about the parser optimization to do a top-level only parse if there are only const exports and nested imports is disabled.

@benjamn
Copy link
Owner

benjamn commented Apr 14, 2017

Specifically, we can discard the setter after the first time it is called, if module.loaded is true, meaning we should have finished initializing all top-level const values.

@jdalton jdalton mentioned this issue May 16, 2017
9 tasks
benjamn added a commit that referenced this issue May 18, 2017
This allows us to simplify the module.export API significantly, since it
no longer sometimes takes a string as its first argument. Now `getters` is
always an object of methods that get the values of local variables, and
`constant` is an optional boolean to indicate that the getter functions
always return the same values, which helps with #134.
benjamn added a commit that referenced this issue May 18, 2017
These changes let the runtime know that the values returned by the getter
functions for

  export const a = 1, b = 2;

will never change. Unfortunately, it's more difficult to detect that the
same is true for

  const a = 1, b = 2;
  export { a, b };

though that's an area for future improvement.

Part of #134.
benjamn added a commit that referenced this issue May 19, 2017
Simplify module.export in order to implement #134
benjamn added a commit that referenced this issue May 26, 2017
This allows us to simplify the module.export API significantly, since it
no longer sometimes takes a string as its first argument. Now `getters` is
always an object of methods that get the values of local variables, and
`constant` is an optional boolean to indicate that the getter functions
always return the same values, which helps with #134.
benjamn added a commit that referenced this issue May 26, 2017
These changes let the runtime know that the values returned by the getter
functions for

  export const a = 1, b = 2;

will never change. Unfortunately, it's more difficult to detect that the
same is true for

  const a = 1, b = 2;
  export { a, b };

though that's an area for future improvement.

Part of #134.
taylorzane pushed a commit to taylorzane/reify that referenced this issue Feb 26, 2019
This allows us to simplify the module.export API significantly, since it
no longer sometimes takes a string as its first argument. Now `getters` is
always an object of methods that get the values of local variables, and
`constant` is an optional boolean to indicate that the getter functions
always return the same values, which helps with benjamn#134.
taylorzane pushed a commit to taylorzane/reify that referenced this issue Feb 26, 2019
These changes let the runtime know that the values returned by the getter
functions for

  export const a = 1, b = 2;

will never change. Unfortunately, it's more difficult to detect that the
same is true for

  const a = 1, b = 2;
  export { a, b };

though that's an area for future improvement.

Part of benjamn#134.
taylorzane pushed a commit to taylorzane/reify that referenced this issue Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants