Bug 1643049 - Fix string usage in ClonedErrorHolder::Init. r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D78131
This commit is contained in:
Emilio Cobos Álvarez 2020-06-03 19:16:51 +00:00
parent 47b6e279cf
commit e64af3d86d

View file

@ -59,8 +59,9 @@ void ClonedErrorHolder::Init(JSContext* aCx, JS::Handle<JSObject*> aError,
mFilename = err->filename; mFilename = err->filename;
} }
if (err->linebuf()) { if (err->linebuf()) {
AppendUTF16toUTF8(nsDependentString(err->linebuf(), err->linebufLength()), AppendUTF16toUTF8(
mSourceLine); nsDependentSubstring(err->linebuf(), err->linebufLength()),
mSourceLine);
mTokenOffset = err->tokenOffset(); mTokenOffset = err->tokenOffset();
} }
mLineNumber = err->lineno; mLineNumber = err->lineno;