зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1388728 - Rename JS APIs for loading modules in line with the spec r=bkelly
This commit is contained in:
Родитель
79e2fb41dc
Коммит
0173f129e8
|
@ -402,16 +402,16 @@ nsJSUtils::CompileModule(JSContext* aCx,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsJSUtils::ModuleDeclarationInstantiation(JSContext* aCx, JS::Handle<JSObject*> aModule)
|
||||
nsJSUtils::ModuleInstantiate(JSContext* aCx, JS::Handle<JSObject*> aModule)
|
||||
{
|
||||
AUTO_PROFILER_LABEL("nsJSUtils::ModuleDeclarationInstantiation", JS);
|
||||
AUTO_PROFILER_LABEL("nsJSUtils::ModuleInstantiate", JS);
|
||||
|
||||
MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext());
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_ENSURE_TRUE(xpc::Scriptability::Get(aModule).Allowed(), NS_OK);
|
||||
|
||||
if (!JS::ModuleDeclarationInstantiation(aCx, aModule)) {
|
||||
if (!JS::ModuleInstantiate(aCx, aModule)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -419,9 +419,9 @@ nsJSUtils::ModuleDeclarationInstantiation(JSContext* aCx, JS::Handle<JSObject*>
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsJSUtils::ModuleEvaluation(JSContext* aCx, JS::Handle<JSObject*> aModule)
|
||||
nsJSUtils::ModuleEvaluate(JSContext* aCx, JS::Handle<JSObject*> aModule)
|
||||
{
|
||||
AUTO_PROFILER_LABEL("nsJSUtils::ModuleEvaluation", JS);
|
||||
AUTO_PROFILER_LABEL("nsJSUtils::ModuleEvaluate", JS);
|
||||
|
||||
MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext());
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
@ -429,7 +429,7 @@ nsJSUtils::ModuleEvaluation(JSContext* aCx, JS::Handle<JSObject*> 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -183,11 +183,11 @@ public:
|
|||
JS::CompileOptions &aCompileOptions,
|
||||
JS::MutableHandle<JSObject*> aModule);
|
||||
|
||||
static nsresult ModuleDeclarationInstantiation(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aModule);
|
||||
static nsresult ModuleInstantiate(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aModule);
|
||||
|
||||
static nsresult ModuleEvaluation(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aModule);
|
||||
static nsresult ModuleEvaluate(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aModule);
|
||||
|
||||
// Returns false if an exception got thrown on aCx. Passing a null
|
||||
// aElement is allowed; that wil produce an empty aScopeChain.
|
||||
|
|
|
@ -828,7 +828,7 @@ ScriptLoader::InstantiateModuleTree(ModuleLoadRequest* aRequest)
|
|||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
JS::Rooted<JSObject*> module(jsapi.cx(), ms->ModuleRecord());
|
||||
bool ok = NS_SUCCEEDED(nsJSUtils::ModuleDeclarationInstantiation(jsapi.cx(), module));
|
||||
bool ok = NS_SUCCEEDED(nsJSUtils::ModuleInstantiate(jsapi.cx(), module));
|
||||
|
||||
JS::RootedValue exception(jsapi.cx());
|
||||
if (!ok) {
|
||||
|
@ -2085,7 +2085,7 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
|
|||
} else {
|
||||
JS::Rooted<JSObject*> module(aes.cx(), ms->ModuleRecord());
|
||||
MOZ_ASSERT(module);
|
||||
rv = nsJSUtils::ModuleEvaluation(aes.cx(), module);
|
||||
rv = nsJSUtils::ModuleEvaluate(aes.cx(), module);
|
||||
}
|
||||
aRequest->mCacheInfo = nullptr;
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче