Bug 1475228 - Make synchronous compile APIs take SourceBufferHolders exclusively r=jandem r=fitzgen
This commit is contained in:
@@ -487,8 +487,9 @@ XPCShellEnvironment::EvaluateString(const nsString& aString,
|
||||
JS::CompileOptions options(cx);
|
||||
options.setFileAndLine("typein", 0);
|
||||
JS::Rooted<JSScript*> script(cx);
|
||||
if (!JS_CompileUCScript(cx, aString.get(), aString.Length(), options,
|
||||
&script))
|
||||
JS::SourceBufferHolder srcBuf(aString.get(), aString.Length(),
|
||||
JS::SourceBufferHolder::NoOwnership);
|
||||
if (!JS_CompileUCScript(cx, srcBuf, options, &script))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user