|
16 | 16 | #include "jsfriendapi.h" |
17 | 17 | #include "js/CompilationAndEvaluation.h" |
18 | 18 | #include "js/OffThreadScriptCompilation.h" |
19 | | -#include "js/SourceBufferHolder.h" |
| 19 | +#include "js/SourceText.h" |
20 | 20 | #include "nsIScriptContext.h" |
21 | 21 | #include "nsIScriptElement.h" |
22 | 22 | #include "nsIScriptGlobalObject.h" |
@@ -98,9 +98,9 @@ nsJSUtils::CompileFunction(AutoJSAPI& jsapi, |
98 | 98 | // Compile. |
99 | 99 | const nsPromiseFlatString& flatBody = PromiseFlatString(aBody); |
100 | 100 |
|
101 | | - JS::SourceBufferHolder source; |
| 101 | + JS::SourceText<char16_t> source; |
102 | 102 | if (!source.init(cx, flatBody.get(), flatBody.Length(), |
103 | | - JS::SourceBufferHolder::NoOwnership)) |
| 103 | + JS::SourceOwnership::Borrowed)) |
104 | 104 | { |
105 | 105 | return NS_ERROR_FAILURE; |
106 | 106 | } |
@@ -224,7 +224,7 @@ nsJSUtils::ExecutionContext::JoinAndExec(JS::OffThreadToken** aOffThreadToken, |
224 | 224 |
|
225 | 225 | nsresult |
226 | 226 | nsJSUtils::ExecutionContext::CompileAndExec(JS::CompileOptions& aCompileOptions, |
227 | | - JS::SourceBufferHolder& aSrcBuf, |
| 227 | + JS::SourceText<char16_t>& aSrcBuf, |
228 | 228 | JS::MutableHandle<JSScript*> aScript) |
229 | 229 | { |
230 | 230 | if (mSkip) { |
@@ -277,9 +277,9 @@ nsJSUtils::ExecutionContext::CompileAndExec(JS::CompileOptions& aCompileOptions, |
277 | 277 | } |
278 | 278 |
|
279 | 279 | const nsPromiseFlatString& flatScript = PromiseFlatString(aScript); |
280 | | - JS::SourceBufferHolder srcBuf; |
| 280 | + JS::SourceText<char16_t> srcBuf; |
281 | 281 | if (!srcBuf.init(mCx, flatScript.get(), flatScript.Length(), |
282 | | - JS::SourceBufferHolder::NoOwnership)) |
| 282 | + JS::SourceOwnership::Borrowed)) |
283 | 283 | { |
284 | 284 | mSkip = true; |
285 | 285 | mRv = EvaluationExceptionToNSResult(mCx); |
@@ -487,7 +487,7 @@ nsJSUtils::ExecutionContext::ExtractReturnValue(JS::MutableHandle<JS::Value> aRe |
487 | 487 |
|
488 | 488 | nsresult |
489 | 489 | nsJSUtils::CompileModule(JSContext* aCx, |
490 | | - JS::SourceBufferHolder& aSrcBuf, |
| 490 | + JS::SourceText<char16_t>& aSrcBuf, |
491 | 491 | JS::Handle<JSObject*> aEvaluationGlobal, |
492 | 492 | JS::CompileOptions &aCompileOptions, |
493 | 493 | JS::MutableHandle<JSObject*> aModule) |
|
0 commit comments