-
Notifications
You must be signed in to change notification settings - Fork 91
Description
here is a content:
function _fAddItem(_aoContainer, _aoItem, _anIndex)
{
({}).toString.call([]) != "[object Array]" && (_aoItem = [_aoItem]);
return _aoContainer.slice(0, _anIndex).concat(_aoItem).concat(_aoContainer.slice(_anIndex, _aoContainer.length));
};
and this is my code
from slimit.parser import Parser
parser = Parser()
tree = parser.parse(content)
print tree.to_ecma()
and then i got this
function _fAddItem(_aoContainer, _aoItem, _anIndex) {
{
}.toString.call([]) != "[object Array]" && (_aoItem = [_aoItem]);
return _aoContainer.slice(0, _anIndex).concat(_aoItem).concat(_aoContainer.slice(_anIndex, _aoContainer.length));
}
;
I found that the "()" in the "({}}"" in line 3 of the content is gone and casued Syntax error in js
i wonder which part of code what reason caused this.
I have not learned lexer, parser or something,i want to know whether i have the ability to learn and fix it by myself or not ,and if it will takes me too much time.
I will be appreciate if someone can help