Bug 1847469 - Part 17: Use uint32_t for line and column in JSErrorBase as a preparation to use column number types. r=iain

Differential Revision: https://phabricator.services.mozilla.com/D185755
This commit is contained in:
Tooru Fujisawa 2023-08-16 17:31:40 +00:00
Родитель a2d07d6d6a
Коммит 0c8fbd6b62
2 изменённых файлов: 24 добавлений и 24 удалений

Просмотреть файл

@ -118,10 +118,10 @@ class JSErrorBase {
unsigned sourceId;
// Source line number (1-origin).
unsigned lineno;
uint32_t lineno;
// Column number in line in UTF-16 code units (1-origin).
unsigned column;
uint32_t column;
// the error number, e.g. see js/public/friend/ErrorNumbers.msg.
unsigned errorNumber;
@ -195,7 +195,7 @@ class JSErrorNotes {
js::Vector<js::UniquePtr<Note>, 1, js::SystemAllocPolicy> notes_;
bool addNoteVA(js::FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno, unsigned column,
unsigned sourceId, uint32_t lineno, uint32_t column,
JSErrorCallback errorCallback, void* userRef,
const unsigned errorNumber,
js::ErrorArgumentsType argumentsType, va_list ap);
@ -207,27 +207,27 @@ class JSErrorNotes {
// Add a note to the given position.
// column is 1-origin.
bool addNoteASCII(JSContext* cx, const char* filename, unsigned sourceId,
unsigned lineno, unsigned column,
uint32_t lineno, uint32_t column,
JSErrorCallback errorCallback, void* userRef,
const unsigned errorNumber, ...);
bool addNoteASCII(js::FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno, unsigned column,
unsigned sourceId, uint32_t lineno, uint32_t column,
JSErrorCallback errorCallback, void* userRef,
const unsigned errorNumber, ...);
bool addNoteLatin1(JSContext* cx, const char* filename, unsigned sourceId,
unsigned lineno, unsigned column,
uint32_t lineno, uint32_t column,
JSErrorCallback errorCallback, void* userRef,
const unsigned errorNumber, ...);
bool addNoteLatin1(js::FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno, unsigned column,
unsigned sourceId, uint32_t lineno, uint32_t column,
JSErrorCallback errorCallback, void* userRef,
const unsigned errorNumber, ...);
bool addNoteUTF8(JSContext* cx, const char* filename, unsigned sourceId,
unsigned lineno, unsigned column,
uint32_t lineno, uint32_t column,
JSErrorCallback errorCallback, void* userRef,
const unsigned errorNumber, ...);
bool addNoteUTF8(js::FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno, unsigned column,
unsigned sourceId, uint32_t lineno, uint32_t column,
JSErrorCallback errorCallback, void* userRef,
const unsigned errorNumber, ...);

Просмотреть файл

@ -3936,7 +3936,7 @@ JSErrorNotes::~JSErrorNotes() = default;
// column is 1-origin.
static UniquePtr<JSErrorNotes::Note> CreateErrorNoteVA(
FrontendContext* fc, const char* filename, unsigned sourceId,
unsigned lineno, unsigned column, JSErrorCallback errorCallback,
uint32_t lineno, uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber, ErrorArgumentsType argumentsType,
va_list ap) {
auto note = MakeUnique<JSErrorNotes::Note>();
@ -3960,8 +3960,8 @@ static UniquePtr<JSErrorNotes::Note> CreateErrorNoteVA(
}
bool JSErrorNotes::addNoteVA(FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno,
unsigned column, JSErrorCallback errorCallback,
unsigned sourceId, uint32_t lineno,
uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber,
ErrorArgumentsType argumentsType, va_list ap) {
auto note =
@ -3979,8 +3979,8 @@ bool JSErrorNotes::addNoteVA(FrontendContext* fc, const char* filename,
}
bool JSErrorNotes::addNoteASCII(JSContext* cx, const char* filename,
unsigned sourceId, unsigned lineno,
unsigned column, JSErrorCallback errorCallback,
unsigned sourceId, uint32_t lineno,
uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber,
...) {
AutoReportFrontendContext fc(cx);
@ -3993,8 +3993,8 @@ bool JSErrorNotes::addNoteASCII(JSContext* cx, const char* filename,
}
bool JSErrorNotes::addNoteASCII(FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno,
unsigned column, JSErrorCallback errorCallback,
unsigned sourceId, uint32_t lineno,
uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber,
...) {
va_list ap;
@ -4006,8 +4006,8 @@ bool JSErrorNotes::addNoteASCII(FrontendContext* fc, const char* filename,
}
bool JSErrorNotes::addNoteLatin1(JSContext* cx, const char* filename,
unsigned sourceId, unsigned lineno,
unsigned column, JSErrorCallback errorCallback,
unsigned sourceId, uint32_t lineno,
uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber,
...) {
AutoReportFrontendContext fc(cx);
@ -4020,8 +4020,8 @@ bool JSErrorNotes::addNoteLatin1(JSContext* cx, const char* filename,
}
bool JSErrorNotes::addNoteLatin1(FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno,
unsigned column, JSErrorCallback errorCallback,
unsigned sourceId, uint32_t lineno,
uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber,
...) {
va_list ap;
@ -4033,8 +4033,8 @@ bool JSErrorNotes::addNoteLatin1(FrontendContext* fc, const char* filename,
}
bool JSErrorNotes::addNoteUTF8(JSContext* cx, const char* filename,
unsigned sourceId, unsigned lineno,
unsigned column, JSErrorCallback errorCallback,
unsigned sourceId, uint32_t lineno,
uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber, ...) {
AutoReportFrontendContext fc(cx);
va_list ap;
@ -4046,8 +4046,8 @@ bool JSErrorNotes::addNoteUTF8(JSContext* cx, const char* filename,
}
bool JSErrorNotes::addNoteUTF8(FrontendContext* fc, const char* filename,
unsigned sourceId, unsigned lineno,
unsigned column, JSErrorCallback errorCallback,
unsigned sourceId, uint32_t lineno,
uint32_t column, JSErrorCallback errorCallback,
void* userRef, const unsigned errorNumber, ...) {
va_list ap;
va_start(ap, errorNumber);