Metadata-generator creates enums with incorrect values
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp, javascript, objective-c
调研方向
从 metadata-generator/src/Meta/MetaFactory.cpp 第 321 行附近开始,检查 unsigned Objective-C 值 UIRectCornerAllCorners = ~0UL 是如何转换的。验证生成的 JavaScript 是否将 unsigned 值保留为 0xffffffff 或 4294967295,包括将其作为函数参数传递时。
由索引模型根据 Issue 内容生成。
描述
There is the case of metadata-generator creating enums with wrong values if the original value is unsigned.
This became apparent with UIRectCornerAllCorners case where value is an unsigned long in obj-c.
UIRectCornerAllCorners = ~0UL
See: https://developer.apple.com/documentation/uikit/uirectcorner/uirectcornerallcorners?language=objc
Unfortunately, generator converts the value into a signed value resulting in -1 and when it's used as a function parameter, it brings unexpected results.
In JavaScript, the proper value would probably be 0xffffffff or 4294967295 to match the unsigned value.
I found this part of generator that looks suspicious: https://github.com/NativeScript/ios/blob/main/metadata-generator/src/Meta/MetaFactory.cpp#L321
- 主要语言
- JavaScript
- 星标
- 150
- 派生
- 43
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 22
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NativeScript/ios 的其他 Issue
-
难度 5/5 一周以上 新手友好度 38/100
NativeScript/ios#459 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
NativeScript/ios#445 ·
-
难度 3/5 3-5 天 新手友好度 66/100
NativeScript/ios#414 ·
-
question
难度 4/5 3-5 天 新手友好度 34/100
NativeScript/ios#364 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
NativeScript/ios#355 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
nightscout/nocturne#1414 ·
-
bug v2
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/inspector#2458 · 1 条评论 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
难度 2/5 1-3 小时 新手友好度 70/100
carbon-design-system/ibm-products#9907 ·