зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
This commit is contained in:
Родитель
3322a7eb35
Коммит
685df4d56e
|
@ -131,7 +131,7 @@ class JS_PUBLIC_API TransitiveCompileOptions {
|
|||
bool nonSyntacticScope = false;
|
||||
bool privateClassFields = false;
|
||||
bool privateClassMethods = false;
|
||||
bool topLevelAwait = false;
|
||||
bool topLevelAwait = true;
|
||||
|
||||
// True if transcoding to XDR should use Stencil instead of JSScripts.
|
||||
bool useStencilXDR = false;
|
||||
|
|
|
@ -49,7 +49,7 @@ class JS_PUBLIC_API ContextOptions {
|
|||
fuzzing_(false),
|
||||
privateClassFields_(false),
|
||||
privateClassMethods_(false),
|
||||
topLevelAwait_(false) {
|
||||
topLevelAwait_(true) {
|
||||
}
|
||||
|
||||
bool asmJS() const { return asmJS_; }
|
||||
|
|
|
@ -95,8 +95,9 @@ bool basic_test(const CharT* chars) {
|
|||
JS::RootedValue rval(cx);
|
||||
CHECK(JS::ModuleInstantiate(cx, moduleObject));
|
||||
CHECK(JS::ModuleEvaluate(cx, moduleObject, &rval));
|
||||
CHECK(rval.isUndefined());
|
||||
CHECK(!rval.isUndefined());
|
||||
|
||||
js::RunJobs(cx);
|
||||
CHECK(JS_GetProperty(cx, global, "x", &rval));
|
||||
CHECK(rval.isNumber() && rval.toNumber() == 42);
|
||||
|
||||
|
@ -339,8 +340,9 @@ BEGIN_TEST(testStencil_OffThreadModule) {
|
|||
JS::RootedValue rval(cx);
|
||||
CHECK(JS::ModuleInstantiate(cx, moduleObject));
|
||||
CHECK(JS::ModuleEvaluate(cx, moduleObject, &rval));
|
||||
CHECK(rval.isUndefined());
|
||||
CHECK(!rval.isUndefined());
|
||||
|
||||
js::RunJobs(cx);
|
||||
CHECK(JS_GetProperty(cx, global, "x", &rval));
|
||||
CHECK(rval.isNumber() && rval.toNumber() == 42);
|
||||
|
||||
|
|
|
@ -630,7 +630,7 @@ bool shell::enablePropertyErrorMessageFix = false;
|
|||
bool shell::enableIteratorHelpers = false;
|
||||
bool shell::enablePrivateClassFields = false;
|
||||
bool shell::enablePrivateClassMethods = false;
|
||||
bool shell::enableTopLevelAwait = false;
|
||||
bool shell::enableTopLevelAwait = true;
|
||||
bool shell::useOffThreadParseGlobal = true;
|
||||
#ifdef JS_GC_ZEAL
|
||||
uint32_t shell::gZealBits = 0;
|
||||
|
|
|
@ -975,6 +975,9 @@ static void ReloadPrefsCallback(const char* pref, void* aXpccx) {
|
|||
sWeakRefsExposeCleanupSome = Preferences::GetBool(
|
||||
JS_OPTIONS_DOT_STR "experimental.weakrefs.expose_cleanupSome");
|
||||
|
||||
bool topLevelAwaitEnabled =
|
||||
Preferences::GetBool(JS_OPTIONS_DOT_STR "experimental.top_level_await");
|
||||
|
||||
// Require private fields disabled outside of nightly.
|
||||
bool privateFieldsEnabled = false;
|
||||
bool privateMethodsEnabled = false;
|
||||
|
@ -987,13 +990,6 @@ static void ReloadPrefsCallback(const char* pref, void* aXpccx) {
|
|||
Preferences::GetBool(JS_OPTIONS_DOT_STR "experimental.private_methods");
|
||||
#endif
|
||||
|
||||
// Require top level await disabled outside of nightly.
|
||||
bool topLevelAwaitEnabled = false;
|
||||
#ifdef NIGHTLY_BUILD
|
||||
topLevelAwaitEnabled =
|
||||
Preferences::GetBool(JS_OPTIONS_DOT_STR "experimental.top_level_await");
|
||||
#endif
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
int32_t zeal = Preferences::GetInt(JS_OPTIONS_DOT_STR "gczeal", -1);
|
||||
int32_t zeal_frequency = Preferences::GetInt(
|
||||
|
|
|
@ -5592,13 +5592,13 @@
|
|||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
#endif // NIGHTLY_BUILD
|
||||
|
||||
# Experimental support for Top-level Await in JavaScript.
|
||||
- name: javascript.options.experimental.top_level_await
|
||||
type: bool
|
||||
value: false
|
||||
value: true
|
||||
mirror: always
|
||||
#endif // NIGHTLY_BUILD
|
||||
|
||||
# The amount of time we wait between a request to GC (due to leaving a page) and doing the actual GC, in ms.
|
||||
- name: javascript.options.gc_delay
|
||||
|
|
Загрузка…
Ссылка в новой задаче