Skip to content

Commit bc38ffd

Browse files
authoredOct 7, 2024··
Fix object assignment of hasOwnProperty (#177)
1 parent cf4658f commit bc38ffd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exports.serialize = serialize;
2121
*/
2222

2323
var __toString = Object.prototype.toString
24+
var __hasOwnProperty = Object.prototype.hasOwnProperty
2425

2526
/**
2627
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
@@ -130,7 +131,7 @@ function parse(str, opt) {
130131
var key = str.slice(keyStartIdx, keyEndIdx);
131132

132133
// only assign once
133-
if (!obj.hasOwnProperty(key)) {
134+
if (!__hasOwnProperty.call(obj, key)) {
134135
var valStartIdx = startIndex(str, eqIdx + 1, endIdx);
135136
var valEndIdx = endIndex(str, endIdx, valStartIdx);
136137

0 commit comments

Comments
 (0)
Please sign in to comment.