Skip to content

Instantly share code, notes, and snippets.

@designeng
Last active March 3, 2016 21:42
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 designeng/a1778136f71870a57252 to your computer and use it in GitHub Desktop.
Save designeng/a1778136f71870a57252 to your computer and use it in GitHub Desktop.
"type": "Program",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "f"
},
"params": [
{
"type": "Identifier",
"name": "a"
},
{
"type": "Identifier",
"name": "b"
}
],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "specField"
},
"computed": false,
"value": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "one"
},
"computed": false,
"value": {
"type": "Literal",
"value": 1,
"raw": "1"
},
"kind": "init",
"method": false,
"shorthand": false
}
]
},
"kind": "init",
"method": false,
"shorthand": false
}
]
}
}
]
},
"generator": false,
"expression": false
}
],
"sourceType": "script"
@designeng
Copy link
Author

function f(a, b){
    return {
        specField: {
            one: 1
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment