Repository navigation
Conversation
The app was released about a second after a frontend connected, whatever it had enabled by then, and the pause relied on a require call, which an ES module app doesn't make, while schedulePauseOnNextStatement didn't stop on the main module. The app now waits for Runtime.runIfWaitingForDebugger, or 3 seconds for frontends that don't send it, then stops on a debugger statement before any app code runs.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the current behavior?
With
--nativescript-debug-brk, the app waits for a frontend, but it doesn't stop for it:__pauseOnNextRequire, which only fires on arequirecall. An app whose main bundle is an ES module doesn't make one, so a demo app never paused, and neither did theschedulePauseOnNextStatementcall made alongside it.What is the new behavior?
Runtime.runIfWaitingForDebugger, which arrives after itsDebugger.enable. Frontends that don't send it get 3 seconds.debugger;script before any app code runs, so breakpoints can still be set. Execution stops on that script rather than on the app's first line.The old check in
require-factory.jsis left in place but nothing sets the flag any more. Removing it means regeneratingRuntimeBuiltins.cpp.Testing
runIfWaitingForDebuggerA real app (blackout) was also debugged on the iPad this way.
Possibly separate: after the startup pause,
debugger;run throughRuntime.evaluatepaused, but the test client never saw aDebugger.resumed, and a laterDebugger.pausedid nothing. It didn't affect--debug-brk, and it isn't clear yet whether it's a runtime bug or the test.Part of a stack
Base: #532. Needed for
--debug-brkalong with NativeScript/ios-device-lib#89 and NativeScript/nativescript-cli#6183.