mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Generate anonymous function expressions for getters / setters of an object literal.
Related issue: #234 JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
parent
c603d10360
commit
4ff9e79b02
@ -267,7 +267,7 @@ parse_property_assignment (void)
|
||||
syntax_add_prop_name (name, is_setter ? PROP_SET : PROP_GET);
|
||||
|
||||
skip_newlines ();
|
||||
const operand func = parse_argument_list (VARG_FUNC_EXPR, name, NULL, NULL);
|
||||
const operand func = parse_argument_list (VARG_FUNC_EXPR, empty_operand (), NULL, NULL);
|
||||
|
||||
dump_function_end_for_rewrite ();
|
||||
|
||||
|
||||
@ -71,3 +71,22 @@ assert (a.property1 === 25);
|
||||
b = delete a[b];
|
||||
assert (b === true);
|
||||
assert (a.property1 === undefined);
|
||||
|
||||
flow = '';
|
||||
a = {
|
||||
get q ()
|
||||
{
|
||||
flow += 'get: ' + (typeof q);
|
||||
|
||||
return 0;
|
||||
},
|
||||
set q (v)
|
||||
{
|
||||
flow += ', set: ' + (typeof q);
|
||||
}
|
||||
};
|
||||
|
||||
a.q;
|
||||
a.q = 1;
|
||||
|
||||
assert (flow == 'get: undefined, set: undefined');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user