-
Notifications
You must be signed in to change notification settings - Fork 684
Instantiation of Arguments object #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ruben-ayrapetyan there are some tests related to Arguments in |
*/ | ||
typedef enum : idx_t | ||
{ | ||
OPCODE_SCOPE_CODE_FLAGS__NO_FLAGS = (0u), /**< initializer for empty flag set */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why double _
?
Maybe OPCODE_SCOPE_CODE_FLAGS_EMPTY
would be the better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double _
, because the value doesn't actually represent any functional flag.
So, it is a special value. To separate it from other values, I've added second _
.
The syntax is also used in other places, like __COUNT
in the following:
/**
* Identifiers of ECMA and implementation-defined magic string constants
*/
typedef enum
{
#define ECMA_MAGIC_STRING_DEF(id, ascii_zt_string) \
id,
#include "ecma-magic-strings.inc.h"
#undef ECMA_MAGIC_STRING_DEF
ECMA_MAGIC_STRING__COUNT /**< number of magic strings */
} ecma_magic_string_id_t;
or
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_COLON_CHAR, ":")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_COMMA_CHAR, ",")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_SPACE_CHAR, " ")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING__EMPTY, "")
`OPCODE_SCOPE_CODE_FLAGS_EMPTY` would be similar to naming of other flags, so code `scope_flags = OPCODE_SCOPE_CODE_FLAGS_EMPTY;` could be read as something like "we mark that the scope's code has some 'empty' property".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. OPCODE_SCOPE_CODE_FLAGS__EMPTY
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@egavrin , ok. Should the changes be placed in separate commit? |
a6bd26f
to
74ac051
Compare
I've updated pull request:
Please, review. |
LGTM (regarding changes in parser). |
@ruben-ayrapetyan please, add this with a separate commit to this branch. |
87eda19
to
f7dd511
Compare
@egavrin , I've updated pull request:
|
f7dd511
to
297d976
Compare
@egavrin , I've updated pull request:
|
@galpeter , please, review. |
|
||
void | ||
rewrite_scope_code_flags (opcode_counter_t scope_code_flags_oc, | ||
opcode_scope_code_flags_t scope_flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comments on parameters and about the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll add.
Unfortunately, in the component the style was not used before.
However, maybe, it is better to update the component step by step, fixing style in it.
d832d9c
to
193ad5e
Compare
@galpeter , I've updated pull request according to your comments. Please, review. |
@ruben-ayrapetyan, looks good to me. |
@galpeter, ok, thank you for review. |
init_int -> vm_init; run_int -> vm_run_global; run_int_loop -> vm_loop; run_int_from_pos -> vm_run_from_pos; read_opcode -> vm_get_opcode. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
…e various properties of a scope; replacing 'strict mode' meta opcode with a flag in the flags set. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
…ce 'arguments' and 'eval' identifiers. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
…ect should be instantiated upon call of the function. The Arguments object is supposed to be unnecessary if function's code: - doesn't reference 'arguments' identifier; - doesn't reference 'eval' identifier (so, it doesn't perform direct call to eval). JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
…g and removing them from unsupported list. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
193ad5e
to
77df022
Compare
OK, |
I'm not sure how it happened, but it seems that update, adding comments to I'll fix this, adding the changes through separate pull request. |
The same for update, adding test |
…guments object). JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
…rguments object). JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
…rguments object). JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
Commit pack that enables instantiation of Arguments object.
Related issue: #53