From 10e26244192e7cb25663f6dbf47aec215563c038 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 3 Jul 2020 14:21:27 +0000 Subject: Issue #618 - Match JSAPI names with the changes in 9ca74147225eed305e28c7887f9b2251aeeb0f36 Ref: BZ 1388728 --- dom/base/nsJSUtils.cpp | 12 ++++++------ dom/base/nsJSUtils.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'dom/base') diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index c24adc739..c294cfdba 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -308,9 +308,9 @@ nsJSUtils::CompileModule(JSContext* aCx, } nsresult -nsJSUtils::ModuleDeclarationInstantiation(JSContext* aCx, JS::Handle aModule) +nsJSUtils::ModuleInstantiate(JSContext* aCx, JS::Handle aModule) { - PROFILER_LABEL("nsJSUtils", "ModuleDeclarationInstantiation", + PROFILER_LABEL("nsJSUtils", "ModuleInstantiate", js::ProfileEntry::Category::JS); MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext()); @@ -318,7 +318,7 @@ nsJSUtils::ModuleDeclarationInstantiation(JSContext* aCx, JS::Handle NS_ENSURE_TRUE(xpc::Scriptability::Get(aModule).Allowed(), NS_OK); - if (!JS::ModuleDeclarationInstantiation(aCx, aModule)) { + if (!JS::ModuleInstantiate(aCx, aModule)) { return NS_ERROR_FAILURE; } @@ -326,9 +326,9 @@ nsJSUtils::ModuleDeclarationInstantiation(JSContext* aCx, JS::Handle } nsresult -nsJSUtils::ModuleEvaluation(JSContext* aCx, JS::Handle aModule) +nsJSUtils::ModuleEvaluate(JSContext* aCx, JS::Handle aModule) { - PROFILER_LABEL("nsJSUtils", "ModuleEvaluation", + PROFILER_LABEL("nsJSUtils", "ModuleEvaluate", js::ProfileEntry::Category::JS); MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext()); @@ -338,7 +338,7 @@ nsJSUtils::ModuleEvaluation(JSContext* aCx, JS::Handle aModule) NS_ENSURE_TRUE(xpc::Scriptability::Get(aModule).Allowed(), NS_OK); - if (!JS::ModuleEvaluation(aCx, aModule)) { + if (!JS::ModuleEvaluate(aCx, aModule)) { return NS_ERROR_FAILURE; } diff --git a/dom/base/nsJSUtils.h b/dom/base/nsJSUtils.h index 4affab2d3..9eea6ae83 100644 --- a/dom/base/nsJSUtils.h +++ b/dom/base/nsJSUtils.h @@ -116,11 +116,11 @@ public: JS::CompileOptions &aCompileOptions, JS::MutableHandle aModule); - static nsresult ModuleDeclarationInstantiation(JSContext* aCx, - JS::Handle aModule); + static nsresult ModuleInstantiate(JSContext* aCx, + JS::Handle aModule); - static nsresult ModuleEvaluation(JSContext* aCx, - JS::Handle aModule); + static nsresult ModuleEvaluate(JSContext* aCx, + JS::Handle aModule); // Returns false if an exception got thrown on aCx. Passing a null // aElement is allowed; that wil produce an empty aScopeChain. -- cgit v1.2.3 From 046534432d2914c80bcab36797fe0a43ff332a98 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 4 Jul 2020 10:35:22 +0000 Subject: Issue #618 - Remove eager instantiation This backs out the stuff added in Bug 1295978. Ref: BZ 1295978, 1388728 --- dom/base/nsJSUtils.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'dom/base') diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index c294cfdba..65965d74b 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -315,6 +315,7 @@ nsJSUtils::ModuleInstantiate(JSContext* aCx, JS::Handle aModule) MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext()); MOZ_ASSERT(NS_IsMainThread()); + MOZ_ASSERT(nsContentUtils::IsInMicroTask()); NS_ENSURE_TRUE(xpc::Scriptability::Get(aModule).Allowed(), NS_OK); -- cgit v1.2.3 From d637d99eefa1ce5acb120c04efd4a7247241da59 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 4 Jul 2020 20:33:01 +0000 Subject: Issue #618 - Slightly improve module scripting tests. Ref: BZ 1388728 --- dom/base/test/jsmodules/test_syntaxError.html | 15 +++++++++++---- dom/base/test/jsmodules/test_syntaxErrorAsync.html | 15 +++++++++++---- dom/base/test/jsmodules/test_syntaxErrorInline.html | 15 +++++++++++---- dom/base/test/jsmodules/test_syntaxErrorInlineAsync.html | 15 +++++++++++---- 4 files changed, 44 insertions(+), 16 deletions(-) (limited to 'dom/base') diff --git a/dom/base/test/jsmodules/test_syntaxError.html b/dom/base/test/jsmodules/test_syntaxError.html index 53f95c96c..5bd688fe3 100644 --- a/dom/base/test/jsmodules/test_syntaxError.html +++ b/dom/base/test/jsmodules/test_syntaxError.html @@ -4,20 +4,27 @@ - + diff --git a/dom/base/test/jsmodules/test_syntaxErrorAsync.html b/dom/base/test/jsmodules/test_syntaxErrorAsync.html index 35d923755..3593d9dd7 100644 --- a/dom/base/test/jsmodules/test_syntaxErrorAsync.html +++ b/dom/base/test/jsmodules/test_syntaxErrorAsync.html @@ -4,20 +4,27 @@ - + diff --git a/dom/base/test/jsmodules/test_syntaxErrorInline.html b/dom/base/test/jsmodules/test_syntaxErrorInline.html index 705bc5902..b85b954ec 100644 --- a/dom/base/test/jsmodules/test_syntaxErrorInline.html +++ b/dom/base/test/jsmodules/test_syntaxErrorInline.html @@ -4,22 +4,29 @@ - -