Cocos Creator version
3.8.8
System information
H5
Issue description
@flatten-js/core 的 Polygon.area() 使用 [...this.faces],H5 转译后变成 [].concat(this.faces),导致 PlanarSet 被当成单个元素传入 reduce。模拟器保留原生迭代语义,因此不报错。
Relevant error log output
No response
Steps to reproduce
@flatten-js/core 对 PlanarSet 使用了 [...this.faces]。
H5 转译把它错误降成 [].concat(this.faces),没有按可迭代对象展开。
PlanarSet 不是数组,所以后续拿到的是容器本身,才出现 signedArea is not a function。
模拟器使用原生迭代语义,因此没有触发。
Minimal reproduction project
No response
Cocos Creator version
3.8.8
System information
H5
Issue description
@flatten-js/core 的 Polygon.area() 使用 [...this.faces],H5 转译后变成 [].concat(this.faces),导致 PlanarSet 被当成单个元素传入 reduce。模拟器保留原生迭代语义,因此不报错。
Relevant error log output
No response
Steps to reproduce
@flatten-js/core 对 PlanarSet 使用了 [...this.faces]。
H5 转译把它错误降成 [].concat(this.faces),没有按可迭代对象展开。
PlanarSet 不是数组,所以后续拿到的是容器本身,才出现 signedArea is not a function。
模拟器使用原生迭代语义,因此没有触发。
Minimal reproduction project
No response