diff --git a/common.gypi b/common.gypi index a6aeba5918a..6d2e0389f1a 100644 --- a/common.gypi +++ b/common.gypi @@ -37,7 +37,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.8', + 'v8_embedder_string': '-node.9', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/flags/flag-definitions.h b/deps/v8/src/flags/flag-definitions.h index 605511674ba..61e859ccb31 100644 --- a/deps/v8/src/flags/flag-definitions.h +++ b/deps/v8/src/flags/flag-definitions.h @@ -315,7 +315,6 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features") V(harmony_import_attributes, "harmony import attributes") #define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \ - V(js_promise_withresolvers, "Promise.withResolvers") \ V(js_regexp_duplicate_named_groups, "RegExp duplicate named groups") \ V(js_regexp_modifiers, "RegExp modifiers") \ V(js_promise_try, "Promise.try") diff --git a/deps/v8/src/init/bootstrapper.cc b/deps/v8/src/init/bootstrapper.cc index f7f715f383f..5d8c5636415 100644 --- a/deps/v8/src/init/bootstrapper.cc +++ b/deps/v8/src/init/bootstrapper.cc @@ -3258,6 +3258,15 @@ void Genesis::InitializeGlobal(Handle global_object, InstallFunctionWithBuiltinId(isolate_, promise_fun, "reject", Builtin::kPromiseReject, 1, kAdapt); + std::array, 3> fields{factory->promise_string(), + factory->resolve_string(), + factory->reject_string()}; + DirectHandle result_map = + CreateLiteralObjectMapFromCache(isolate_, fields); + native_context()->set_promise_withresolvers_result_map(*result_map); + InstallFunctionWithBuiltinId(isolate_, promise_fun, "withResolvers", + Builtin::kPromiseWithResolvers, 0, kAdapt); + SetConstructorInstanceType(isolate_, promise_fun, JS_PROMISE_CONSTRUCTOR_TYPE); @@ -5581,24 +5590,6 @@ void Genesis::InitializeGlobal_js_promise_try() { Builtin::kPromiseTry, 1, kDontAdapt); } -void Genesis::InitializeGlobal_js_promise_withresolvers() { - if (!v8_flags.js_promise_withresolvers) return; - - Factory* factory = isolate()->factory(); - - std::array, 3> fields{factory->promise_string(), - factory->resolve_string(), - factory->reject_string()}; - DirectHandle result_map = - CreateLiteralObjectMapFromCache(isolate(), fields); - native_context()->set_promise_withresolvers_result_map(*result_map); - - Handle promise_fun = - handle(native_context()->promise_function(), isolate()); - InstallFunctionWithBuiltinId(isolate(), promise_fun, "withResolvers", - Builtin::kPromiseWithResolvers, 0, kAdapt); -} - void Genesis::InitializeGlobal_harmony_set_methods() { if (!v8_flags.harmony_set_methods) return; diff --git a/deps/v8/test/mjsunit/harmony/promise-withresolvers.js b/deps/v8/test/mjsunit/harmony/promise-withresolvers.js index 9cb244a73fb..9466a6ab5ba 100644 --- a/deps/v8/test/mjsunit/harmony/promise-withresolvers.js +++ b/deps/v8/test/mjsunit/harmony/promise-withresolvers.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --js-promise-withresolvers --allow-natives-syntax +// Flags: --allow-natives-syntax const desc = Object.getOwnPropertyDescriptor(Promise, 'withResolvers'); assertTrue(desc.configurable); diff --git a/deps/v8/test/test262/testcfg.py b/deps/v8/test/test262/testcfg.py index fbb77e70a33..75637d8be28 100644 --- a/deps/v8/test/test262/testcfg.py +++ b/deps/v8/test/test262/testcfg.py @@ -58,7 +58,6 @@ FEATURE_FLAGS = { 'json-parse-with-source': '--harmony-json-parse-with-source', 'iterator-helpers': '--harmony-iterator-helpers', 'set-methods': '--harmony-set-methods', - 'promise-with-resolvers': '--js-promise-withresolvers', 'import-attributes': '--harmony-import-attributes', 'regexp-duplicate-named-groups': '--js-regexp-duplicate-named-groups', 'regexp-modifiers': '--js-regexp-modifiers',