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

minor fixes in rehack/runtime/js #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

zindel
Copy link

@zindel zindel commented Feb 7, 2019

  • Add List_.js
  • Fix require statements


let joo_global_object = global;
Copy link
Owner

Choose a reason for hiding this comment

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

This file is generated by doing esy test in the root. There's a file at rehack_tests/templates/common-js-runtime-header.js which determines the output of esy test which needs to be changed to regenerate this.

@@ -1 +1 @@
module.exports = require('String.js');
module.exports = require('./String.js');
Copy link
Owner

@jordwalke jordwalke Feb 8, 2019

Choose a reason for hiding this comment

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

How do you know the String.js will be here?

The buildTest.sh file has some examples of how to actually run the examples when compiled separately. For example:

NODE_PATH="${PWD}/rehack_tests/strings/:${PWD}/rehack_tests/stdlib/stdlib.js:${PWD}/runtime/rehack/js/" node -e 'require("Strings")'

Which puts the stdlib and other libraries in the node search path so that require('String.js') would be resolved correctly. But I'm not so sure require('./String.js') will work as accurately because it demands that String_.js be in the same dir as String.js. That would be fine if we had a system that copied these into the stdlib or something. We definitely need better tools for that.

Feel free to come up with a good proposal/implementation. I really don't know what is best.

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.

2 participants