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

Engine execute module resolving #1740

Merged
merged 2 commits into from Jan 13, 2024

Conversation

tomatosalat0
Copy link
Contributor

Problem

Non-module scripts can still import modules using the import() function. However, Engine.Execute and Engine.Evaluate always passed string.Empty as the source of the current script even if one was specified.

Change

With the change, ScriptRecord will get the value of Script.Location.Source as the source. Tests for Engine.Execute and Engine.Evalute with a custom IModuleLoader checking for a filled referencingModuleLocation were added.

The behavior for Engine.Execute without passing a source has not been changed (source is set to be <anonymous>)

Copy link
Collaborator

@lahma lahma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you for fixing this!

@lahma lahma merged commit dc20829 into sebastienros:main Jan 13, 2024
3 checks passed
@tomatosalat0 tomatosalat0 deleted the engine-execute-module-resolving branch January 13, 2024 19:57
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 this pull request may close these issues.

None yet

2 participants