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:
@@ -267,7 +267,7 @@ parse_property_assignment (void)
|
|||||||
syntax_add_prop_name (name, is_setter ? PROP_SET : PROP_GET);
|
syntax_add_prop_name (name, is_setter ? PROP_SET : PROP_GET);
|
||||||
|
|
||||||
skip_newlines ();
|
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 ();
|
dump_function_end_for_rewrite ();
|
||||||
|
|
||||||
|
|||||||
@@ -71,3 +71,22 @@ assert (a.property1 === 25);
|
|||||||
b = delete a[b];
|
b = delete a[b];
|
||||||
assert (b === true);
|
assert (b === true);
|
||||||
assert (a.property1 === undefined);
|
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');
|
||||||
|
|||||||
Reference in New Issue
Block a user