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

fix module.exports usage inside the module that is exporting it #1050

Closed
mstoykov opened this issue Jun 13, 2019 · 1 comment
Closed

fix module.exports usage inside the module that is exporting it #1050

mstoykov opened this issue Jun 13, 2019 · 1 comment

Comments

@mstoykov
Copy link
Contributor

During some library test/rewrite I found out that apparently

exports.a = "5";
exports.b = function() {
    return b.a;
}

Doesn't work in k6. instead of b() returning "5" it will return undefined. This has been like that at least since v0.22.1 and as far as I can see it is because of the way we load modules. This both works in node.js and goja's sample nodejs require implementaion.

Somewhat related to #1048.

@mstoykov mstoykov added this to the v1.0.0 milestone Jun 13, 2019
@mstoykov
Copy link
Contributor Author

fixed in #1099 merged with commit bd6d2d9

@na-- na-- removed this from the v1.0.0 milestone Jul 13, 2020
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