deps: fix async await desugaring in V8#12004
Conversation
|
There seems to be a problem with Clang: https://ci.nodejs.org/job/node-test-commit-linux/8639/nodes=ubuntu1204-clang341-64/console |
|
@targos It's not just you, #11652 (comment). |
|
@nodejs/build ^^^ |
bnoordhuis
left a comment
There was a problem hiding this comment.
LGTM with a nit and a question.
deps/v8/src/parsing/parser.cc
Outdated
deps/v8/src/parsing/parser.cc
Outdated
There was a problem hiding this comment.
I realize the original CL does that too but do you happen to know why it uses empty_string() instead of undefined_value() or the_hole_value()?
There was a problem hiding this comment.
I agree, there doesn't seem to be a good reason for that. Do you want me to change it for undefined_value()?
There was a problem hiding this comment.
I think the logic is that the initial value won't matter because it's overwritten in all code paths? I'd have used the_hole_value() because its presence traps in many cases and it's something you can unambiguously debug-check since it's never produced by JS code.
There was a problem hiding this comment.
empty_string isn't the value, it's the name of the variable. we never actually lookup the variable by name, so it doesn't need a name.
This is a backport of https://codereview.chromium.org/2672313003/. The patch did not land in V8 because it was superseded by another one but it is much easier to backport to V8 5.5, was reviewed and passed tests. Original commit message: [async await] Fix async function desugaring Previously we rewrote the return statement in an async function from `return expr;` to `return %ResolvePromise(.promise, expr), .promise`. This can lead to incorrect behavior in the presence of try-finally. This patch stores the `expr` of the return statement in a temporary variable, resolves and returns the promise at the end of the finally block. BUG=v8:5896 PR-URL: nodejs#12004 Fixes: nodejs#11960 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
9ccb396 to
d22346d
Compare
Notable changes:
* buffer:
- do not segfault on out-of-range index (Timothy Gu)
#11927
* crypto:
- Fix memory leak if certificate is revoked (Tom Atkinson)
#12089
* deps:
* upgrade npm to 4.2.0 (Kat Marchán)
#11389
* fix async await desugaring in V8 (Michaël Zasso)
#12004
* readline:
- add option to stop duplicates in history (Danny Nemer)
#2982
* src:
- add native URL class (James M Snell)
#11801
PR-URL: #12104
Notable changes:
* buffer:
- do not segfault on out-of-range index (Timothy Gu)
#11927
* crypto:
- Fix memory leak if certificate is revoked (Tom Atkinson)
#12089
* deps:
* upgrade npm to 4.2.0 (Kat Marchán)
#11389
* fix async await desugaring in V8 (Michaël Zasso)
#12004
* readline:
- add option to stop duplicates in history (Danny Nemer)
#2982
* src:
- add native URL class (James M Snell)
#11801
PR-URL: #12104
Notable changes:
* buffer:
- do not segfault on out-of-range index (Timothy Gu)
nodejs/node#11927
* crypto:
- Fix memory leak if certificate is revoked (Tom Atkinson)
nodejs/node#12089
* deps:
* upgrade npm to 4.2.0 (Kat Marchán)
nodejs/node#11389
* fix async await desugaring in V8 (Michaël Zasso)
nodejs/node#12004
* readline:
- add option to stop duplicates in history (Danny Nemer)
nodejs/node#2982
* src:
- add native URL class (James M Snell)
nodejs/node#11801
PR-URL: nodejs/node#12104
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
This is a backport of https://codereview.chromium.org/2672313003/. The
patch did not land in V8 because it was superseded by another one but it
is much easier to backport to V8 5.5, was reviewed and passed tests.
Original commit message:
Fixes: #11960
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
V8