Skip to content

[8.x] deps: V8: fix bug in InternalPerformPromiseThen #21426

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

Merged
merged 1 commit into from
Jul 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 59
#define V8_PATCH_LEVEL 60

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/builtins/builtins-promise-gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ Node* PromiseBuiltinsAssembler::InternalPerformPromiseThen(
BIND(&if_existingcallbacks);
{
Label if_singlecallback(this), if_multiplecallbacks(this);
BranchIfJSObject(existing_deferred_promise, &if_singlecallback,
&if_multiplecallbacks);
Branch(HasInstanceType(existing_deferred_promise, FIXED_ARRAY_TYPE),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use Branch(IsFixedArray(existing_deferred_promise), ...) here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&if_multiplecallbacks, &if_singlecallback);

BIND(&if_singlecallback);
{
Expand Down
21 changes: 21 additions & 0 deletions deps/v8/test/mjsunit/compiler/promise-proxy-callback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

class MyPromise extends Promise {
static get [Symbol.species]() {
return function(f) {
console.log("foo")
var a = new Promise(f);
return new Proxy(new Function(),{})
}
}
}
var p1 = new Promise(function(resolve, reject) {});
p1.__proto__ = MyPromise.prototype;
p1.then();
p1.then();

for (var i = 0; i < 0x20000; i++) {
new String()
}