-Added support for root object in JSONPath filters

This commit is contained in:
James Newton-King
2016-09-10 16:54:29 +12:00
parent 59618df631
commit ac2d619474
21 changed files with 128 additions and 44 deletions
+2 -2
View File
@@ -2305,7 +2305,7 @@ namespace Newtonsoft.Json.Linq
JPath p = new JPath(path);
JToken token = null;
foreach (JToken t in p.Evaluate(this, errorWhenNoMatch))
foreach (JToken t in p.Evaluate(this, this, errorWhenNoMatch))
{
if (token != null)
{
@@ -2341,7 +2341,7 @@ namespace Newtonsoft.Json.Linq
public IEnumerable<JToken> SelectTokens(string path, bool errorWhenNoMatch)
{
JPath p = new JPath(path);
return p.Evaluate(this, errorWhenNoMatch);
return p.Evaluate(this, this, errorWhenNoMatch);
}
#if !(NET35 || NET20 || PORTABLE40)