Skip to content

Commit edd9079

Browse files
authored
Merge pull request #67 from janl/fix/set
Fix: disallow overwriting of global method instances referenced in prototypes
2 parents 6c3dc0a + cf9fca6 commit edd9079

4 files changed

Lines changed: 5992 additions & 3761 deletions

File tree

‎.github/workflows/node.js.yml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [8.x, 10.x, 12.x, 14.x, 16.x]
19+
node-version: [22.x, 24.x, 26.x]
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v7
2323
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v2
24+
uses: actions/setup-node@v7
2525
with:
2626
node-version: ${{ matrix.node-version }}
27-
cache: 'npm'
2827
- run: npm ci
2928
- run: npm run build --if-present
3029
- run: npm test

‎jsonpointer.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function setter (obj, pointer, value) {
2323
part = untilde(pointer[p++])
2424
hasNextPart = len > p
2525

26-
if (typeof obj[part] === 'undefined') {
26+
if (typeof obj[part] === 'undefined' || !Object.prototype.hasOwnProperty.call(obj, part)) {
2727
// support setting of /-
2828
if (Array.isArray(obj) && part === '-') {
2929
part = obj.length

0 commit comments

Comments
 (0)