Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
used StringPrototypeIndexOf in place of StringPrototypeSplit primordials
  • Loading branch information
pulkit-30 committed Jan 31, 2023
commit 7719a4b7b373b07766044027242239cb796037b9
11 changes: 7 additions & 4 deletions lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const {
SafePromiseAllSettledReturnVoid,
SafeMap,
SafeSet,
StringPrototypeSplit,
StringPrototypeIndexOf,
StringPrototypeSlice,
StringPrototypeStartsWith,
} = primordials;

Expand Down Expand Up @@ -132,9 +133,11 @@ function getRunArgs({ path, inspectPort }) {

class FileTest extends Test {
#buffer = [];
#checkNestedComment(node) {
const commentArgs = StringPrototypeSplit(node.comment, ' ');
return commentArgs.length === 2 && ArrayPrototypeIncludes(kDiagnosticsFilterArgs, commentArgs[0]);
#checkNestedComment({ comment }) {
const firstSpaceIndex = StringPrototypeIndexOf(comment, ' ');
Comment thread
aduh95 marked this conversation as resolved.
const secondSpaceIndex = StringPrototypeIndexOf(comment, ' ', firstSpaceIndex + 1);
return secondSpaceIndex === -1 &&
ArrayPrototypeIncludes(kDiagnosticsFilterArgs, StringPrototypeSlice(comment, 0, firstSpaceIndex));
}
#handleReportItem({ kind, node, nesting = 0 }) {
nesting += 1;
Expand Down