Loading ipc/testshell/XPCShellEnvironment.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -259,9 +259,7 @@ void XPCShellEnvironment::ProcessFile(JSContext* cx, const char* filename, * It's not interactive - just execute it. * * Support the UNIX #! shell hack; gobble the first line if it starts * with '#'. TODO - this isn't quite compatible with sharp variables, * as a legal js program (using sharp variables) might start with '#'. * But that would require multi-character lookahead. * with '#'. */ int ch = fgetc(file); if (ch == '#') { Loading js/public/CompileOptions.h +2 −2 Original line number Diff line number Diff line Loading @@ -233,8 +233,8 @@ class JS_PUBLIC_API TransitiveCompileOptions { bool deoptimizeModuleGlobalVars = false; /** * |introductionType| is a statically allocated C string: one of "eval", * "Function", or "GeneratorFunction". * |introductionType| is a statically allocated C string. See JSScript.h * for more information. */ const char* introductionType = nullptr; Loading js/src/builtin/TestingFunctions.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -4173,6 +4173,11 @@ static bool DumpHeap(JSContext* cx, unsigned argc, Value* vp) { CallArgs args = CallArgsFromVp(argc, vp); FILE* dumpFile = stdout; auto closeFile = mozilla::MakeScopeExit([&dumpFile] { if (dumpFile != stdout) { fclose(dumpFile); } }); if (args.length() > 1) { RootedObject callee(cx, &args.callee()); Loading Loading @@ -4204,10 +4209,6 @@ static bool DumpHeap(JSContext* cx, unsigned argc, Value* vp) { js::DumpHeap(cx, dumpFile, js::IgnoreNurseryObjects); if (dumpFile != stdout) { fclose(dumpFile); } args.rval().setUndefined(); return true; } Loading js/src/ctypes/Library.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -177,13 +177,12 @@ JSObject* Library::Create(JSContext* cx, HandleValue path, PRLibrary* library = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW); if (!library) { #define MAX_ERROR_LEN 1024 char error[MAX_ERROR_LEN] = "Cannot get error from NSPR."; constexpr size_t MaxErrorLength = 1024; char error[MaxErrorLength] = "Cannot get error from NSPR."; uint32_t errorLen = PR_GetErrorTextLength(); if (errorLen && errorLen < MAX_ERROR_LEN) { if (errorLen && errorLen < MaxErrorLength) { PR_GetErrorText(error); } #undef MAX_ERROR_LEN if (JS::StringIsASCII(error)) { if (JS::UniqueChars pathCharsUTF8 = JS_EncodeStringToUTF8(cx, pathStr)) { Loading js/src/vm/JSScript.h +2 −0 Original line number Diff line number Diff line Loading @@ -583,6 +583,8 @@ class ScriptSource { // A string indicating how this source code was introduced into the system. // This is a constant, statically allocated C string, so does not need memory // management. // // TODO: Document the various additional introduction type constants. const char* introductionType_ = nullptr; // Bytecode offset in caller script that generated this code. This is Loading Loading
ipc/testshell/XPCShellEnvironment.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -259,9 +259,7 @@ void XPCShellEnvironment::ProcessFile(JSContext* cx, const char* filename, * It's not interactive - just execute it. * * Support the UNIX #! shell hack; gobble the first line if it starts * with '#'. TODO - this isn't quite compatible with sharp variables, * as a legal js program (using sharp variables) might start with '#'. * But that would require multi-character lookahead. * with '#'. */ int ch = fgetc(file); if (ch == '#') { Loading
js/public/CompileOptions.h +2 −2 Original line number Diff line number Diff line Loading @@ -233,8 +233,8 @@ class JS_PUBLIC_API TransitiveCompileOptions { bool deoptimizeModuleGlobalVars = false; /** * |introductionType| is a statically allocated C string: one of "eval", * "Function", or "GeneratorFunction". * |introductionType| is a statically allocated C string. See JSScript.h * for more information. */ const char* introductionType = nullptr; Loading
js/src/builtin/TestingFunctions.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -4173,6 +4173,11 @@ static bool DumpHeap(JSContext* cx, unsigned argc, Value* vp) { CallArgs args = CallArgsFromVp(argc, vp); FILE* dumpFile = stdout; auto closeFile = mozilla::MakeScopeExit([&dumpFile] { if (dumpFile != stdout) { fclose(dumpFile); } }); if (args.length() > 1) { RootedObject callee(cx, &args.callee()); Loading Loading @@ -4204,10 +4209,6 @@ static bool DumpHeap(JSContext* cx, unsigned argc, Value* vp) { js::DumpHeap(cx, dumpFile, js::IgnoreNurseryObjects); if (dumpFile != stdout) { fclose(dumpFile); } args.rval().setUndefined(); return true; } Loading
js/src/ctypes/Library.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -177,13 +177,12 @@ JSObject* Library::Create(JSContext* cx, HandleValue path, PRLibrary* library = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW); if (!library) { #define MAX_ERROR_LEN 1024 char error[MAX_ERROR_LEN] = "Cannot get error from NSPR."; constexpr size_t MaxErrorLength = 1024; char error[MaxErrorLength] = "Cannot get error from NSPR."; uint32_t errorLen = PR_GetErrorTextLength(); if (errorLen && errorLen < MAX_ERROR_LEN) { if (errorLen && errorLen < MaxErrorLength) { PR_GetErrorText(error); } #undef MAX_ERROR_LEN if (JS::StringIsASCII(error)) { if (JS::UniqueChars pathCharsUTF8 = JS_EncodeStringToUTF8(cx, pathStr)) { Loading
js/src/vm/JSScript.h +2 −0 Original line number Diff line number Diff line Loading @@ -583,6 +583,8 @@ class ScriptSource { // A string indicating how this source code was introduced into the system. // This is a constant, statically allocated C string, so does not need memory // management. // // TODO: Document the various additional introduction type constants. const char* introductionType_ = nullptr; // Bytecode offset in caller script that generated this code. This is Loading