Skip to content

doc,test: add information on unwatch(index) command - #42882

Closed
cola119 wants to merge 3 commits into
nodejs:mainfrom
cola119:fix-unwatch-option-doc
Closed

doc,test: add information on unwatch(index) command#42882
cola119 wants to merge 3 commits into
nodejs:mainfrom
cola119:fix-unwatch-option-doc

Conversation

@cola119

Copy link
Copy Markdown
Member

unwatch command of node inspect supports to remove specific index element.

unwatch(expr){
constindex=ArrayPrototypeIndexOf(watchedExpressions,expr);
// Unwatch by expression
// or
// Unwatch by watcher number
ArrayPrototypeSplice(watchedExpressions,
index!==-1 ? index : +expr,1);
},

@nodejs-github-botnodejs-github-bot added debugger Issues and PRs related to the debugger subsystem. doc Issues and PRs related to the documentations. labels Apr 27, 2022
@cola119cola119 changed the title doc: add information on unwatch(index) optiondoc,test: add information on unwatch(index) commandApr 28, 2022
@cola119

cola119 commented May 9, 2022

Copy link
Copy Markdown
MemberAuthor

@Trott

About #43018 (review), I hope we can discuss here.
unwatch(index), not an expression, is implemented internally but undocumented anywhere. Should I add the doc to node help along with the debugger doc or leave it undocumented in terms of internal use only?

@Trott

Trott commented May 9, 2022

Copy link
Copy Markdown
Member

If it is clear how to obtain the index and how index differs from expr, and if this would be useful to end users, then we should document it. Thanks.

@cola119

cola119 commented May 9, 2022

Copy link
Copy Markdown
MemberAuthor

Removing watcher by index would be useful for end users because watchers command prints all watched expressions with their indices.

@cola119

Copy link
Copy Markdown
MemberAuthor

However, the current watch(expr) accepts numeric as well as string expression, which makes the difference index and expr ambiguous.
So I think string validation for watch(expr) is required (#42913).

@cola119
cola119force-pushed the fix-unwatch-option-doc branch from 9d24260 to 9bcd75cCompareJune 19, 2022 12:51
@cola119

Copy link
Copy Markdown
MemberAuthor

@lpinca@Mesteery@Trott Could you check again and land if there is nothing wrong with.

@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2022
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debuggerIssues and PRs related to the debugger subsystem.docIssues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@cola119@Trott@nodejs-github-bot@jasnell@lpinca@Mesteery