Bug 1582348 - Don't name WritableStreamDefaultWriter functions as WritableStream_* 'cause this copypasta happenstance is nonsensical (and might someday break scumbag unified builds). r=arai
authorJeff Walden <jwalden@mit.edu>
Thu, 07 Nov 2019 00:19:34 +0000
changeset 501029 eadda7d0287cc25ef6d5eb332a98b0d7b6142eee
parent 501028 def5ec4549e70a978fd588a1fc300d0b73b3285b
child 501030 875c829c57ceb711fbd0f6ed36613cff83380fb1
push id99940
push userjwalden@mit.edu
push dateThu, 07 Nov 2019 00:41:19 +0000
treeherderautoland@8caeb3eb603c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1582348
milestone72.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 1582348 - Don't name WritableStreamDefaultWriter functions as WritableStream_* 'cause this copypasta happenstance is nonsensical (and might someday break scumbag unified builds). r=arai Differential Revision: https://phabricator.services.mozilla.com/D51964
js/src/builtin/streams/WritableStreamDefaultWriter.cpp
--- a/js/src/builtin/streams/WritableStreamDefaultWriter.cpp
+++ b/js/src/builtin/streams/WritableStreamDefaultWriter.cpp
@@ -255,18 +255,19 @@ bool WritableStreamDefaultWriter::constr
 
   args.rval().setObject(*writer);
   return true;
 }
 
 /**
  * Streams spec, 4.5.4.1. get closed
  */
-static MOZ_MUST_USE bool WritableStream_closed(JSContext* cx, unsigned argc,
-                                               Value* vp) {
+static MOZ_MUST_USE bool WritableStreamDefaultWriter_closed(JSContext* cx,
+                                                            unsigned argc,
+                                                            Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise
   //         rejected with a TypeError exception.
   Rooted<WritableStreamDefaultWriter*> unwrappedWriter(
       cx, UnwrapAndTypeCheckThis<WritableStreamDefaultWriter>(cx, args,
                                                               "get closed"));
   if (!unwrappedWriter) {
@@ -281,18 +282,19 @@ static MOZ_MUST_USE bool WritableStream_
 
   args.rval().setObject(*closedPromise);
   return true;
 }
 
 /**
  * Streams spec, 4.5.4.2. get desiredSize
  */
-static MOZ_MUST_USE bool WritableStream_desiredSize(JSContext* cx,
-                                                    unsigned argc, Value* vp) {
+static MOZ_MUST_USE bool WritableStreamDefaultWriter_desiredSize(JSContext* cx,
+                                                                 unsigned argc,
+                                                                 Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, throw a
   //         TypeError exception.
   Rooted<WritableStreamDefaultWriter*> unwrappedWriter(
       cx, UnwrapAndTypeCheckThis<WritableStreamDefaultWriter>(
               cx, args, "get desiredSize"));
   if (!unwrappedWriter) {
@@ -317,18 +319,19 @@ static MOZ_MUST_USE bool WritableStream_
   MOZ_ASSERT(args.rval().isNull() || args.rval().isNumber(),
              "expected a type that'll never require wrapping");
   return true;
 }
 
 /**
  * Streams spec, 4.5.4.3. get ready
  */
-static MOZ_MUST_USE bool WritableStream_ready(JSContext* cx, unsigned argc,
-                                              Value* vp) {
+static MOZ_MUST_USE bool WritableStreamDefaultWriter_ready(JSContext* cx,
+                                                           unsigned argc,
+                                                           Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise
   //         rejected with a TypeError exception.
   Rooted<WritableStreamDefaultWriter*> unwrappedWriter(
       cx, UnwrapAndTypeCheckThis<WritableStreamDefaultWriter>(cx, args,
                                                               "get ready"));
   if (!unwrappedWriter) {
@@ -343,18 +346,19 @@ static MOZ_MUST_USE bool WritableStream_
 
   args.rval().setObject(*readyPromise);
   return true;
 }
 
 /**
  * Streams spec, 4.5.4.4. abort(reason)
  */
-static MOZ_MUST_USE bool WritableStream_abort(JSContext* cx, unsigned argc,
-                                              Value* vp) {
+static MOZ_MUST_USE bool WritableStreamDefaultWriter_abort(JSContext* cx,
+                                                           unsigned argc,
+                                                           Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise
   //         rejected with a TypeError exception.
   Rooted<WritableStreamDefaultWriter*> unwrappedWriter(
       cx,
       UnwrapAndTypeCheckThis<WritableStreamDefaultWriter>(cx, args, "abort"));
   if (!unwrappedWriter) {
@@ -379,18 +383,19 @@ static MOZ_MUST_USE bool WritableStream_
 
   args.rval().setObject(*promise);
   return true;
 }
 
 /**
  * Streams spec, 4.5.4.5. close()
  */
-static MOZ_MUST_USE bool WritableStream_close(JSContext* cx, unsigned argc,
-                                              Value* vp) {
+static MOZ_MUST_USE bool WritableStreamDefaultWriter_close(JSContext* cx,
+                                                           unsigned argc,
+                                                           Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise
   //         rejected with a TypeError exception.
   Rooted<WritableStreamDefaultWriter*> unwrappedWriter(
       cx,
       UnwrapAndTypeCheckThis<WritableStreamDefaultWriter>(cx, args, "close"));
   if (!unwrappedWriter) {
@@ -428,18 +433,19 @@ static MOZ_MUST_USE bool WritableStream_
 
   args.rval().setObject(*promise);
   return true;
 }
 
 /**
  * Streams spec, 4.5.4.6. releaseLock()
  */
-static MOZ_MUST_USE bool WritableStream_releaseLock(JSContext* cx,
-                                                    unsigned argc, Value* vp) {
+static MOZ_MUST_USE bool WritableStreamDefaultWriter_releaseLock(JSContext* cx,
+                                                                 unsigned argc,
+                                                                 Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise
   //         rejected with a TypeError exception.
   Rooted<WritableStreamDefaultWriter*> unwrappedWriter(
       cx,
       UnwrapAndTypeCheckThis<WritableStreamDefaultWriter>(cx, args, "close"));
   if (!unwrappedWriter) {
@@ -472,18 +478,19 @@ static MOZ_MUST_USE bool WritableStream_
 
   args.rval().setUndefined();
   return true;
 }
 
 /**
  * Streams spec, 4.5.4.7. write(chunk)
  */
-static MOZ_MUST_USE bool WritableStream_write(JSContext* cx, unsigned argc,
-                                              Value* vp) {
+static MOZ_MUST_USE bool WritableStreamDefaultWriter_write(JSContext* cx,
+                                                           unsigned argc,
+                                                           Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise
   //         rejected with a TypeError exception.
   Rooted<WritableStreamDefaultWriter*> unwrappedWriter(
       cx,
       UnwrapAndTypeCheckThis<WritableStreamDefaultWriter>(cx, args, "write"));
   if (!unwrappedWriter) {
@@ -506,20 +513,20 @@ static MOZ_MUST_USE bool WritableStream_
   }
   cx->check(promise);
 
   args.rval().setObject(*promise);
   return true;
 }
 
 static const JSPropertySpec WritableStreamDefaultWriter_properties[] = {
-    JS_PSG("closed", WritableStream_closed, 0),
-    JS_PSG("desiredSize", WritableStream_desiredSize, 0),
-    JS_PSG("ready", WritableStream_ready, 0), JS_PS_END};
+    JS_PSG("closed", WritableStreamDefaultWriter_closed, 0),
+    JS_PSG("desiredSize", WritableStreamDefaultWriter_desiredSize, 0),
+    JS_PSG("ready", WritableStreamDefaultWriter_ready, 0), JS_PS_END};
 
 static const JSFunctionSpec WritableStreamDefaultWriter_methods[] = {
-    JS_FN("abort", WritableStream_abort, 1, 0),
-    JS_FN("close", WritableStream_close, 0, 0),
-    JS_FN("releaseLock", WritableStream_releaseLock, 0, 0),
-    JS_FN("write", WritableStream_write, 1, 0), JS_FS_END};
+    JS_FN("abort", WritableStreamDefaultWriter_abort, 1, 0),
+    JS_FN("close", WritableStreamDefaultWriter_close, 0, 0),
+    JS_FN("releaseLock", WritableStreamDefaultWriter_releaseLock, 0, 0),
+    JS_FN("write", WritableStreamDefaultWriter_write, 1, 0), JS_FS_END};
 
 JS_STREAMS_CLASS_SPEC(WritableStreamDefaultWriter, 0, SlotCount,
                       ClassSpec::DontDefineConstructor, 0, JS_NULL_CLASS_OPS);