yodaos-project / ShadowNode

Use Node.js in your end devices(QQ: 796448809)
https://yodaos-project.github.io/ShadowNode/
Other
588 stars 46 forks source link

jerry: support const/let #3

Open yorkie opened 6 years ago

yorkie commented 6 years ago

The keyword const and let are such important features in JavaScript community, let's do support them!

algebrait commented 6 years ago

work perhaps should do:

  1. find all enter and exit of block scope
  2. organize symbol table. Jerry has no AST, keep one literal pool for per function, and patch literal index in parser_post_processing(). The difficulty is how to keep low memory footprint and do not rewrite too much code. JS var hoisting makes things worse. We should record all vars in a scope, and can not drop them, which makes scope index base not known before function parse complete.
yeliex commented 5 years ago

any progress?