Skip to content

Commit 50e788d

Browse files
committed
fixup! src: fix crash in GetErrorSource() for invalid using syntax
1 parent 89b1cf8 commit 50e788d

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/node_errors.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ static std::string GetErrorSource(Isolate* isolate,
160160
CHECK_GT(buf.size(), 0);
161161
*added_exception_line = true;
162162

163-
if (start > end ||
164-
start < 0 ||
165-
end < 0 ||
163+
if (start > end || start < 0 || end < 0 ||
166164
static_cast<size_t>(end) > sourceline.size()) {
167165
return buf;
168166
}

test/parallel/test-cli-eval-invalid-using.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)