Bug 1179102 - The async version of loadSubscript doesn't get the right JS version. r=bholley
authorFabrice Desré <fabrice@mozilla.com>
Wed, 01 Jul 2015 16:26:08 -0700
changeset 271020 a2bfabc26c7379ea84525a5fd3ed1bb50c226fc7
parent 271019 d71b2d7cd21928f8bfec3e61aae2ffe66a170a9c
child 271021 0395ca7ecdc9ba0558f8b4820fc2aa064a37a0bf
push id8304
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 19:25:01 +0000
treeherdermozilla-aurora@7308dd0a6c3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1179102
milestone42.0a1
Bug 1179102 - The async version of loadSubscript doesn't get the right JS version. r=bholley
js/xpconnect/loader/mozJSSubScriptLoader.cpp
--- 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);