Created
April 7, 2015 21:16
-
-
Save aslushnikov/9ca6fb227e2f142e866d to your computer and use it in GitHub Desktop.
V8 AST example 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = 10, b = 20, c = a + b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "FunctionLiteral", | |
"position": 0, | |
"declarations": [ | |
{ | |
"type": "VariableDeclaration", | |
"position": 0, | |
"proxy": { | |
"type": "VariableProxy", | |
"position": 4 | |
} | |
}, | |
{ | |
"type": "VariableDeclaration", | |
"position": 0, | |
"proxy": { | |
"type": "VariableProxy", | |
"position": 12 | |
} | |
}, | |
{ | |
"type": "VariableDeclaration", | |
"position": 0, | |
"proxy": { | |
"type": "VariableProxy", | |
"position": 20 | |
} | |
} | |
], | |
"body": [ | |
{ | |
"type": "Block", | |
"position": 0, | |
"statements": [ | |
{ | |
"type": "ExpressionStatement", | |
"position": -1, | |
"expression": { | |
"type": "CallRuntime", | |
"position": 6, | |
"arguments": [ | |
{ | |
"type": "Literal", | |
"position": 6 | |
}, | |
{ | |
"type": "Literal", | |
"position": 6 | |
}, | |
{ | |
"type": "Literal", | |
"position": 8 | |
} | |
] | |
} | |
}, | |
{ | |
"type": "ExpressionStatement", | |
"position": -1, | |
"expression": { | |
"type": "CallRuntime", | |
"position": 14, | |
"arguments": [ | |
{ | |
"type": "Literal", | |
"position": 14 | |
}, | |
{ | |
"type": "Literal", | |
"position": 14 | |
}, | |
{ | |
"type": "Literal", | |
"position": 16 | |
} | |
] | |
} | |
}, | |
{ | |
"type": "ExpressionStatement", | |
"position": -1, | |
"expression": { | |
"type": "CallRuntime", | |
"position": 22, | |
"arguments": [ | |
{ | |
"type": "Literal", | |
"position": 22 | |
}, | |
{ | |
"type": "Literal", | |
"position": 22 | |
}, | |
{ | |
"type": "BinaryOperation", | |
"position": 26, | |
"left": { | |
"type": "VariableProxy", | |
"position": 24 | |
}, | |
"right": { | |
"type": "VariableProxy", | |
"position": 28 | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment