json-pointer
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -78,2 +78,5 @@ 'use strict'; | ||
var tok = refTokens[i]; | ||
if (typeof tok !== 'string' && typeof tok !== 'number') { | ||
tok = String(tok) | ||
} | ||
if (tok === "__proto__" || tok === "constructor" || tok === "prototype") { | ||
@@ -80,0 +83,0 @@ continue |
{ | ||
"name": "json-pointer", | ||
"description": "Some utilities for JSON pointers described by RFC 6901", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"author": "Manuel Stofer <manuel@smallpdf.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -449,2 +449,11 @@ /*global describe, it, beforeEach*/ | ||
it('should not set __proto__ (array)', function () { | ||
var obj = {}, objPointer = pointer(obj); | ||
expect(obj.polluted).to.be.undefined(); | ||
objPointer.set([['__proto__'], 'polluted'], true); | ||
expect(obj.polluted).to.be.undefined(); | ||
var obj2 = {}; | ||
expect(obj2.polluted).to.be.undefined(); | ||
}); | ||
it('should not set prototype', function () { | ||
@@ -451,0 +460,0 @@ var obj = {}, objPointer = pointer(obj); |
100059
18
1024