Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 44b1927

Browse filesBrowse files
kimtaejin3aduh95
authored andcommitted
lib: use StringPrototypeStartsWith from primordials in locks
Use StringPrototypeStartsWith from primordials instead of String.prototype.startsWith to prevent prototype pollution. Refs: #59699 PR-URL: #61492 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
1 parent 3d68811 commit 44b1927
Copy full SHA for 44b1927

1 file changed

+1-1Lines changed: 1 addition & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/locks.js‎

Copy file name to clipboardExpand all lines: lib/internal/locks.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class LockManager {
159159
signal.throwIfAborted();
160160
}
161161

162-
if (name.startsWith('-')) {
162+
if (name[0] === '-') {
163163
// If name starts with U+002D HYPHEN-MINUS (-), then reject promise with a
164164
// "NotSupportedError" DOMException.
165165
throw lazyDOMException('Lock name may not start with hyphen',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.