We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ // code 1 const [a, b, c, ...d] = test() print(d[0], d[1]) } { // code 2 const [a, b, c, d, e] = test() print(d, e) }
上述两段代码显然我们期望结果是一样的。
然而
function test() { let i = 0 return { [Symbol.iterator]() { return { next() { return {value: ++i, done: i % 3 === 0} }, } } } }
结果 V8 前者返回 4, 5,后者返回 undefined, undefined。显然V8的实现有bug。
4, 5
undefined, undefined
其他引擎中,SpiderMonkey、JavaScriptCore、Hermes、engine262 的结果是符合预期的(都是undefined, undefined)。XS 和 Chakra 返回的都是 4, 5 好歹是一致的。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
上述两段代码显然我们期望结果是一样的。
然而
结果 V8 前者返回
4, 5
,后者返回undefined, undefined
。显然V8的实现有bug。其他引擎中,SpiderMonkey、JavaScriptCore、Hermes、engine262 的结果是符合预期的(都是
undefined, undefined
)。XS 和 Chakra 返回的都是4, 5
好歹是一致的。The text was updated successfully, but these errors were encountered: