From 65ca034102fdc6afd7a7708acde1e226e42939ae Mon Sep 17 00:00:00 2001 From: Jack Ketcham Date: Wed, 9 Oct 2019 15:32:12 -0700 Subject: [PATCH] Remove Function constuctor usage --- graphql.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/graphql.js b/graphql.js index 32550bc..536930d 100644 --- a/graphql.js +++ b/graphql.js @@ -189,8 +189,7 @@ * {a: {b: {c: 1, d: 2}}}, "a.b.c" => 1 */ GraphQLClient.prototype.fragmentPath = function (fragments, path) { - var getter = new Function("fragments", "return fragments." + path.replace(/\./g, FRAGMENT_SEPERATOR)) - var obj = getter(fragments) + var obj = fragments[path.replace(/\./g, FRAGMENT_SEPERATOR)] if (path != "on" && (!obj || typeof obj != "string")) { throw new Error("Fragment " + path + " not found") }