Bug 1364979 - Don't use Latin-1 when encoding the export name for missing exports. r=jonco
authorAndré Bargull <andre.bargull@gmail.com>
Mon, 05 Jun 2017 13:10:45 +0200
changeset 410698 eb6d181cfc9714264d12ff2b01c3f4028ec7bf0e
parent 410697 2240d6e36324d77bff5260084243f863b74dfcdd
child 410699 0e098111552fc9dc53e590e94a2f0914df112465
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1364979
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1364979 - Don't use Latin-1 when encoding the export name for missing exports. r=jonco
js/src/frontend/Parser.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -2260,17 +2260,17 @@ Parser<FullParseHandler, char16_t>::modu
     // Check exported local bindings exist and mark them as closed over.
     for (auto entry : modulesc->builder.localExportEntries()) {
         JSAtom* name = entry->localName();
         MOZ_ASSERT(name);
 
         DeclaredNamePtr p = modulepc.varScope().lookupDeclaredName(name);
         if (!p) {
             JSAutoByteString str;
-            if (!str.encodeLatin1(context, name))
+            if (!AtomToPrintableString(context, name, &str))
                 return null();
 
             JS_ReportErrorNumberLatin1(context, GetErrorMessage, nullptr,
                                        JSMSG_MISSING_EXPORT, str.ptr());
             return null();
         }
 
         p->value()->setClosedOver();