Skip to content

H5 构建转译与第三方代码的兼容性问题 @flatten-js/core #19249

Description

@fsd-china

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageNeeds to be assigned by the team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions