Skip to content

Commit efe28b8

Browse files
ofrobotsrvagg
authored andcommitted
deps: V8: fix bug in InternalPerformPromiseThen
This fix never landed upstream as it was not longer relevant to active V8 branches for Chromium. Original commit message: [turbofan] Fix bug in InternalPerformPromiseThen Bug: chromium:831170 Change-Id: I1022fc360aafdfd392d6781eb50afc87a18096fd PR-URL: #21426 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 9aeffab commit efe28b8

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 414
14-
#define V8_PATCH_LEVEL 59
14+
#define V8_PATCH_LEVEL 60
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/builtins/builtins-promise-gen.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ Node* PromiseBuiltinsAssembler::InternalPerformPromiseThen(
509509
BIND(&if_existingcallbacks);
510510
{
511511
Label if_singlecallback(this), if_multiplecallbacks(this);
512-
BranchIfJSObject(existing_deferred_promise, &if_singlecallback,
513-
&if_multiplecallbacks);
512+
Branch(HasInstanceType(existing_deferred_promise, FIXED_ARRAY_TYPE),
513+
&if_multiplecallbacks, &if_singlecallback);
514514

515515
BIND(&if_singlecallback);
516516
{
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2018 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
class MyPromise extends Promise {
6+
static get [Symbol.species]() {
7+
return function(f) {
8+
console.log("foo")
9+
var a = new Promise(f);
10+
return new Proxy(new Function(),{})
11+
}
12+
}
13+
}
14+
var p1 = new Promise(function(resolve, reject) {});
15+
p1.__proto__ = MyPromise.prototype;
16+
p1.then();
17+
p1.then();
18+
19+
for (var i = 0; i < 0x20000; i++) {
20+
new String()
21+
}

0 commit comments

Comments
 (0)