Repository navigation
fix(worker): let a heap-limit terminate re-enter the inspector lock from console.log #2070
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
Merged
edusperoni
merged 4 commits into
NativeScript:main
from
adrian-niculescu:fix/worker-console-log-inspector-lock
Nov 11, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ff1f624
fix(worker): let a heap-limit terminate re-enter the inspector lock f…
adrian-niculescu d37bb13
Merge branch 'main' into fix/worker-console-log-inspector-lock
edusperoni b7cf740
docs(worker): say which threads take the worker inspector lock and wh…
edusperoni e9c093b
test(worker): a console call nested in argument formatting does not d…
edusperoni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
test-app/app/src/main/assets/app/tests/testWorkerNestedConsole.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| describe("Worker nested console call", function () { | ||
| it("should keep running when formatting a logged argument logs again", function (done) { | ||
| var worker = new Worker("./workerNestedConsoleWorker.js"); | ||
| // A worker stuck in ConsoleLog holds the inspector lock that | ||
| // terminate() takes, so only the success path may terminate it. | ||
| worker.onmessage = function (e) { | ||
| expect(e.data).toBe("alive"); | ||
| worker.terminate(); | ||
| done(); | ||
| }; | ||
| worker.onerror = function (e) { | ||
| done.fail(e.message); | ||
| }; | ||
| }); | ||
| }); | ||
11 changes: 11 additions & 0 deletions
11
test-app/app/src/main/assets/app/tests/workerNestedConsoleWorker.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // The inspector reads Symbol.toStringTag while it formats a console argument, | ||
| // so this getter runs inside the outer console.log. | ||
| var arg = {}; | ||
| Object.defineProperty(arg, Symbol.toStringTag, { | ||
| get: function () { | ||
| console.log("nested"); | ||
| return "Nested"; | ||
| } | ||
| }); | ||
| console.log(arg); | ||
| postMessage("alive"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace the unsupported
done.failcall.If the worker emits an error, this handler throws
TypeErrorinstead of recording the worker failure and completing the spec.Proposed fix
Based on learnings, this test app pins Jasmine 2.0.1, whose
donecallback has nofailproperty.Committable suggestion
Source: Learnings