Skip to content

Instantly share code, notes, and snippets.

@gregglind
Created September 10, 2012 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregglind/3694575 to your computer and use it in GitHub Desktop.
Save gregglind/3694575 to your computer and use it in GitHub Desktop.
js> print(JSON.stringify(Reflect.parse('var a = {}; a["some thing"] = 1'),null,2))
{
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 31
},
"source": null
},
"type": "Program",
"body": [
{
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 10
},
"source": null
},
"type": "VariableDeclaration",
"kind": "var",
"declarations": [
{
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 10
},
"source": null
},
"type": "VariableDeclarator",
"id": {
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 10
},
"source": null
},
"type": "Identifier",
"name": "a"
},
"init": {
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 10
},
"source": null
},
"type": "ObjectExpression",
"properties": []
}
}
]
},
{
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 31
},
"source": null
},
"type": "ExpressionStatement",
"expression": {
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 31
},
"source": null
},
"type": "AssignmentExpression",
"operator": "=",
"left": {
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 27
},
"source": null
},
"type": "MemberExpression",
"object": {
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 13
},
"source": null
},
"type": "Identifier",
"name": "a"
},
"property": {
"loc": null,
"type": "Identifier",
"name": "some thing"
},
"computed": false
},
"right": {
"loc": {
"start": {
"line": 1,
"column": 30
},
"end": {
"line": 1,
"column": 31
},
"source": null
},
"type": "Literal",
"value": 1
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment