From 12e0d09e69b47635c943d453874f1df3e79dfb05 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Sat, 28 Jul 2018 15:29:37 -0400 Subject: [PATCH] fix(document): don't double-call deeply nested custom getters when using `get()` Fix #6779 Re: #6637 --- lib/document.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/document.js b/lib/document.js index b11febf2699..f3f6c1dc0ba 100644 --- a/lib/document.js +++ b/lib/document.js @@ -1115,6 +1115,8 @@ Document.prototype.get = function(path, type, options) { obj = void 0; } else if (obj instanceof Map) { obj = obj.get(pieces[i]); + } else if (i === l - 1) { + obj = utils.getValue(pieces[i], obj); } else { obj = obj[pieces[i]]; }