We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Code as follows
func TestDoubleLoadModule(t *testing.T) { loader := CreateLoaderFromSource(`{ module.exports = "bar"; }`, "") testLoad := func() { vm := New() vm.AddModule("foo", loader) v, err := vm.Require("foo", ".") if err != nil { t.Fatal(err) } s, _ := v.ToString() if s != "bar" { t.Errorf("expect bar, got %s", s) } } testLoad() testLoad() }
Output of test
--- FAIL: TestDoubleLoadModule (0.00s) motto_test.go:85: expect bar, got [object Object] FAIL
The reason is that multiple calls to ModuleLoader cause the source to be repeatedly assigned.
motto/module.go
Line 29 in c7fa5e7
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Code as follows
Output of test
The reason is that multiple calls to ModuleLoader cause the source to be repeatedly assigned.
motto/module.go
Line 29 in c7fa5e7
The text was updated successfully, but these errors were encountered: