diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index f8a3f6639a8a..cb2dfa0cb0b8 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -17,7 +17,7 @@ #include "js/BinASTFormat.h" // JS::BinASTFormat #include "js/CompilationAndEvaluation.h" #include "js/Date.h" -#include "js/Modules.h" // JS::CompileModule{,DontInflate}, JS::GetModuleScript, JS::Module{Instantiate,Evaluate} +#include "js/Modules.h" // JS::CompileModule, JS::GetModuleScript, JS::Module{Instantiate,Evaluate} #include "js/OffThreadScriptCompilation.h" #include "js/SourceText.h" #include "nsIScriptContext.h" @@ -458,21 +458,6 @@ nsresult nsJSUtils::ExecutionContext::ExecScript( return NS_OK; } -static JSObject* CompileModule(JSContext* aCx, - JS::CompileOptions& aCompileOptions, - JS::SourceText& aSrcBuf) { - return JS::CompileModule(aCx, aCompileOptions, aSrcBuf); -} - -static JSObject* CompileModule(JSContext* aCx, - JS::CompileOptions& aCompileOptions, - JS::SourceText& aSrcBuf) { - // Once compile-UTF-8-without-inflating is stable, it'll be renamed to remove - // the "DontInflate" suffix, these two overloads can be removed, and - // |JS::CompileModule| can be used in the sole caller below. - return JS::CompileModuleDontInflate(aCx, aCompileOptions, aSrcBuf); -} - template static nsresult CompileJSModule(JSContext* aCx, JS::SourceText& aSrcBuf, JS::Handle aEvaluationGlobal, @@ -489,7 +474,7 @@ static nsresult CompileJSModule(JSContext* aCx, JS::SourceText& aSrcBuf, NS_ENSURE_TRUE(xpc::Scriptability::Get(aEvaluationGlobal).Allowed(), NS_OK); - JSObject* module = CompileModule(aCx, aCompileOptions, aSrcBuf); + JSObject* module = JS::CompileModule(aCx, aCompileOptions, aSrcBuf); if (!module) { return NS_ERROR_FAILURE; } diff --git a/js/public/Modules.h b/js/public/Modules.h index f2b9d8ddf10a..0d2533b428c2 100644 --- a/js/public/Modules.h +++ b/js/public/Modules.h @@ -95,18 +95,10 @@ extern JS_PUBLIC_API JSObject* CompileModule( /** * Parse the given source buffer as a module in the scope of the current global - * of cx and return a source text module record. - * - * The "DontInflate" suffix and (semantically unobservable) don't-inflate - * characteristic are temporary while bugs in UTF-8 compilation are ironed out. - * In the long term this function will be renamed |JS::CompileModule| and will - * just never inflate. - * - * NOTE: UTF-8 compilation is currently experimental, and it's possible it has - * as-yet-undiscovered bugs that the UTF-16 compilation functions do not - * have. Use only if you're willing to take a risk! + * of cx and return a source text module record. An error is reported if a + * UTF-8 encoding error is encountered. */ -extern JS_PUBLIC_API JSObject* CompileModuleDontInflate( +extern JS_PUBLIC_API JSObject* CompileModule( JSContext* cx, const ReadOnlyCompileOptions& options, SourceText& srcBuf); diff --git a/js/src/vm/Modules.cpp b/js/src/vm/Modules.cpp index 60c17095f478..73c9cbcf52dc 100644 --- a/js/src/vm/Modules.cpp +++ b/js/src/vm/Modules.cpp @@ -100,9 +100,9 @@ JS_PUBLIC_API JSObject* JS::CompileModule(JSContext* cx, return CompileModuleHelper(cx, options, srcBuf); } -JS_PUBLIC_API JSObject* JS::CompileModuleDontInflate( - JSContext* cx, const ReadOnlyCompileOptions& options, - SourceText& srcBuf) { +JS_PUBLIC_API JSObject* JS::CompileModule(JSContext* cx, + const ReadOnlyCompileOptions& options, + SourceText& srcBuf) { return CompileModuleHelper(cx, options, srcBuf); }