-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
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
Async function execute in different version got different output about async function itself #1733
Comments
On Windows 7 x64:
|
cc @nodejs/v8 |
Seems like it was a bug in old V8. async function test(){await 1}
test()
console.log('prototype' in test) // false
console.log(test.prototype) // Object [Generator] {}
console.log(test['prototype']) // Object [Generator] {}
console.log(test['prototype' + '']) // undefined There's no semantical difference between the last two lines, but they give different results. |
I did bisect and landed with this PR: |
@yathamravali The referenced PR was later reverted: nodejs/node#22911. So it couldn’t have been that. |
@Hakerh400’s analysis seems correct though. |
closing as answered, let me know if there is anything outstanding here |
I did more research on this. This bisects to nodejs/node@0e7ddbd (brought by PR nodejs/node#22754). Further bisecting V8 revealed that the bug is fixed in v8/v8@4ef4dea, as a special case of v8/v8#5085. The relevant test, which is basically the same script from the OP, that was added in that commit is test-regress-5085. |
I found an interesting things,
Simple test code:
When I use the
10.15.0
version, I got two different outputs.This does not appear on the
11.7.0
version.I did not find the relevant modification record on the ChangeLog.
I'm not sure if it is a bug fix, or an implementation change. Can you provide the corresponding information?
I'm more interested in this, thank you.
The text was updated successfully, but these errors were encountered: