From 81ea491e2c01682a56703ddbd225e596f9330284 Mon Sep 17 00:00:00 2001 From: xingshunxiang Date: Thu, 31 Jul 2025 20:25:14 +0800 Subject: [PATCH] CTE when skip required prop in object literal Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICPT3O?from=project-issue Description: throw CTE for skipping non-optional properties in object literal Reason: according to spec 7.5.2, Properties of a non-optional type cannot be skipped in an object literal, despite some property types having default values Signed-off-by: xingshunxiang --- frameworks/ets/ets/notification/notificationRequest.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/ets/ets/notification/notificationRequest.ets b/frameworks/ets/ets/notification/notificationRequest.ets index bc23d7d71..8353d1c12 100644 --- a/frameworks/ets/ets/notification/notificationRequest.ets +++ b/frameworks/ets/ets/notification/notificationRequest.ets @@ -43,8 +43,8 @@ export interface NotificationFilter { } class NotificationFilterInner implements NotificationFilter { - public bundle: BundleOption = {}; - public notificationKey: notificationSubscribe.NotificationKey = {}; + public bundle: BundleOption = {bundle: 'undefined'}; + public notificationKey: notificationSubscribe.NotificationKey = {id: 0}; public extraInfoKeys?: Array | undefined; } -- Gitee