Bug 1179102 - The async version of loadSubscript doesn't get the right JS version. r=bholley
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -124,17 +124,18 @@ PrepareScript(nsIURI* uri,
const nsAString& charset,
const char* buf,
int64_t len,
bool reuseGlobal,
MutableHandleScript script,
MutableHandleFunction function)
{
JS::CompileOptions options(cx);
- options.setFileAndLine(uriStr, 1);
+ options.setFileAndLine(uriStr, 1)
+ .setVersion(JSVERSION_LATEST);
if (!charset.IsVoid()) {
char16_t* scriptBuf = nullptr;
size_t scriptLength = 0;
nsresult rv =
nsScriptLoader::ConvertToUTF16(nullptr, reinterpret_cast<const uint8_t*>(buf), len,
charset, nullptr, scriptBuf, scriptLength);