switch (lvalue->token_type) {
case NJS_TOKEN_PROPERTY_INIT:
- if ((expr->token_type == NJS_TOKEN_FUNCTION
- || expr->token_type == NJS_TOKEN_FUNCTION_EXPRESSION
- || expr->token_type == NJS_TOKEN_ASYNC_FUNCTION_EXPRESSION))
+ if ((object->token_type == NJS_TOKEN_OBJECT
+ || (object->token_type == NJS_TOKEN_OBJECT_VALUE
+ && object->u.object->token_type == NJS_TOKEN_OBJECT))
+ && (expr->token_type == NJS_TOKEN_FUNCTION
+ || expr->token_type == NJS_TOKEN_FUNCTION_EXPRESSION
+ || expr->token_type == NJS_TOKEN_ASYNC_FUNCTION_EXPRESSION))
{
if (property->token_type == NJS_TOKEN_STRING) {
njs_value_assign(&expr->u.value.data.u.lambda->name,
{ njs_str("var obj = {}; ({[obj](){}}); typeof obj"),
njs_str("object") },
+ { njs_str("[function(){}][0].name"),
+ njs_str("") },
+
{ njs_str("var called = false;"
"({"
" [{toString(){ if (called) throw 'OOps'; called = true; return 'a'}}](){}"