Bug 1529298 - Consistently use "ArrayBuffer" instead of the vaguer "array buffer" in ArrayBuffer-related JSAPI descriptions. r=sfink
☠☠ backed out by eed1098d0d6c ☠ ☠
authorJeff Walden <jwalden@mit.edu>
Mon, 18 Feb 2019 22:52:42 -0800
changeset 460370 d80ce47bba5278fb6779bfa248d214c6da358ea8
parent 460369 deaa41ca96da55cb27d03ea2c60895a25474488a
child 460371 6cc3cd982953405eaa669248b103c5cc6b987d57
push id112082
push userjwalden@mit.edu
push dateFri, 22 Feb 2019 02:22:21 +0000
treeherdermozilla-inbound@d80b681a68e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1529298
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1529298 - Consistently use "ArrayBuffer" instead of the vaguer "array buffer" in ArrayBuffer-related JSAPI descriptions. r=sfink
js/src/jsapi.h
js/src/jsfriendapi.h
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -2016,54 +2016,54 @@ extern JS_PUBLIC_API bool IsSetObject(JS
 /**
  * Assign 'undefined' to all of the object's non-reserved slots. Note: this is
  * done for all slots, regardless of the associated property descriptor.
  */
 JS_PUBLIC_API void JS_SetAllNonReservedSlotsToUndefined(JSContext* cx,
                                                         JSObject* objArg);
 
 /**
- * Create a new array buffer with the given |contents|, which may be null only
+ * Create a new ArrayBuffer with the given |contents|, which may be null only
  * if |nbytes == 0|.  |contents| must be allocated compatible with deallocation
  * by |JS_free|.
  *
- * If and only if an array buffer is successfully created and returned,
- * ownership of |contents| is transferred to the new array buffer.
+ * If and only if an ArrayBuffer is successfully created and returned,
+ * ownership of |contents| is transferred to the new ArrayBuffer.
  */
 extern JS_PUBLIC_API JSObject* JS_NewArrayBufferWithContents(JSContext* cx,
                                                              size_t nbytes,
                                                              void* contents);
 
 namespace JS {
 
 using BufferContentsFreeFunc = void (*)(void* contents, void* userData);
 
 } /* namespace JS */
 
 /**
- * Create a new array buffer with the given contents. The contents must not be
+ * Create a new ArrayBuffer with the given contents. The contents must not be
  * modified by any other code, internal or external.
  *
- * When the array buffer is ready to be disposed of, `freeFunc(contents,
- * freeUserData)` will be called to release the array buffer's reference on the
+ * When the ArrayBuffer is ready to be disposed of, `freeFunc(contents,
+ * freeUserData)` will be called to release the ArrayBuffer's reference on the
  * contents.
  *
  * `freeFunc()` must not call any JSAPI functions that could cause a garbage
  * collection.
  *
  * The caller must keep the buffer alive until `freeFunc()` is called, or, if
  * `freeFunc` is null, until the JSRuntime is destroyed.
  *
  * The caller must not access the buffer on other threads. The JS engine will
  * not allow the buffer to be transferred to other threads. If you try to
  * transfer an external ArrayBuffer to another thread, the data is copied to a
  * new malloc buffer. `freeFunc()` must be threadsafe, and may be called from
  * any thread.
  *
- * This allows array buffers to be used with embedder objects that use reference
+ * This allows ArrayBuffers to be used with embedder objects that use reference
  * counting, for example. In that case the caller is responsible
  * for incrementing the reference count before passing the contents to this
  * function. This also allows using non-reference-counted contents that must be
  * freed with some function other than free().
  */
 extern JS_PUBLIC_API JSObject* JS_NewExternalArrayBuffer(
     JSContext* cx, size_t nbytes, void* contents,
     JS::BufferContentsFreeFunc freeFunc, void* freeUserData = nullptr);
@@ -2085,42 +2085,42 @@ extern JS_PUBLIC_API JSObject* JS_NewExt
  * Do not simply allow the returned buffer to be garbage-collected before
  * deallocating |contents|, because in general there is no way to know *when*
  * an object is fully garbage-collected to the point where this would be safe.
  */
 extern JS_PUBLIC_API JSObject* JS_NewArrayBufferWithUserOwnedContents(
     JSContext* cx, size_t nbytes, void* contents);
 
 /**
- * Steal the contents of the given array buffer. The array buffer has its
- * length set to 0 and its contents array cleared. The caller takes ownership
- * of the return value and must free it or transfer ownership via
+ * Steal the contents of the given ArrayBuffer. The ArrayBuffer has its length
+ * set to 0 and its contents array cleared. The caller takes ownership of the
+ * return value and must free it or transfer ownership via
  * JS_NewArrayBufferWithContents when done using it.
  */
 extern JS_PUBLIC_API void* JS_StealArrayBufferContents(JSContext* cx,
                                                        JS::HandleObject obj);
 
 /**
- * Create a new mapped array buffer with the given memory mapped contents. It
+ * Create a new mapped ArrayBuffer with the given memory mapped contents. It
  * must be legal to free the contents pointer by unmapping it. On success,
- * ownership is transferred to the new mapped array buffer.
+ * ownership is transferred to the new mapped ArrayBuffer.
  */
 extern JS_PUBLIC_API JSObject* JS_NewMappedArrayBufferWithContents(
     JSContext* cx, size_t nbytes, void* contents);
 
 /**
- * Create memory mapped array buffer contents.
+ * Create memory mapped ArrayBuffer contents.
  * Caller must take care of closing fd after calling this function.
  */
 extern JS_PUBLIC_API void* JS_CreateMappedArrayBufferContents(int fd,
                                                               size_t offset,
                                                               size_t length);
 
 /**
- * Release the allocated resource of mapped array buffer contents before the
+ * Release the allocated resource of mapped ArrayBuffer contents before the
  * object is created.
  * If a new object has been created by JS_NewMappedArrayBufferWithContents()
  * with this content, then JS_DetachArrayBuffer() should be used instead to
  * release the resource used by the object.
  */
 extern JS_PUBLIC_API void JS_ReleaseMappedArrayBufferContents(void* contents,
                                                               size_t length);
 
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -1789,17 +1789,17 @@ extern JS_FRIEND_API js::Scalar::Type JS
  * unwrapping. If this test succeeds, then it is safe to call the various
  * accessor JSAPI calls defined below.
  */
 extern JS_FRIEND_API bool JS_IsArrayBufferObject(JSObject* obj);
 
 extern JS_FRIEND_API bool JS_IsSharedArrayBufferObject(JSObject* obj);
 
 /**
- * Return the available byte length of an array buffer.
+ * Return the available byte length of an ArrayBuffer.
  *
  * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known
  * that it would pass such a test: it is an ArrayBuffer or a wrapper of an
  * ArrayBuffer, and the unwrapping will succeed.
  */
 extern JS_FRIEND_API uint32_t JS_GetArrayBufferByteLength(JSObject* obj);
 
 extern JS_FRIEND_API uint32_t JS_GetSharedArrayBufferByteLength(JSObject* obj);
@@ -1844,17 +1844,17 @@ extern JS_FRIEND_API bool JS_IsMappedArr
  *
  * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow
  * be known that it would pass such a test: it is a typed array or a wrapper of
  * a typed array, and the unwrapping will succeed.
  */
 extern JS_FRIEND_API uint32_t JS_GetTypedArrayLength(JSObject* obj);
 
 /**
- * Return the byte offset from the start of an array buffer to the start of a
+ * Return the byte offset from the start of an ArrayBuffer to the start of a
  * typed array view.
  *
  * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow
  * be known that it would pass such a test: it is a typed array or a wrapper of
  * a typed array, and the unwrapping will succeed.
  */
 extern JS_FRIEND_API uint32_t JS_GetTypedArrayByteOffset(JSObject* obj);