react-server-dom-webpack 19.0.0 → 19.1.0-canary-7130d0c6-20241212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -293,14 +293,6 @@
293
293
  suspendedThenable = null;
294
294
  return thenable;
295
295
  }
296
- function prepareToUseHooksForComponent(
297
- prevThenableState,
298
- componentDebugInfo
299
- ) {
300
- thenableIndexCounter = 0;
301
- thenableState = prevThenableState;
302
- currentComponentDebugInfo = componentDebugInfo;
303
- }
304
296
  function getThenableStateAfterSuspending() {
305
297
  var state = thenableState || [];
306
298
  state._componentDebugInfo = currentComponentDebugInfo;
@@ -555,9 +547,8 @@
555
547
  1
556
548
  );
557
549
  request.pendingChunks++;
558
- var id = request.nextChunkId++,
559
- owner = resolveOwner();
560
- emitConsoleChunk(request, id, methodName, owner, stack, arguments);
550
+ var owner = resolveOwner();
551
+ emitConsoleChunk(request, methodName, owner, stack, arguments);
561
552
  }
562
553
  return originalMethod.apply(this, arguments);
563
554
  };
@@ -665,12 +656,7 @@
665
656
  newTask.id
666
657
  );
667
658
  case "rejected":
668
- task = thenable.reason;
669
- var digest = logRecoverableError(request, task, null);
670
- emitErrorChunk(request, newTask.id, digest, task);
671
- newTask.status = ERRORED$1;
672
- request.abortableTasks.delete(newTask);
673
- return newTask.id;
659
+ return erroredTask(request, newTask, thenable.reason), newTask.id;
674
660
  default:
675
661
  if (request.status === ABORTING)
676
662
  return (
@@ -700,13 +686,8 @@
700
686
  pingTask(request, newTask);
701
687
  },
702
688
  function (reason) {
703
- if (newTask.status === PENDING$1) {
704
- var _digest = logRecoverableError(request, reason, newTask);
705
- emitErrorChunk(request, newTask.id, _digest, reason);
706
- newTask.status = ERRORED$1;
707
- request.abortableTasks.delete(newTask);
708
- enqueueFlush(request);
709
- }
689
+ newTask.status === PENDING$1 &&
690
+ (erroredTask(request, newTask, reason), enqueueFlush(request));
710
691
  }
711
692
  );
712
693
  return newTask.id;
@@ -732,24 +713,20 @@
732
713
  }
733
714
  }
734
715
  function error(reason) {
735
- if (!aborted) {
736
- aborted = !0;
737
- request.abortListeners.delete(abortStream);
738
- var digest = logRecoverableError(request, reason, streamTask);
739
- emitErrorChunk(request, streamTask.id, digest, reason);
740
- enqueueFlush(request);
741
- reader.cancel(reason).then(error, error);
742
- }
716
+ aborted ||
717
+ ((aborted = !0),
718
+ request.abortListeners.delete(abortStream),
719
+ erroredTask(request, streamTask, reason),
720
+ enqueueFlush(request),
721
+ reader.cancel(reason).then(error, error));
743
722
  }
744
723
  function abortStream(reason) {
745
- if (!aborted) {
746
- aborted = !0;
747
- request.abortListeners.delete(abortStream);
748
- var digest = logRecoverableError(request, reason, streamTask);
749
- emitErrorChunk(request, streamTask.id, digest, reason);
750
- enqueueFlush(request);
751
- reader.cancel(reason).then(error, error);
752
- }
724
+ aborted ||
725
+ ((aborted = !0),
726
+ request.abortListeners.delete(abortStream),
727
+ erroredTask(request, streamTask, reason),
728
+ enqueueFlush(request),
729
+ reader.cancel(reason).then(error, error));
753
730
  }
754
731
  var supportsBYOB = stream.supportsBYOB;
755
732
  if (void 0 === supportsBYOB)
@@ -811,26 +788,22 @@
811
788
  }
812
789
  }
813
790
  function error(reason) {
814
- if (!aborted) {
815
- aborted = !0;
816
- request.abortListeners.delete(abortIterable);
817
- var digest = logRecoverableError(request, reason, streamTask);
818
- emitErrorChunk(request, streamTask.id, digest, reason);
819
- enqueueFlush(request);
791
+ aborted ||
792
+ ((aborted = !0),
793
+ request.abortListeners.delete(abortIterable),
794
+ erroredTask(request, streamTask, reason),
795
+ enqueueFlush(request),
820
796
  "function" === typeof iterator.throw &&
821
- iterator.throw(reason).then(error, error);
822
- }
797
+ iterator.throw(reason).then(error, error));
823
798
  }
824
799
  function abortIterable(reason) {
825
- if (!aborted) {
826
- aborted = !0;
827
- request.abortListeners.delete(abortIterable);
828
- var digest = logRecoverableError(request, reason, streamTask);
829
- emitErrorChunk(request, streamTask.id, digest, reason);
830
- enqueueFlush(request);
800
+ aborted ||
801
+ ((aborted = !0),
802
+ request.abortListeners.delete(abortIterable),
803
+ erroredTask(request, streamTask, reason),
804
+ enqueueFlush(request),
831
805
  "function" === typeof iterator.throw &&
832
- iterator.throw(reason).then(error, error);
833
- }
806
+ iterator.throw(reason).then(error, error));
834
807
  }
835
808
  var isIterator = iterable === iterator,
836
809
  streamTask = createTask(
@@ -854,9 +827,7 @@
854
827
  }
855
828
  function emitHint(request, code, model) {
856
829
  model = stringify(model);
857
- var id = request.nextChunkId++;
858
- code = serializeRowHeader("H" + code, id) + model + "\n";
859
- code = stringToChunk(code);
830
+ code = stringToChunk(":H" + code + model + "\n");
860
831
  request.completedHintChunks.push(code);
861
832
  enqueueFlush(request);
862
833
  }
@@ -906,6 +877,71 @@
906
877
  currentOwner = null;
907
878
  }
908
879
  }
880
+ function processServerComponentReturnValue(
881
+ request,
882
+ task,
883
+ Component,
884
+ result
885
+ ) {
886
+ if (
887
+ "object" !== typeof result ||
888
+ null === result ||
889
+ isClientReference(result)
890
+ )
891
+ return result;
892
+ if ("function" === typeof result.then)
893
+ return (
894
+ result.then(function (resolvedValue) {
895
+ "object" === typeof resolvedValue &&
896
+ null !== resolvedValue &&
897
+ resolvedValue.$$typeof === REACT_ELEMENT_TYPE &&
898
+ (resolvedValue._store.validated = 1);
899
+ }, voidHandler),
900
+ "fulfilled" === result.status
901
+ ? result.value
902
+ : createLazyWrapperAroundWakeable(result)
903
+ );
904
+ result.$$typeof === REACT_ELEMENT_TYPE && (result._store.validated = 1);
905
+ var iteratorFn = getIteratorFn(result);
906
+ if (iteratorFn) {
907
+ var multiShot = _defineProperty({}, Symbol.iterator, function () {
908
+ var iterator = iteratorFn.call(result);
909
+ iterator !== result ||
910
+ ("[object GeneratorFunction]" ===
911
+ Object.prototype.toString.call(Component) &&
912
+ "[object Generator]" ===
913
+ Object.prototype.toString.call(result)) ||
914
+ callWithDebugContextInDEV(request, task, function () {
915
+ console.error(
916
+ "Returning an Iterator from a Server Component is not supported since it cannot be looped over more than once. "
917
+ );
918
+ });
919
+ return iterator;
920
+ });
921
+ multiShot._debugInfo = result._debugInfo;
922
+ return multiShot;
923
+ }
924
+ return "function" !== typeof result[ASYNC_ITERATOR] ||
925
+ ("function" === typeof ReadableStream &&
926
+ result instanceof ReadableStream)
927
+ ? result
928
+ : ((multiShot = _defineProperty({}, ASYNC_ITERATOR, function () {
929
+ var iterator = result[ASYNC_ITERATOR]();
930
+ iterator !== result ||
931
+ ("[object AsyncGeneratorFunction]" ===
932
+ Object.prototype.toString.call(Component) &&
933
+ "[object AsyncGenerator]" ===
934
+ Object.prototype.toString.call(result)) ||
935
+ callWithDebugContextInDEV(request, task, function () {
936
+ console.error(
937
+ "Returning an AsyncIterator from a Server Component is not supported since it cannot be looped over more than once. "
938
+ );
939
+ });
940
+ return iterator;
941
+ })),
942
+ (multiShot._debugInfo = result._debugInfo),
943
+ multiShot);
944
+ }
909
945
  function renderFunctionComponent(request, task, key, Component, props) {
910
946
  var prevThenableState = task.thenableState;
911
947
  task.thenableState = null;
@@ -928,7 +964,9 @@
928
964
  emitDebugChunk(request, componentDebugID, componentDebugInfo);
929
965
  task.environmentName = componentEnv;
930
966
  }
931
- prepareToUseHooksForComponent(prevThenableState, componentDebugInfo);
967
+ thenableIndexCounter = 0;
968
+ thenableState = prevThenableState;
969
+ currentComponentDebugInfo = componentDebugInfo;
932
970
  props = callComponentInDEV(Component, props, componentDebugInfo);
933
971
  if (request.status === ABORTING)
934
972
  throw (
@@ -939,76 +977,21 @@
939
977
  props.then(voidHandler, voidHandler),
940
978
  null)
941
979
  );
942
- if (
943
- "object" === typeof props &&
944
- null !== props &&
945
- !isClientReference(props)
946
- ) {
947
- if ("function" === typeof props.then) {
948
- prevThenableState = props;
949
- prevThenableState.then(function (resolvedValue) {
950
- "object" === typeof resolvedValue &&
951
- null !== resolvedValue &&
952
- resolvedValue.$$typeof === REACT_ELEMENT_TYPE &&
953
- (resolvedValue._store.validated = 1);
954
- }, voidHandler);
955
- if ("fulfilled" === prevThenableState.status)
956
- return prevThenableState.value;
957
- props = createLazyWrapperAroundWakeable(props);
958
- }
959
- var iteratorFn = getIteratorFn(props);
960
- if (iteratorFn) {
961
- var iterableChild = props;
962
- props = _defineProperty({}, Symbol.iterator, function () {
963
- var iterator = iteratorFn.call(iterableChild);
964
- iterator !== iterableChild ||
965
- ("[object GeneratorFunction]" ===
966
- Object.prototype.toString.call(Component) &&
967
- "[object Generator]" ===
968
- Object.prototype.toString.call(iterableChild)) ||
969
- callWithDebugContextInDEV(request, task, function () {
970
- console.error(
971
- "Returning an Iterator from a Server Component is not supported since it cannot be looped over more than once. "
972
- );
973
- });
974
- return iterator;
975
- });
976
- props._debugInfo = iterableChild._debugInfo;
977
- } else if (
978
- "function" !== typeof props[ASYNC_ITERATOR] ||
979
- ("function" === typeof ReadableStream &&
980
- props instanceof ReadableStream)
981
- )
982
- props.$$typeof === REACT_ELEMENT_TYPE && (props._store.validated = 1);
983
- else {
984
- var _iterableChild = props;
985
- props = _defineProperty({}, ASYNC_ITERATOR, function () {
986
- var iterator = _iterableChild[ASYNC_ITERATOR]();
987
- iterator !== _iterableChild ||
988
- ("[object AsyncGeneratorFunction]" ===
989
- Object.prototype.toString.call(Component) &&
990
- "[object AsyncGenerator]" ===
991
- Object.prototype.toString.call(_iterableChild)) ||
992
- callWithDebugContextInDEV(request, task, function () {
993
- console.error(
994
- "Returning an AsyncIterator from a Server Component is not supported since it cannot be looped over more than once. "
995
- );
996
- });
997
- return iterator;
998
- });
999
- props._debugInfo = _iterableChild._debugInfo;
1000
- }
1001
- }
1002
- prevThenableState = task.keyPath;
1003
- componentDebugID = task.implicitSlot;
980
+ props = processServerComponentReturnValue(
981
+ request,
982
+ task,
983
+ Component,
984
+ props
985
+ );
986
+ Component = task.keyPath;
987
+ prevThenableState = task.implicitSlot;
1004
988
  null !== key
1005
- ? (task.keyPath =
1006
- null === prevThenableState ? key : prevThenableState + "," + key)
1007
- : null === prevThenableState && (task.implicitSlot = !0);
1008
- key = renderModelDestructive(request, task, emptyRoot, "", props);
1009
- task.keyPath = prevThenableState;
1010
- task.implicitSlot = componentDebugID;
1011
- return key;
989
+ ? (task.keyPath = null === Component ? key : Component + "," + key)
990
+ : null === Component && (task.implicitSlot = !0);
991
+ request = renderModelDestructive(request, task, emptyRoot, "", props);
992
+ task.keyPath = Component;
993
+ task.implicitSlot = prevThenableState;
994
+ return request;
1012
995
  }
1013
996
  function renderFragment(request, task, children) {
1014
997
  for (var i = 0; i < children.length; i++) {
@@ -1211,9 +1194,6 @@
1211
1194
  ? "$-Infinity"
1212
1195
  : "$NaN";
1213
1196
  }
1214
- function serializeRowHeader(tag, id) {
1215
- return id.toString(16) + ":" + tag;
1216
- }
1217
1197
  function encodeReferenceChunk(request, id, reference) {
1218
1198
  request = stringify(reference);
1219
1199
  id = id.toString(16) + ":" + request + "\n";
@@ -1265,7 +1245,7 @@
1265
1245
  request.pendingChunks++;
1266
1246
  var importId = request.nextChunkId++,
1267
1247
  json = stringify(clientReferenceMetadata),
1268
- row = serializeRowHeader("I", importId) + json + "\n",
1248
+ row = importId.toString(16) + ":I" + json + "\n",
1269
1249
  processedChunk = stringToChunk(row);
1270
1250
  request.completedImportChunks.push(processedChunk);
1271
1251
  writtenClientReferences.set(clientReferenceKey, importId);
@@ -1360,24 +1340,20 @@
1360
1340
  );
1361
1341
  }
1362
1342
  function error(reason) {
1363
- if (!aborted) {
1364
- aborted = !0;
1365
- request.abortListeners.delete(abortBlob);
1366
- var digest = logRecoverableError(request, reason, newTask);
1367
- emitErrorChunk(request, newTask.id, digest, reason);
1368
- enqueueFlush(request);
1369
- reader.cancel(reason).then(error, error);
1370
- }
1343
+ aborted ||
1344
+ ((aborted = !0),
1345
+ request.abortListeners.delete(abortBlob),
1346
+ erroredTask(request, newTask, reason),
1347
+ enqueueFlush(request),
1348
+ reader.cancel(reason).then(error, error));
1371
1349
  }
1372
1350
  function abortBlob(reason) {
1373
- if (!aborted) {
1374
- aborted = !0;
1375
- request.abortListeners.delete(abortBlob);
1376
- var digest = logRecoverableError(request, reason, newTask);
1377
- emitErrorChunk(request, newTask.id, digest, reason);
1378
- enqueueFlush(request);
1379
- reader.cancel(reason).then(error, error);
1380
- }
1351
+ aborted ||
1352
+ ((aborted = !0),
1353
+ request.abortListeners.delete(abortBlob),
1354
+ erroredTask(request, newTask, reason),
1355
+ enqueueFlush(request),
1356
+ reader.cancel(reason).then(error, error));
1381
1357
  }
1382
1358
  var model = [blob.type],
1383
1359
  newTask = createTask(
@@ -1817,7 +1793,7 @@
1817
1793
  (stack = []);
1818
1794
  }
1819
1795
  digest = { digest: digest, message: message, stack: stack, env: env };
1820
- id = serializeRowHeader("E", id) + stringify(digest) + "\n";
1796
+ id = id.toString(16) + ":E" + stringify(digest) + "\n";
1821
1797
  id = stringToChunk(id);
1822
1798
  request.completedErrorChunks.push(id);
1823
1799
  }
@@ -1841,7 +1817,7 @@
1841
1817
  value
1842
1818
  );
1843
1819
  });
1844
- id = serializeRowHeader("D", id) + debugInfo + "\n";
1820
+ id = id.toString(16) + ":D" + debugInfo + "\n";
1845
1821
  id = stringToChunk(id);
1846
1822
  request.completedRegularChunks.push(id);
1847
1823
  }
@@ -2099,14 +2075,7 @@
2099
2075
  request.completedRegularChunks.push(json);
2100
2076
  return model;
2101
2077
  }
2102
- function emitConsoleChunk(
2103
- request,
2104
- id,
2105
- methodName,
2106
- owner,
2107
- stackTrace,
2108
- args
2109
- ) {
2078
+ function emitConsoleChunk(request, methodName, owner, stackTrace, args) {
2110
2079
  function replacer(parentPropertyName, value) {
2111
2080
  try {
2112
2081
  return renderConsoleValue(
@@ -2143,16 +2112,16 @@
2143
2112
  replacer
2144
2113
  );
2145
2114
  }
2146
- id = serializeRowHeader("W", id) + json + "\n";
2147
- id = stringToChunk(id);
2148
- request.completedRegularChunks.push(id);
2115
+ methodName = stringToChunk(":W" + json + "\n");
2116
+ request.completedRegularChunks.push(methodName);
2149
2117
  }
2150
2118
  function forwardDebugInfo(request, id, debugInfo) {
2151
2119
  for (var i = 0; i < debugInfo.length; i++)
2152
2120
  request.pendingChunks++,
2153
- "string" === typeof debugInfo[i].name &&
2154
- outlineComponentInfo(request, debugInfo[i]),
2155
- emitDebugChunk(request, id, debugInfo[i]);
2121
+ "number" !== typeof debugInfo[i].time &&
2122
+ ("string" === typeof debugInfo[i].name &&
2123
+ outlineComponentInfo(request, debugInfo[i]),
2124
+ emitDebugChunk(request, id, debugInfo[i]));
2156
2125
  }
2157
2126
  function emitChunk(request, task, value) {
2158
2127
  var id = task.id;
@@ -2187,6 +2156,12 @@
2187
2156
  : ((value = stringify(value, task.toJSON)),
2188
2157
  emitModelChunk(request, task.id, value));
2189
2158
  }
2159
+ function erroredTask(request, task, error) {
2160
+ request.abortableTasks.delete(task);
2161
+ task.status = ERRORED$1;
2162
+ var digest = logRecoverableError(request, error, task);
2163
+ emitErrorChunk(request, task.id, digest, error);
2164
+ }
2190
2165
  function retryTask(request, task) {
2191
2166
  if (task.status === PENDING$1) {
2192
2167
  var prevDebugID = debugID;
@@ -2205,22 +2180,18 @@
2205
2180
  modelRoot = resolvedModel;
2206
2181
  task.keyPath = null;
2207
2182
  task.implicitSlot = !1;
2208
- if ("object" === typeof resolvedModel && null !== resolvedModel) {
2183
+ var currentEnv = (0, request.environmentName)();
2184
+ currentEnv !== task.environmentName &&
2185
+ (request.pendingChunks++,
2186
+ emitDebugChunk(request, task.id, { env: currentEnv }));
2187
+ if ("object" === typeof resolvedModel && null !== resolvedModel)
2209
2188
  request.writtenObjects.set(
2210
2189
  resolvedModel,
2211
2190
  serializeByValueID(task.id)
2212
- );
2213
- var currentEnv = (0, request.environmentName)();
2214
- currentEnv !== task.environmentName &&
2215
- (request.pendingChunks++,
2216
- emitDebugChunk(request, task.id, { env: currentEnv }));
2217
- emitChunk(request, task, resolvedModel);
2218
- } else {
2219
- var json = stringify(resolvedModel),
2220
- _currentEnv = (0, request.environmentName)();
2221
- _currentEnv !== task.environmentName &&
2222
- (request.pendingChunks++,
2223
- emitDebugChunk(request, task.id, { env: _currentEnv }));
2191
+ ),
2192
+ emitChunk(request, task, resolvedModel);
2193
+ else {
2194
+ var json = stringify(resolvedModel);
2224
2195
  emitModelChunk(request, task.id, json);
2225
2196
  }
2226
2197
  request.abortableTasks.delete(task);
@@ -2245,12 +2216,7 @@
2245
2216
  task.thenableState = getThenableStateAfterSuspending();
2246
2217
  var ping = task.ping;
2247
2218
  x.then(ping, ping);
2248
- } else {
2249
- request.abortableTasks.delete(task);
2250
- task.status = ERRORED$1;
2251
- var digest = logRecoverableError(request, x, task);
2252
- emitErrorChunk(request, task.id, digest, x);
2253
- }
2219
+ } else erroredTask(request, task, x);
2254
2220
  }
2255
2221
  } finally {
2256
2222
  debugID = prevDebugID;
@@ -2374,6 +2340,19 @@
2374
2340
  destination && flushCompletedChunks(request, destination);
2375
2341
  }));
2376
2342
  }
2343
+ function startFlowing(request, destination) {
2344
+ if (request.status === CLOSING)
2345
+ (request.status = CLOSED),
2346
+ closeWithError(destination, request.fatalError);
2347
+ else if (request.status !== CLOSED && null === request.destination) {
2348
+ request.destination = destination;
2349
+ try {
2350
+ flushCompletedChunks(request, destination);
2351
+ } catch (error) {
2352
+ logRecoverableError(request, error, null), fatalError(request, error);
2353
+ }
2354
+ }
2355
+ }
2377
2356
  function abort(request, reason) {
2378
2357
  try {
2379
2358
  11 >= request.status && (request.status = ABORTING);
@@ -3437,7 +3416,7 @@
3437
3416
  var MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
3438
3417
  ASYNC_ITERATOR = Symbol.asyncIterator,
3439
3418
  SuspenseException = Error(
3440
- "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"
3419
+ "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
3441
3420
  ),
3442
3421
  suspendedThenable = null,
3443
3422
  currentRequest$1 = null,
@@ -3755,21 +3734,7 @@
3755
3734
  startWork(request);
3756
3735
  },
3757
3736
  pull: function (controller) {
3758
- if (request.status === CLOSING)
3759
- (request.status = CLOSED),
3760
- closeWithError(controller, request.fatalError);
3761
- else if (
3762
- request.status !== CLOSED &&
3763
- null === request.destination
3764
- ) {
3765
- request.destination = controller;
3766
- try {
3767
- flushCompletedChunks(request, controller);
3768
- } catch (error) {
3769
- logRecoverableError(request, error, null),
3770
- fatalError(request, error);
3771
- }
3772
- }
3737
+ startFlowing(request, controller);
3773
3738
  },
3774
3739
  cancel: function (reason) {
3775
3740
  request.destination = null;
@@ -3779,4 +3744,51 @@
3779
3744
  { highWaterMark: 0 }
3780
3745
  );
3781
3746
  };
3747
+ exports.unstable_prerender = function (model, webpackMap, options) {
3748
+ return new Promise(function (resolve, reject) {
3749
+ var request = new RequestInstance(
3750
+ PRERENDER,
3751
+ model,
3752
+ webpackMap,
3753
+ options ? options.onError : void 0,
3754
+ options ? options.identifierPrefix : void 0,
3755
+ options ? options.onPostpone : void 0,
3756
+ options ? options.temporaryReferences : void 0,
3757
+ options ? options.environmentName : void 0,
3758
+ options ? options.filterStackFrame : void 0,
3759
+ function () {
3760
+ var stream = new ReadableStream(
3761
+ {
3762
+ type: "bytes",
3763
+ start: function () {
3764
+ startWork(request);
3765
+ },
3766
+ pull: function (controller) {
3767
+ startFlowing(request, controller);
3768
+ },
3769
+ cancel: function (reason) {
3770
+ request.destination = null;
3771
+ abort(request, reason);
3772
+ }
3773
+ },
3774
+ { highWaterMark: 0 }
3775
+ );
3776
+ resolve({ prelude: stream });
3777
+ },
3778
+ reject
3779
+ );
3780
+ if (options && options.signal) {
3781
+ var signal = options.signal;
3782
+ if (signal.aborted) abort(request, signal.reason);
3783
+ else {
3784
+ var listener = function () {
3785
+ abort(request, signal.reason);
3786
+ signal.removeEventListener("abort", listener);
3787
+ };
3788
+ signal.addEventListener("abort", listener);
3789
+ }
3790
+ }
3791
+ startWork(request);
3792
+ });
3793
+ };
3782
3794
  })();