Backed out changeset f1fbe41260cc (bug 1884837) for dt failure on browser_dbg-features-asm.js . CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2024-03-19 21:25:45 +02:00
parent 23294d99b8
commit 4a046a9cbe
2 changed files with 37 additions and 39 deletions

View file

@ -1269,46 +1269,46 @@ bool DebuggerObject::CallData::createSource() {
bool isScriptElement = ToBoolean(v);
JS::CompileOptions compileOptions(cx);
compileOptions.lineno = startLine;
compileOptions.column = JS::ColumnNumberOneOrigin(startColumn);
if (!JS::StringHasLatin1Chars(url)) {
JS_ReportErrorASCII(cx, "URL must be a narrow string");
return false;
}
Vector<Latin1Char> urlChars(cx);
if (!CopyStringToVector(cx, url, urlChars)) {
return false;
}
compileOptions.setFile((const char*)urlChars.begin());
Vector<char16_t> sourceMapURLChars(cx);
if (sourceMapURL) {
if (!CopyStringToVector(cx, sourceMapURL, sourceMapURLChars)) {
return false;
}
compileOptions.setSourceMapURL(sourceMapURLChars.begin());
}
if (isScriptElement) {
// The introduction type must be a statically allocated string.
compileOptions.setIntroductionType("inlineScript");
}
AutoStableStringChars linearChars(cx);
if (!linearChars.initTwoByte(cx, text)) {
return false;
}
JS::SourceText<char16_t> srcBuf;
if (!srcBuf.initMaybeBorrowed(cx, linearChars)) {
return false;
}
RootedScript script(cx);
{
AutoRealm ar(cx, referent);
JS::CompileOptions compileOptions(cx);
compileOptions.lineno = startLine;
compileOptions.column = JS::ColumnNumberOneOrigin(startColumn);
if (!JS::StringHasLatin1Chars(url)) {
JS_ReportErrorASCII(cx, "URL must be a narrow string");
return false;
}
Vector<Latin1Char> urlChars(cx);
if (!CopyStringToVector(cx, url, urlChars)) {
return false;
}
compileOptions.setFile((const char*)urlChars.begin());
Vector<char16_t> sourceMapURLChars(cx);
if (sourceMapURL) {
if (!CopyStringToVector(cx, sourceMapURL, sourceMapURLChars)) {
return false;
}
compileOptions.setSourceMapURL(sourceMapURLChars.begin());
}
if (isScriptElement) {
// The introduction type must be a statically allocated string.
compileOptions.setIntroductionType("inlineScript");
}
AutoStableStringChars linearChars(cx);
if (!linearChars.initTwoByte(cx, text)) {
return false;
}
JS::SourceText<char16_t> srcBuf;
if (!srcBuf.initMaybeBorrowed(cx, linearChars)) {
return false;
}
script = JS::Compile(cx, compileOptions, srcBuf);
if (!script) {
return false;

View file

@ -1,2 +0,0 @@
const v3 = newGlobal({ newCompartment: true, discardSource: true });
Debugger().addDebuggee(v3).createSource(true);