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

Improve module evaluation by not requiring shim scripts in order to access namespace objects. #57

Open
Oceanswave opened this issue Mar 1, 2018 · 2 comments

Comments

@Oceanswave
Copy link
Member

Oceanswave commented Mar 1, 2018

Thanks to chakra-core/ChakraCore#4707, it's now possible to programmatically get at namespace objects.

This allows the functionality in
https://github.com/BaristaLabs/BaristaCore/blob/master/src/BaristaLabs.BaristaCore.Common/BaristaContext.cs#L456
and
https://github.com/BaristaLabs/BaristaCore/blob/master/src/BaristaLabs.BaristaCore.Common/BaristaModuleRecord.cs#L260

to no longer rely on a 'shim' script in order to get at the variables exported by modules. This should improve execution speed, remove pollution of the global namespace, reduce the possibility of down-stream side effects, and allow the export of non-default values as well.

@Oceanswave Oceanswave changed the title Improve module evaluation by not requiring shim scripts to get at the namespace objects. Improve module evaluation by not requiring shim scripts in order to access namespace objects. Mar 1, 2018
@Oceanswave
Copy link
Member Author

The upstream changes should be incorporated in ChakraCore 1.9.x

@Oceanswave
Copy link
Member Author

This functionality is now partially implemented thanks to the upstream changes in ChakraCore 1.10.x.

The relevant sections of BaristaModuleRecord.cs still parse script, however, as 1) It doesn't appear to be able to set variables in namespaces 2) attempting to eval getnamespace during module loading breaks the runtime and throws an exception.

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

No branches or pull requests

1 participant