- [FunctionDeclaration 명세](https://github.com/estree/estree/blob/master/spec.md#functiondeclaration)
```javascript
interface FunctionDeclaration <: Function, Declaration {
// 노드 타입
type: "FunctionDeclaration";
// 해당 함수 선언식에 대한 식별자 정보
id: Identifier;
}
```
- <span style="color:#6298c1">parseFunctionDeclaration</span> 함수 내부
```javascript
function parseFunctionDeclaration() {
var id, body, token, tmp, firstRestricted, message, generator, isAsync,
previousStrict, previousYieldAllowed, previousAwaitAllowed,
marker = markerCreate(), typeParameters;
isAsync = false;
if (matchAsync()) {
lex();
isAsync = true;
}
expectKeyword('function');
generator = false;
if (match('*')) {
lex();
generator = true;
}
token = lookahead;
id = parseVariableIdentifier();
...
tmp = parseParams(firstRestricted);
firstRestricted = tmp.firstRestricted;
if (tmp.message) {
message = tmp.message;
}
...
body = parseFunctionSourceElements();
...
// 함수 선언식에 대한 Parse 트리 노드를 생성한다.
return markerApply(
marker,
delegate.createFunctionDeclaration(
id,
tmp.params,
tmp.defaults,
body,
tmp.rest,
generator,
false,
isAsync,
tmp.returnType,
typeParameters
)
);
}
```
![](/blog/assets/images/posts/20151228/jsx_5.png)