diff --git a/caps/nsScriptSecurityManager.cpp b/caps/nsScriptSecurityManager.cpp index bf0899abcb2f..84703d482503 100644 --- a/caps/nsScriptSecurityManager.cpp +++ b/caps/nsScriptSecurityManager.cpp @@ -531,8 +531,8 @@ bool nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction( if (reportViolation) { JS::AutoFilename scriptFilename; nsAutoString fileName; - unsigned lineNum = 0; - unsigned columnNum = 0; + uint32_t lineNum = 0; + uint32_t columnNum = 0; if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum, &columnNum)) { if (const char* file = scriptFilename.get()) { CopyUTF8toUTF16(nsDependentCString(file), fileName); diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index d4f450b79ada..58451e7262d5 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -5045,14 +5045,14 @@ nsGlobalWindowInner::ShowSlowScriptDialog(JSContext* aCx, // Check if we should offer the option to debug JS::AutoFilename filename; - unsigned lineno; + uint32_t lineno; // Computing the line number can be very expensive (see bug 1330231 for // example), and we don't use the line number anywhere except than in the // parent process, so we avoid computing it elsewhere. This gives us most of // the wins we are interested in, since the source of the slowness here is // minified scripts which is more common in Web content that is loaded in the // content process. - unsigned* linenop = XRE_IsParentProcess() ? &lineno : nullptr; + uint32_t* linenop = XRE_IsParentProcess() ? &lineno : nullptr; bool hasFrame = JS::DescribeScriptedCaller(aCx, &filename, linenop); // Record the slow script event if we haven't done so already for this inner diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index 6e0ac3c0e550..660bf6a75208 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -1027,8 +1027,8 @@ nsresult EventListenerManager::SetEventHandler(nsAtom* aName, // Perform CSP check nsCOMPtr csp = doc->GetCsp(); - unsigned lineNum = 0; - unsigned columnNum = 0; + uint32_t lineNum = 0; + uint32_t columnNum = 0; JSContext* cx = nsContentUtils::GetCurrentJSContext(); if (cx && !JS::DescribeScriptedCaller(cx, nullptr, &lineNum, &columnNum)) { diff --git a/dom/system/IOUtils.cpp b/dom/system/IOUtils.cpp index 1942a68d8f1e..b6b8191ece48 100644 --- a/dom/system/IOUtils.cpp +++ b/dom/system/IOUtils.cpp @@ -289,8 +289,8 @@ static bool AssertParentProcessWithCallerLocationImpl(GlobalObject& aGlobal, JSContext* cx = jsapi.cx(); JS::AutoFilename scriptFilename; - unsigned lineNo = 0; - unsigned colNo = 0; + uint32_t lineNo = 0; + uint32_t colNo = 0; NS_ENSURE_TRUE( JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNo, &colNo), false); diff --git a/dom/websocket/WebSocket.cpp b/dom/websocket/WebSocket.cpp index 40d45d79079b..4e0fd892af5e 100644 --- a/dom/websocket/WebSocket.cpp +++ b/dom/websocket/WebSocket.cpp @@ -1371,7 +1371,7 @@ already_AddRefed WebSocket::ConstructorCommon( WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); - unsigned lineno, column; + uint32_t lineno, column; JS::AutoFilename file; if (!JS::DescribeScriptedCaller(aGlobal.Context(), &file, &lineno, &column)) { @@ -1608,7 +1608,7 @@ nsresult WebSocketImpl::Init(JSContext* aCx, bool aIsSecure, } else { MOZ_ASSERT(aCx); - unsigned lineno, column; + uint32_t lineno, column; JS::AutoFilename file; if (JS::DescribeScriptedCaller(aCx, &file, &lineno, &column)) { mScriptFile = file.get(); diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp index b642363365a0..bbfd949b0945 100644 --- a/js/src/builtin/Eval.cpp +++ b/js/src/builtin/Eval.cpp @@ -276,7 +276,7 @@ static bool EvalKernel(JSContext* cx, HandleValue v, EvalType evalType, if (!esg.foundScript()) { RootedScript maybeScript(cx); - unsigned lineno; + uint32_t lineno; const char* filename; bool mutedErrors; uint32_t pcOffset; diff --git a/js/src/builtin/ShadowRealm.cpp b/js/src/builtin/ShadowRealm.cpp index 555cbab03653..516f0716c3ba 100644 --- a/js/src/builtin/ShadowRealm.cpp +++ b/js/src/builtin/ShadowRealm.cpp @@ -232,7 +232,7 @@ static bool PerformShadowRealmEval(JSContext* cx, Handle sourceText, // https://bugzilla.mozilla.org/show_bug.cgi?id=1770017 RootedScript callerScript(cx); const char* filename; - unsigned lineno; + uint32_t lineno; uint32_t pcOffset; bool mutedErrors; DescribeScriptedCallerForCompilation(cx, &callerScript, &filename, &lineno, @@ -419,7 +419,7 @@ static JSObject* ShadowRealmImportValue(JSContext* cx, // Not Speced: Get referencing private to pass to importHook. RootedScript script(cx); const char* filename; - unsigned lineno; + uint32_t lineno; uint32_t pcOffset; bool mutedErrors; DescribeScriptedCallerForCompilation(cx, &script, &filename, &lineno, diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 7a28f137ccbb..28a382aa76f8 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -6661,7 +6661,7 @@ static bool EvalReturningScope(JSContext* cx, unsigned argc, Value* vp) { } JS::AutoFilename filename; - unsigned lineno; + uint32_t lineno; JS::DescribeScriptedCaller(cx, &filename, &lineno); diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 75b2010f4ed1..26dfc2dac41b 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -2462,7 +2462,7 @@ CompileOptions& CompileOptions::setIntroductionInfoToCaller( MutableHandle introductionScript) { RootedScript maybeScript(cx); const char* filename; - unsigned lineno; + uint32_t lineno; uint32_t pcOffset; bool mutedErrors; DescribeScriptedCallerForCompilation(cx, &maybeScript, &filename, &lineno, @@ -4524,7 +4524,7 @@ const char* AutoFilename::get() const { } JS_PUBLIC_API bool DescribeScriptedCaller(JSContext* cx, AutoFilename* filename, - unsigned* lineno, unsigned* column) { + uint32_t* lineno, uint32_t* column) { if (filename) { filename->reset(); } diff --git a/js/src/jsapi.h b/js/src/jsapi.h index e914dc7be56d..05cb8258843f 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -933,8 +933,8 @@ class MOZ_RAII JS_PUBLIC_API AutoFilename { * record, this will also return false. */ extern JS_PUBLIC_API bool DescribeScriptedCaller( - JSContext* cx, AutoFilename* filename = nullptr, unsigned* lineno = nullptr, - unsigned* column = nullptr); + JSContext* cx, AutoFilename* filename = nullptr, uint32_t* lineno = nullptr, + uint32_t* column = nullptr); extern JS_PUBLIC_API JSObject* GetScriptedCallerGlobal(JSContext* cx); diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 019617c2e5dd..476711c12e42 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -4144,7 +4144,7 @@ static bool EvalInContext(JSContext* cx, unsigned argc, Value* vp) { } JS::AutoFilename filename; - unsigned lineno; + uint32_t lineno; DescribeScriptedCaller(cx, &filename, &lineno); { diff --git a/js/src/vm/JSFunction.cpp b/js/src/vm/JSFunction.cpp index 3fe760a7c399..0f0317397a18 100644 --- a/js/src/vm/JSFunction.cpp +++ b/js/src/vm/JSFunction.cpp @@ -1192,7 +1192,7 @@ static bool CreateDynamicFunction(JSContext* cx, const CallArgs& args, RootedScript maybeScript(cx); const char* filename; - unsigned lineno; + uint32_t lineno; bool mutedErrors; uint32_t pcOffset; DescribeScriptedCallerForCompilation(cx, &maybeScript, &filename, &lineno, diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp index 628c1c9e6b92..2536673ce8d1 100644 --- a/js/src/vm/JSScript.cpp +++ b/js/src/vm/JSScript.cpp @@ -1872,7 +1872,7 @@ template bool ScriptSource::initializeUnretrievableUncompressedSource( // For example: // foo.js line 7 > eval // indicating code compiled by the call to 'eval' on line 7 of foo.js. -UniqueChars js::FormatIntroducedFilename(const char* filename, unsigned lineno, +UniqueChars js::FormatIntroducedFilename(const char* filename, uint32_t lineno, const char* introducer) { // Compute the length of the string in advance, so we can allocate a // buffer of the right size on the first shot. @@ -2844,7 +2844,7 @@ void js::maybeSpewScriptFinalWarmUpCount(JSScript* script) { void js::DescribeScriptedCallerForDirectEval(JSContext* cx, HandleScript script, jsbytecode* pc, const char** file, - unsigned* linenop, + uint32_t* linenop, uint32_t* pcOffset, bool* mutedErrors) { MOZ_ASSERT(script->containsPC(pc)); @@ -2872,7 +2872,7 @@ void js::DescribeScriptedCallerForDirectEval(JSContext* cx, HandleScript script, void js::DescribeScriptedCallerForCompilation( JSContext* cx, MutableHandleScript maybeScript, const char** file, - unsigned* linenop, uint32_t* pcOffset, bool* mutedErrors) { + uint32_t* linenop, uint32_t* pcOffset, bool* mutedErrors) { NonBuiltinFrameIter iter(cx, cx->realm()->principals()); if (iter.done()) { diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index 0b757d33f40e..82707ecd56c8 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -2209,7 +2209,7 @@ struct ScriptAndCounts { }; extern JS::UniqueChars FormatIntroducedFilename(const char* filename, - unsigned lineno, + uint32_t lineno, const char* introducer); struct GSNCache; @@ -2250,7 +2250,7 @@ extern unsigned PCToLineNumber( */ extern void DescribeScriptedCallerForCompilation( JSContext* cx, MutableHandleScript maybeScript, const char** file, - unsigned* linenop, uint32_t* pcOffset, bool* mutedErrors); + uint32_t* linenop, uint32_t* pcOffset, bool* mutedErrors); /* * Like DescribeScriptedCallerForCompilation, but this function avoids looking @@ -2258,7 +2258,7 @@ extern void DescribeScriptedCallerForCompilation( */ extern void DescribeScriptedCallerForDirectEval( JSContext* cx, HandleScript script, jsbytecode* pc, const char** file, - unsigned* linenop, uint32_t* pcOffset, bool* mutedErrors); + uint32_t* linenop, uint32_t* pcOffset, bool* mutedErrors); bool CheckCompileOptionsMatch(const JS::ReadOnlyCompileOptions& options, js::ImmutableScriptFlags flags); diff --git a/js/src/wasm/WasmCompileArgs.h b/js/src/wasm/WasmCompileArgs.h index 8d738ccd80a3..89499ecbb911 100644 --- a/js/src/wasm/WasmCompileArgs.h +++ b/js/src/wasm/WasmCompileArgs.h @@ -111,7 +111,7 @@ struct FeatureArgs { struct ScriptedCaller { UniqueChars filename; // UTF-8 encoded bool filenameIsURL; - unsigned line; + uint32_t line; ScriptedCaller() : filenameIsURL(false), line(0) {} }; diff --git a/js/src/wasm/WasmJS.cpp b/js/src/wasm/WasmJS.cpp index c7700c08bd4c..abb28dd5207c 100644 --- a/js/src/wasm/WasmJS.cpp +++ b/js/src/wasm/WasmJS.cpp @@ -4208,7 +4208,7 @@ static bool Reject(JSContext* cx, const CompileArgs& args, return false; } - unsigned line = args.scriptedCaller.line; + uint32_t line = args.scriptedCaller.line; // Ideally we'd report a JSMSG_WASM_COMPILE_ERROR here, but there's no easy // way to create an ErrorObject for an arbitrary error code with multiple diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index 53cf7b4ee035..0d5e91eee756 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -217,7 +217,7 @@ bool ReportWrapperDenial(JSContext* cx, HandleId id, WrapperDenialType type, return false; } AutoFilename filename; - unsigned line = 0, column = 0; + uint32_t line = 0, column = 0; DescribeScriptedCaller(cx, &filename, &line, &column); // Warn to the terminal for the logs.