IterationStatement fix

This commit is contained in:
Dan Onoshko 2014-09-03 23:17:03 +07:00
parent 2f3f25340c
commit 89671acb9a
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
![logo](https://raw.githubusercontent.com/TrigenSoftware/ColaScript/master/colalogo.png) ![logo](https://raw.githubusercontent.com/TrigenSoftware/ColaScript/master/colalogo.png)
ColaScript is a language that compiles in JavaScript. This language is similar to Dart, CoffeeScript, Python and PHP, with some original ideas. Compiler based on [UglifyJS2](https://github.com/mishoo/UglifyJS2). You can play with language [here](http://develop.trigen.pro/cola/). ColaScript is a language that compiles in JavaScript. This language is similar to Dart, CoffeeScript, Python and PHP, with some original ideas. Compiler based on [UglifyJS2](https://github.com/mishoo/UglifyJS2). You can play with language [here (stable)](http://cola.trigen.pro) or [here (dev)](http://cola.trigen.pro/dev/).
Installation Installation
@ -380,7 +380,7 @@ Future plans
Object data = someData; Object data = someData;
int data.getFriendsCount() => this.friends.length; int data.getFriendsCount() => this.friends.length;
- dotal getters and setters definition - dotal getters and setters definition. status: done
covert int get Math.rand() => 123; covert int get Math.rand() => 123;
covert int set Math.rand(int val) => console.log(val); covert int set Math.rand(int val) => console.log(val);

View File

@ -1111,7 +1111,7 @@ Cola.AST_Toplevel.prototype.toJavaScript = function(options){
Object.defineProperty(obj, "num", { value: 0, enumerable: true }); Object.defineProperty(obj, "num", { value: 0, enumerable: true });
*/ */
if(node instanceof Cola.AST_Var){ if(node instanceof Cola.AST_Var && !(parent instanceof Cola.AST_IterationStatement)){
var defCache = []; newNode = []; var defCache = []; newNode = [];
node.definitions.forEach(function(def, i){ node.definitions.forEach(function(def, i){
if(def.name instanceof Cola.AST_SymbolVar){ if(def.name instanceof Cola.AST_SymbolVar){