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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/rehack/js/Array_.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('Array.js');
module.exports = require('./Array.js');
1 change: 1 addition & 0 deletions runtime/rehack/js/List_.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./List.js');
2 changes: 1 addition & 1 deletion runtime/rehack/js/String_.js
Original file line number Diff line number Diff line change
@@ -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.

5 changes: 2 additions & 3 deletions runtime/rehack/js/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
* Runtime
* @providesModule Runtime
*/
"use strict";

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.

joo_global_object = global;


var caml_oo_last_id = 0;
Expand Down Expand Up @@ -5644,4 +5643,4 @@ caml_register_global(
);


module.exports = global.jsoo_runtime;
module.exports = global.jsoo_runtime;