mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 00:47:28 +01:00
Restrict var statements to the top of functions
This commit is contained in:
1 parent
84f9d3a915
commit
cbe19f50e0
5 files changed
+36
-56
No files matched your search
+1
-3
@@ -540,9 +540,7 @@ func (c *Checker) checkFuncBody(node *a.Node) error {
|
||||
localVars: c.localVars[n.QQID()],
|
||||
}
|
||||
|
||||
// Fill in the TypeMap with all local variables. Note that they have
|
||||
// function scope and can be hoisted, JavaScript style, a la
|
||||
// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/var
|
||||
// Fill in the TypeMap with all local variables.
|
||||
if err := q.tcheckVars(n.Body()); err != nil {
|
||||
return &Error{
|
||||
Err: err,
|
||||
|
||||
Reference in new issue
Block a user