зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1552979 - Rename one CompileModule overload to ParseModule to make it easier to distinguish them, both mentally and in searches. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D31894 --HG-- extra : rebase_source : b925cffe35dfd8045c094af1652eaad96e7cea63
This commit is contained in:
Родитель
e80581731f
Коммит
462cc759d4
|
@ -804,10 +804,9 @@ JSScript* frontend::CompileGlobalBinASTScript(
|
|||
#endif // JS_BUILD_BINAST
|
||||
|
||||
template <typename Unit>
|
||||
static ModuleObject* CreateModule(JSContext* cx,
|
||||
const ReadOnlyCompileOptions& optionsInput,
|
||||
SourceText<Unit>& srcBuf,
|
||||
ScriptSourceObject** sourceObjectOut) {
|
||||
static ModuleObject* InternalParseModule(
|
||||
JSContext* cx, const ReadOnlyCompileOptions& optionsInput,
|
||||
SourceText<Unit>& srcBuf, ScriptSourceObject** sourceObjectOut) {
|
||||
MOZ_ASSERT(srcBuf.get());
|
||||
MOZ_ASSERT_IF(sourceObjectOut, *sourceObjectOut == nullptr);
|
||||
|
||||
|
@ -832,10 +831,11 @@ static ModuleObject* CreateModule(JSContext* cx,
|
|||
return module;
|
||||
}
|
||||
|
||||
ModuleObject* frontend::CompileModule(
|
||||
JSContext* cx, const ReadOnlyCompileOptions& optionsInput,
|
||||
SourceText<char16_t>& srcBuf, ScriptSourceObject** sourceObjectOut) {
|
||||
return CreateModule(cx, optionsInput, srcBuf, sourceObjectOut);
|
||||
ModuleObject* frontend::ParseModule(JSContext* cx,
|
||||
const ReadOnlyCompileOptions& optionsInput,
|
||||
SourceText<char16_t>& srcBuf,
|
||||
ScriptSourceObject** sourceObjectOut) {
|
||||
return InternalParseModule(cx, optionsInput, srcBuf, sourceObjectOut);
|
||||
}
|
||||
|
||||
template <typename Unit>
|
||||
|
@ -848,7 +848,7 @@ static ModuleObject* CreateModule(JSContext* cx,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RootedModuleObject module(cx, CompileModule(cx, options, srcBuf, nullptr));
|
||||
RootedModuleObject module(cx, ParseModule(cx, options, srcBuf, nullptr));
|
||||
if (!module) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -120,14 +120,17 @@ MOZ_MUST_USE bool CompileLazyBinASTFunction(JSContext* cx,
|
|||
|
||||
#endif // JS_BUILD_BINAST
|
||||
|
||||
// Compile a module of the given source using the given options.
|
||||
ModuleObject* CompileModule(JSContext* cx,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceText<char16_t>& srcBuf);
|
||||
|
||||
ModuleObject* CompileModule(JSContext* cx,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceText<char16_t>& srcBuf,
|
||||
ScriptSourceObject** sourceObjectOut);
|
||||
// Parse a module of the given source. This is an internal API; if you want to
|
||||
// compile a module as a user, use CompileModule above.
|
||||
ModuleObject* ParseModule(JSContext* cx,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceText<char16_t>& srcBuf,
|
||||
ScriptSourceObject** sourceObjectOut);
|
||||
|
||||
//
|
||||
// Compile a single function. The source in srcBuf must match the ECMA-262
|
||||
|
|
|
@ -580,7 +580,7 @@ void ModuleParseTask<Unit>::parse(JSContext* cx) {
|
|||
Rooted<ScriptSourceObject*> sourceObject(cx);
|
||||
|
||||
ModuleObject* module =
|
||||
frontend::CompileModule(cx, options, data, &sourceObject.get());
|
||||
frontend::ParseModule(cx, options, data, &sourceObject.get());
|
||||
if (module) {
|
||||
scripts.infallibleAppend(module->script());
|
||||
if (sourceObject) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче