已关闭
[Bug]: Proxy should throw error if setlength fail #12186
hecunmao创建于  2025年12月25日关闭于  2025年12月27日
hecunmao
hecunmao
2025年12月25日 创建

感谢对OpenHarmony社区的支持与关注,欢迎反馈缺陷。

发生了什么问题?

{
    try {
        let arr = [1,2,3,4];
        Object.seal(arr);
        let px = new Proxy(arr,{});
        px.length = 1;
        print("test fail");
    } catch (error) {
        print(error.name)
    }
}

期望行为是什么?

期望:
TypeError
实际:
test fail

如何复现该缺陷

对于proxy场景应该抛异常。

其他补充信息

版本或分支信息


[x] master

[ ] Release 6.0

[ ] Release 5.1.0

[ ] Release 5.0.3

[ ] Release 4.1

[ ] Other

likedislike
hecunmaohecunmao
2025年12月25日 添加了label:bug
openharmony_ci
openharmony_ci成员
2025年12月25日 评论:

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@yingguofeng](https://gitcode.com/yingguofeng) [@weng-changcheng](https://gitcode.com/weng-changcheng) [@dingding5](https://gitcode.com/dingding5) [@ipetrov](https://gitcode.com/ipetrov) [@chuning](https://gitcode.com/chuning) [@gong_19901](https://gitcode.com/gong_19901) 。如果需要调整订阅PR、Issue的变更状态,请访问链接


Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
2025年12月25日 添加了label:waiting_for_assign
hecunmaohecunmao
2025年12月25日 关联了pull request:Proxy should throw error if setlength fail
openharmony_ciopenharmony_ci成员
2025年12月27日 关闭了 issue