| Index: scripts/abprewrite.js |
| =================================================================== |
| --- a/scripts/abprewrite.js |
| +++ b/scripts/abprewrite.js |
| @@ -207,22 +207,24 @@ function modifyExpressionStatement(ast) |
| block.body.push(Assignment(vars[i], Member(tempVar, i, true))); |
| return block; |
| } |
| return ast; |
| } |
| function modifyVariableDeclaration(ast) |
| { |
| - // Convert let variables: |
| + // Convert let and const variables: |
| // let foo = bar; |
| + // const bas = 4; |
| // |
| // Change into: |
| // var foo = bar; |
| - if (ast.kind == "let") |
| + // var bas = 4; |
| + if (ast.kind == "let" || ast.kind == "const") |
| ast.kind = "var"; |
| if (ast.declarations.length == 1 && ast.declarations[0].type == "VariableDeclarator") |
| { |
| let declarator = ast.declarations[0]; |
| // Remove timeline requires: |
| // let {Timeline} = require("timeline"); |