Skip to content

Commit

Permalink
Fix object assignment of hasOwnProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Oct 7, 2024
1 parent cf4658f commit d8a42a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports.serialize = serialize;
*/

var __toString = Object.prototype.toString
var __hasOwnProperty = Object.prototype.hasOwnProperty

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

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

Expand Down

0 comments on commit d8a42a6

Please sign in to comment.