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

BAAS-19768: update goja to latest March 2023 (part 2) #79

Merged
merged 16 commits into from
Mar 15, 2023
Merged

BAAS-19768: update goja to latest March 2023 (part 2) #79

merged 16 commits into from
Mar 15, 2023

Conversation

Gabri3l
Copy link

@Gabri3l Gabri3l commented Mar 9, 2023

Having this running in evergreen. The failing tests are unrelated to this update and were already happening in master.

Didn't really have to make changes other than commenting out Promise tests.

dop251 and others added 15 commits March 8, 2023 08:28
…ixes dop251#375

(cherry picked from commit a18ffb9)
(cherry picked from commit 4d4c8e7)
(cherry picked from commit 8a7c4f4)
(cherry picked from commit 1fd06ac)
…ocked staticcheck version.

(cherry picked from commit 451b4e4)
(cherry picked from commit c247603)
…standard array configurations. Upgraded tc39 tests.

(cherry picked from commit 90825c0)
(cherry picked from commit ff0250e)
… than pointers to them. Closes dop251#378.

(cherry picked from commit 9037c2b)
(cherry picked from commit 3a579a4)
(cherry picked from commit ffe77e2)
(cherry picked from commit d54e459)
(cherry picked from commit ff76422)
(cherry picked from commit 8ae227d)
(cherry picked from commit 3faab1d)
(cherry picked from commit 49b5f5f)
(cherry picked from commit 160b8c5)
(cherry picked from commit fa83eb8)
Co-authored-by: satyrnwastaken <satyrn@disroot.org>
(cherry picked from commit e1f9dc0)
(cherry picked from commit 896a65e)
(cherry picked from commit e1eca0b)
(cherry picked from commit eca6b4f)
(cherry picked from commit 4418d45)
(cherry picked from commit 272ec8e)
(cherry picked from commit 189bfeb)
(cherry picked from commit 4311cf2)
* Don't clear interrupt until the stack is empty

Previous to this the interrupt would be cleared whenever it is noticed
before it starts returning the error up the stack.

Unfortunately if you have goja code that called go code that called a
goja code and it got interrupted. Once we get back in the go code we
just got an error, and it's very likely that the code will just return
it
so it's just an exception.

So at that point if there is `try/catch` it will just catch this and the
code will not actually be interrupted.

It is possible to at each such occurrence test that the error is not
InterruptError and Interrupt again, but that seems like the worse of two
choices.

So instead now the Interrupt will *not* be cleared and if the go code
just propagates the error - it will just keep interrupting.

But it is still possible to check the error in the go code and decide to
clear the interrupt manually.

The interrupt will be cleared only once the stack is empty,
so there is no way for the above problem.

It will also clear the job queue. Otherwise, if there is any promise
that has been resolved/rejected, and they aren't cleared they will be
executed the next time the Runtime is used, and the stack is empty.

* Update runtime.go

Co-authored-by: Dmitry Panov <dop251@users.noreply.github.com>

Co-authored-by: Dmitry Panov <dop251@users.noreply.github.com>
(cherry picked from commit 8795259)
(cherry picked from commit 21a34e5)
@Gabri3l Gabri3l requested review from kpatel71716 and LijieZhang1998 and removed request for kpatel71716 March 14, 2023 15:27
Copy link

@kpatel71716 kpatel71716 left a comment

Choose a reason for hiding this comment

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

LGTM! Given the size, I compared this fork to the goja master branch and focused on differences between vm.go and runtime.go as a sanity check. The other changes seem to be mostly additions or things we pulled in so those look good!

@Gabri3l Gabri3l merged commit 574e540 into mongodb-forks:realm Mar 15, 2023
@Gabri3l Gabri3l deleted the baas-19768-part-2 branch March 15, 2023 15:40
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.

5 participants