summaryrefslogtreecommitdiff
path: root/js/src/jsapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsapi.h')
-rw-r--r--js/src/jsapi.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index 19a0b805d2..df9294b418 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -129,14 +129,14 @@ class MOZ_RAII AutoVectorRooterBase : protected AutoGCRooter
size_t length() const { return vector.length(); }
bool empty() const { return vector.empty(); }
- MOZ_MUST_USE bool append(const T& v) { return vector.append(v); }
- MOZ_MUST_USE bool appendN(const T& v, size_t len) { return vector.appendN(v, len); }
- MOZ_MUST_USE bool append(const T* ptr, size_t len) { return vector.append(ptr, len); }
- MOZ_MUST_USE bool appendAll(const AutoVectorRooterBase<T>& other) {
+ [[nodiscard]] bool append(const T& v) { return vector.append(v); }
+ [[nodiscard]] bool appendN(const T& v, size_t len) { return vector.appendN(v, len); }
+ [[nodiscard]] bool append(const T* ptr, size_t len) { return vector.append(ptr, len); }
+ [[nodiscard]] bool appendAll(const AutoVectorRooterBase<T>& other) {
return vector.appendAll(other.vector);
}
- MOZ_MUST_USE bool insert(T* p, const T& val) { return vector.insert(p, val); }
+ [[nodiscard]] bool insert(T* p, const T& val) { return vector.insert(p, val); }
/* For use when space has already been reserved. */
void infallibleAppend(const T& v) { vector.infallibleAppend(v); }
@@ -144,7 +144,7 @@ class MOZ_RAII AutoVectorRooterBase : protected AutoGCRooter
void popBack() { vector.popBack(); }
T popCopy() { return vector.popCopy(); }
- MOZ_MUST_USE bool growBy(size_t inc) {
+ [[nodiscard]] bool growBy(size_t inc) {
size_t oldLength = vector.length();
if (!vector.growByUninitialized(inc))
return false;
@@ -152,7 +152,7 @@ class MOZ_RAII AutoVectorRooterBase : protected AutoGCRooter
return true;
}
- MOZ_MUST_USE bool resize(size_t newLength) {
+ [[nodiscard]] bool resize(size_t newLength) {
size_t oldLength = vector.length();
if (newLength <= oldLength) {
vector.shrinkBy(oldLength - newLength);
@@ -166,7 +166,7 @@ class MOZ_RAII AutoVectorRooterBase : protected AutoGCRooter
void clear() { vector.clear(); }
- MOZ_MUST_USE bool reserve(size_t newLength) {
+ [[nodiscard]] bool reserve(size_t newLength) {
return vector.reserve(newLength);
}
@@ -5950,7 +5950,7 @@ class JS_PUBLIC_API(AutoSaveExceptionState)
* This is not the same stack as `e.stack` when `e` is an `Error` object. (That
* would be JS::ExceptionStackOrNull).
*/
-MOZ_MUST_USE JS_PUBLIC_API(JSObject*)
+[[nodiscard]] JS_PUBLIC_API(JSObject*)
GetPendingExceptionStack(JSContext* cx);
} /* namespace JS */