Skip to content

Commit 31f6fac

Browse files
jketchamurkle
authored andcommitted
Remove Function constuctor usage
1 parent fa2570e commit 31f6fac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graphql.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@
199199
* {a: {b: {c: 1, d: 2}}}, "a.b.c" => 1
200200
*/
201201
GraphQLClient.prototype.fragmentPath = function (fragments, path) {
202-
var getter = new Function("fragments", "return fragments." + path.replace(/\./g, FRAGMENT_SEPERATOR))
203-
var obj = getter(fragments)
202+
var obj = fragments[path.replace(/\./g, FRAGMENT_SEPERATOR)]
204203
if (path != "on" && (!obj || typeof obj != "string")) {
205204
throw new Error("Fragment " + path + " not found")
206205
}

0 commit comments

Comments
 (0)