问题模块 框架类型 问题类型 操作系统版本 手机型号 微信版本
客户端 小游戏 Bug iOS 10.3.2 | Android 7.1.1 iPhone 6s plus | 坚果pro 6.7.2 | 6.6.7
- 当前 Bug 的表现(可附上截图)
测试代码:

在微信开发者工具中运行:

在iPhone 6s plus上运行:

在坚果pro上运行:

- 预期表现
开发者工具里运行一切正常,但是在手机上运行貌似generator函数生成的不是个迭代器,调用next函数返回的是个null。
期望手机上的运行结果与开发者工具里一致。
- 复现路径
运行代码即可。
- 提供一个最简复现 Demo
function* testGenerator() {
console.log(" In generator: ", 0);
yield 1;
console.log(" In generator: ", 1);
yield 2;
console.log(" In generator: ", 2);
}
let iterator = testGenerator();
console.info("iterator:", iterator);
console.info("iterator.next", iterator.next);
let result = iterator.next();
console.info("result:", result);
取消勾选“ES6 转 ES5”选项。
代码片段
wechatide://minicode/exEBJom27j2M
微信小程序开发问题解答
微信小程序开发者回答:
低版本iOS是不支持的,不建议直接使用
微信小程序开发者回答:
哦哦,谢谢!
也就是说只有一部分手机支持所以尽量不要使用是吗?原来这个还用到了系统相关的东东啊……
本文网址:http://www.91bianli.com/weixinxiaochengxu/46640.html