sri96 / nila

Nila is a small Ruby inspired language to fix Javascript
https://github.com/sri96/nila
1 stars 0 forks source link

Variable Property Being Listed in Variable Declaration Statement #21

Closed adhithyan15 closed 10 years ago

adhithyan15 commented 10 years ago

Here is the piece of code that I was trying to compile

def createFromHTML(html) 
  el = document.createElement('div')
  el.innerHTML = html
  el.children[0]
end

It produces the following output. Look closely at the variable declaration line

createFromHTML = function(html) {
    var el, el.innerHTML;
    el = document.createElement('div');
    el.innerHTML = html;
    return el.children[0];
};

el.innerHTML is a property of el. So it should not be listed as a separate variable. Please fix this issue.

adhithyan15 commented 10 years ago

The issue has been fixed. The reported code is now part of the test suite and will be used for testing all the new versions.