NativeScript / NativeScript/android
Improve support for Java varargs methods
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 563
- 派生
- 144
- 平均合并
- 10 小时 46 分钟
- 30 天内合并 PR
- 14
描述
Java supports varargs methods. For example, [Class.getMethod](https://developer.android.com/reference/java/lang/Class.html#getMethod%28java.lang.String, java.lang.Class<?>...%29)
Method getMethod (String name, Class...<?> parameterTypes)
This is syntax sugar for the actual method signature which is
Method getMethod (String name, Class<?>[] parameterTypes)
Currently, NativeScript for Android does not support calling such method with implicit parameter
var klass = java.lang.Object.class;
// option 1) not supported
var method = klass.getMethod("hasCode");
// option 2) supported
var method = klass.getMethod("hasCode", null);
We can provide another implementation for the current method resolution algorithm so it tries to find a method with one additional parameter (array) as a fallback and if this fail then the method resolution fails as expected.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 NativeScript Android runtime 中当前的方法解析算法开始,跟踪 JavaScript 调用如何与 Java 方法匹配。根据 issue 中隐式和显式 varargs 的示例验证行为。完成的标准是:省略的 varargs 参数通过数组参数回退得到解析,而无法解析的方法仍然按正常情况失败。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp, java, javascript
- 领域
- mobile-dev
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100