-
Notifications
You must be signed in to change notification settings - Fork 22
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
Odd behaviour #72
Comments
Another weird thing is that if I run Global:get_value("xyz") at the very end of the program, it is actually changed to "def222" |
Here's more debug output: http://pastebin.com/Z6tugSSJ It include traced gets and sets with pointer of the global object. And it changes a lot, not sure if it is helpful. |
I've solved this problem with this commit in beamjs: But source of the problem still persists in erlv8. |
But this "fix" screws up exports object, which is shared because of my changes. I need to figure out problems with context switching not working properly. |
JFYI, I received the message, I'm just a bit overloaded at the moment :-) |
But anyway, I am monitoring this. |
I'll prepare a test case for this problem so you can at least reproduce it |
I wasn't able to prepare the test case for this problem and I've worked around the problem by replacing explicit use of V8 Contexts with wrapping required file into anonymous JS function, running it and returning module's exports. Code says it all: https://github.com/gleber/beamjs/blob/master/src/beamjs_mod_require.erl#L126 |
I am trying to bring back beamjs to life and I've fixed many issues already. But now I have stumbled at a problem with "require.main" not being set. After fiddling with this problem I have found it to behave very weird:
I am setting test global variable "xyz" to "def" initially (right after VM is started), but later on, just before (Global:get_value("require")):call(...), I am setting it to "def222". But inside of "fun require_fun/2" I do Global:get_value("xyz") again and it returns "def".
Any ideas what it could be?
The text was updated successfully, but these errors were encountered: