forked from anko/eslisp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix macro-
require
from REPL and relative paths
This change fixes 2 classes of bugs relating to using `require` to load macros, and adds unit-tests for them: 1. Importing eslisp into a Node.js REPL and using that eslisp instance to run code that calls `require` would fail due to an assumption that `require.main` would always be defined, which it's not when running an interactive REPL. It should not fail. 2. When an eslisp file called `require` with a relative path, it was handled relative to the present working directory. It should instead be relative to that file. Closes anko#48. I went with a more in-depth fix than proposed there by @ynohtna, after discovering the second issue while writing tests.
- Loading branch information
Showing
5 changed files
with
146 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters