Implement the core of let/const statement. (#3239)
This patch implements the core part of let/const statements. Redeclarations are correctly detected and separate contexts are correctly created for these statements. Register optimizations are also emplyed whenever possible. Lots of features are still missing: - checking the var statements in eval - const are treated as lets - single statement checks are missing - export declarations are exported as vars, let/const export is not supported JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Dániel Bátyai
parent
4b352758c1
commit
3d797b8836
@@ -74,6 +74,9 @@ typedef enum
|
||||
LEXER_FLAG_SOURCE_PTR = (1 << 2), /**< the literal is directly referenced in the source code
|
||||
* (no need to allocate memory) */
|
||||
LEXER_FLAG_LATE_INIT = (1 << 3), /**< initialize this variable after the byte code is freed */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
LEXER_FLAG_GLOBAL = (1 << 4), /**< this local identifier is not a let or const declaration */
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
} lexer_literal_status_flags_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user