From 1123eccbe4d958215ea5e1a38770e2dea54865ec Mon Sep 17 00:00:00 2001 From: Phillip Barbiero Date: Fri, 19 May 2017 21:25:15 -0500 Subject: [PATCH] Update createObjectExpression.js From #89 `Identifiers can't have quotes. If the key is supposed to be a string, it should be t.stringLiteral(name). Because it is an identifier it is an invalid AST.` --- src/createObjectExpression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/createObjectExpression.js b/src/createObjectExpression.js index c8cdd08..d5e8c07 100644 --- a/src/createObjectExpression.js +++ b/src/createObjectExpression.js @@ -32,7 +32,7 @@ const createObjectExpression = (t: BabelTypes, object: InputObjectType): ObjectE properties.push( t.objectProperty( - t.identifier('\'' + name + '\''), + t.stringLiteral(name), newValue ) );