firefly-compiler 0.4.50 → 0.4.52

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.
Files changed (109) hide show
  1. package/.hintrc +4 -4
  2. package/.vscode/settings.json +4 -4
  3. package/bin/Release.ff +153 -155
  4. package/bin/firefly.mjs +1 -1
  5. package/compiler/Builder.ff +257 -257
  6. package/compiler/Compiler.ff +227 -227
  7. package/compiler/Dependencies.ff +186 -186
  8. package/compiler/DependencyLock.ff +17 -17
  9. package/compiler/JsEmitter.ff +946 -946
  10. package/compiler/LspHook.ff +202 -202
  11. package/compiler/ModuleCache.ff +178 -178
  12. package/compiler/Workspace.ff +88 -88
  13. package/core/.firefly/include/package-lock.json +394 -394
  14. package/core/.firefly/include/package.json +5 -5
  15. package/core/.firefly/include/prepare.sh +1 -1
  16. package/core/.firefly/package.ff +2 -2
  17. package/core/Array.ff +265 -265
  18. package/core/Atomic.ff +64 -64
  19. package/core/Box.ff +7 -7
  20. package/core/BrowserSystem.ff +40 -40
  21. package/core/BuildSystem.ff +148 -148
  22. package/core/Crypto.ff +96 -96
  23. package/core/Equal.ff +36 -36
  24. package/core/HttpClient.ff +87 -87
  25. package/core/JsSystem.ff +69 -69
  26. package/core/Json.ff +434 -434
  27. package/core/List.ff +486 -486
  28. package/core/Lock.ff +144 -144
  29. package/core/NodeSystem.ff +195 -189
  30. package/core/Ordering.ff +161 -161
  31. package/core/Path.ff +401 -401
  32. package/core/Random.ff +134 -134
  33. package/core/RbMap.ff +216 -216
  34. package/core/Show.ff +43 -43
  35. package/core/SourceLocation.ff +68 -68
  36. package/core/Task.ff +141 -141
  37. package/experimental/benchmarks/ListGrab.ff +23 -23
  38. package/experimental/benchmarks/ListGrab.java +55 -55
  39. package/experimental/benchmarks/Pyrotek45.ff +30 -30
  40. package/experimental/benchmarks/Pyrotek45.java +64 -64
  41. package/experimental/bidirectional/Bidi.ff +88 -88
  42. package/experimental/random/Index.ff +53 -53
  43. package/experimental/random/Process.ff +120 -120
  44. package/experimental/random/Scrape.ff +51 -51
  45. package/experimental/random/Symbols.ff +73 -73
  46. package/experimental/random/Tensor.ff +52 -52
  47. package/experimental/random/Units.ff +36 -36
  48. package/experimental/s3/S3TestAuthorizationHeader.ff +38 -38
  49. package/experimental/s3/S3TestPut.ff +15 -15
  50. package/experimental/tests/TestJson.ff +26 -26
  51. package/firefly.sh +0 -0
  52. package/fireflysite/Main.ff +13 -13
  53. package/lsp/.firefly/package.ff +1 -1
  54. package/lsp/CompletionHandler.ff +808 -808
  55. package/lsp/Handler.ff +714 -714
  56. package/lsp/HoverHandler.ff +79 -79
  57. package/lsp/LanguageServer.ff +272 -272
  58. package/lsp/SignatureHelpHandler.ff +55 -55
  59. package/lsp/SymbolHandler.ff +181 -181
  60. package/lsp/TestReferences.ff +16 -16
  61. package/lsp/TestReferencesCase.ff +7 -7
  62. package/lsp/stderr.txt +1 -1
  63. package/lsp/stdin.txt +10 -10
  64. package/lsp/stdout.txt +40 -40
  65. package/lux/.firefly/package.ff +1 -1
  66. package/lux/Css.ff +648 -648
  67. package/lux/CssTest.ff +48 -48
  68. package/lux/Lux.ff +487 -487
  69. package/lux/LuxEvent.ff +116 -116
  70. package/lux/Main.ff +128 -128
  71. package/lux/Main2.ff +144 -144
  72. package/output/js/ff/compiler/Builder.mjs +43 -43
  73. package/output/js/ff/compiler/Dependencies.mjs +3 -3
  74. package/output/js/ff/core/Array.mjs +59 -59
  75. package/output/js/ff/core/Atomic.mjs +36 -36
  76. package/output/js/ff/core/BrowserSystem.mjs +11 -11
  77. package/output/js/ff/core/BuildSystem.mjs +30 -30
  78. package/output/js/ff/core/Crypto.mjs +40 -40
  79. package/output/js/ff/core/HttpClient.mjs +24 -24
  80. package/output/js/ff/core/Json.mjs +147 -147
  81. package/output/js/ff/core/List.mjs +50 -50
  82. package/output/js/ff/core/Lock.mjs +97 -97
  83. package/output/js/ff/core/NodeSystem.mjs +83 -77
  84. package/output/js/ff/core/Ordering.mjs +8 -8
  85. package/output/js/ff/core/Path.mjs +231 -231
  86. package/output/js/ff/core/Random.mjs +56 -56
  87. package/output/js/ff/core/Task.mjs +31 -31
  88. package/package.json +1 -1
  89. package/rpc/.firefly/package.ff +1 -1
  90. package/rpc/Rpc.ff +69 -69
  91. package/s3/.firefly/package.ff +1 -1
  92. package/s3/S3.ff +90 -93
  93. package/unsafejs/UnsafeJs.ff +19 -19
  94. package/vscode/LICENSE.txt +21 -21
  95. package/vscode/Prepublish.ff +15 -15
  96. package/vscode/README.md +16 -16
  97. package/vscode/client/package.json +22 -22
  98. package/vscode/client/src/extension.ts +104 -104
  99. package/vscode/icons/firefly-icon.svg +10 -10
  100. package/vscode/language-configuration.json +61 -61
  101. package/vscode/package-lock.json +3623 -3623
  102. package/vscode/package.json +1 -1
  103. package/vscode/snippets.json +241 -241
  104. package/webserver/.firefly/include/package-lock.json +16 -16
  105. package/webserver/.firefly/include/package.json +5 -5
  106. package/webserver/.firefly/package.ff +2 -2
  107. package/webserver/WebServer.ff +685 -685
  108. package/websocket/.firefly/package.ff +1 -1
  109. package/websocket/WebSocket.ff +131 -131
@@ -109,48 +109,48 @@ throw new Error('Function internalReadStream is missing on this target in sync c
109
109
  }
110
110
 
111
111
  export async function internalReadStream_$(createReadStream_, $task) {
112
-
113
- let task = null
114
- let readable = null
115
- let doResolve = null
116
- let doReject = null
117
- let seenError = null
118
- const abort = () => {
119
- if(task != null) {
120
- task.controller.signal.removeEventListener('abort', abort)
121
- readable.destroy()
122
- }
123
- }
124
- function open($task) {
125
- ff_core_Task.Task_throwIfAborted($task)
126
- task = $task
127
- readable = createReadStream_()
128
- readable.on('readable', () => {
129
- if(doResolve != null) doResolve()
130
- })
131
- readable.on('error', error => {
132
- task.controller.signal.removeEventListener('abort', abort)
133
- seenError = error
134
- if(doReject != null) doReject(error)
135
- })
136
- readable.on('close', () => {
137
- task.controller.signal.removeEventListener('abort', abort)
138
- if(doResolve != null) doResolve()
139
- })
140
- $task.controller.signal.addEventListener('abort', abort)
141
- }
142
- return ff_core_Stream.Stream(async function go($task) {
143
- if(task == null) open($task)
144
- let buffer = readable.read()
145
- if(buffer != null) return ff_core_Option.Some(new DataView(buffer.buffer, buffer.byteOffset, buffer.length))
146
- if(seenError != null) throw seenError
147
- if(readable.destroyed) return ff_core_Option.None()
148
- let promise = new Promise((resolve, reject) => {
149
- doResolve = () => {doResolve = null; doReject = null; resolve()}
150
- doReject = error => {doResolve = null; doReject = null; reject(error)}
151
- }).then(() => go($task))
152
- return await promise
153
- }, abort)
112
+
113
+ let task = null
114
+ let readable = null
115
+ let doResolve = null
116
+ let doReject = null
117
+ let seenError = null
118
+ const abort = () => {
119
+ if(task != null) {
120
+ task.controller.signal.removeEventListener('abort', abort)
121
+ readable.destroy()
122
+ }
123
+ }
124
+ function open($task) {
125
+ ff_core_Task.Task_throwIfAborted($task)
126
+ task = $task
127
+ readable = createReadStream_()
128
+ readable.on('readable', () => {
129
+ if(doResolve != null) doResolve()
130
+ })
131
+ readable.on('error', error => {
132
+ task.controller.signal.removeEventListener('abort', abort)
133
+ seenError = error
134
+ if(doReject != null) doReject(error)
135
+ })
136
+ readable.on('close', () => {
137
+ task.controller.signal.removeEventListener('abort', abort)
138
+ if(doResolve != null) doResolve()
139
+ })
140
+ $task.controller.signal.addEventListener('abort', abort)
141
+ }
142
+ return ff_core_Stream.Stream(async function go($task) {
143
+ if(task == null) open($task)
144
+ let buffer = readable.read()
145
+ if(buffer != null) return ff_core_Option.Some(new DataView(buffer.buffer, buffer.byteOffset, buffer.length))
146
+ if(seenError != null) throw seenError
147
+ if(readable.destroyed) return ff_core_Option.None()
148
+ let promise = new Promise((resolve, reject) => {
149
+ doResolve = () => {doResolve = null; doReject = null; resolve()}
150
+ doReject = error => {doResolve = null; doReject = null; reject(error)}
151
+ }).then(() => go($task))
152
+ return await promise
153
+ }, abort)
154
154
 
155
155
  }
156
156
 
@@ -347,19 +347,19 @@ throw new Error('Function Path_appendHandle is missing on this target in sync co
347
347
  }
348
348
 
349
349
  export async function Path_exists$(self_, checkReadable_ = false, checkWritable_ = false, checkExecutable_ = false, $task) {
350
-
351
- const fs = import$0
352
- const fsPromises = import$1
353
- const flags =
354
- (fs.constants.R_OK * checkReadable_) |
355
- (fs.constants.W_OK * checkWritable_) |
356
- (fs.constants.X_OK * checkExecutable_)
357
- try {
358
- await fsPromises.access(self_, flags === 0 ? fs.constants.F_OK : flags)
359
- return true
360
- } catch(e) {
361
- return false
362
- }
350
+
351
+ const fs = import$0
352
+ const fsPromises = import$1
353
+ const flags =
354
+ (fs.constants.R_OK * checkReadable_) |
355
+ (fs.constants.W_OK * checkWritable_) |
356
+ (fs.constants.X_OK * checkExecutable_)
357
+ try {
358
+ await fsPromises.access(self_, flags === 0 ? fs.constants.F_OK : flags)
359
+ return true
360
+ } catch(e) {
361
+ return false
362
+ }
363
363
 
364
364
  }
365
365
 
@@ -376,90 +376,90 @@ return (await ff_core_Path.Path_exists$(self_, false, false, true, $task))
376
376
  }
377
377
 
378
378
  export async function Path_isDirectory$(self_, $task) {
379
-
380
- const fsPromises = import$1
381
- try {
382
- return (await fsPromises.lstat(self_)).isDirectory();
383
- } catch(e) {
384
- return false;
385
- }
379
+
380
+ const fsPromises = import$1
381
+ try {
382
+ return (await fsPromises.lstat(self_)).isDirectory();
383
+ } catch(e) {
384
+ return false;
385
+ }
386
386
 
387
387
  }
388
388
 
389
389
  export async function Path_isFile$(self_, $task) {
390
-
391
- const fsPromises = import$1
392
- try {
393
- return (await fsPromises.lstat(self_)).isFile();
394
- } catch(e) {
395
- return false;
396
- }
390
+
391
+ const fsPromises = import$1
392
+ try {
393
+ return (await fsPromises.lstat(self_)).isFile();
394
+ } catch(e) {
395
+ return false;
396
+ }
397
397
 
398
398
  }
399
399
 
400
400
  export async function Path_isSymbolicLink$(self_, $task) {
401
-
402
- const fsPromises = import$1
403
- try {
404
- return (await fsPromises.lstat(self_)).isSymbolicLink();
405
- } catch(e) {
406
- return false;
407
- }
401
+
402
+ const fsPromises = import$1
403
+ try {
404
+ return (await fsPromises.lstat(self_)).isSymbolicLink();
405
+ } catch(e) {
406
+ return false;
407
+ }
408
408
 
409
409
  }
410
410
 
411
411
  export async function Path_isInsideOf$(self_, path_, $task) {
412
-
413
- const path = import$2
414
- if(path_ === '/') return true
415
- const childPath = path.resolve(self_)
416
- const parentPath = path.resolve(path_)
417
- return childPath.startsWith(parentPath + path.sep) || childPath === parentPath
412
+
413
+ const path = import$2
414
+ if(path_ === '/') return true
415
+ const childPath = path.resolve(self_)
416
+ const parentPath = path.resolve(path_)
417
+ return childPath.startsWith(parentPath + path.sep) || childPath === parentPath
418
418
 
419
419
  }
420
420
 
421
421
  export async function Path_size$(self_, $task) {
422
-
423
- return (await fs.promises.stat(file)).size
422
+
423
+ return (await fs.promises.stat(file)).size
424
424
 
425
425
  }
426
426
 
427
427
  export async function Path_modified$(self_, $task) {
428
-
429
- return (await fs.promises.stat(file)).mtimeMs * 0.001
428
+
429
+ return (await fs.promises.stat(file)).mtimeMs * 0.001
430
430
 
431
431
  }
432
432
 
433
433
  export async function Path_entries$(self_, $task) {
434
-
435
- const fsPromises = import$1
436
- let dir = null
437
- return ff_core_Stream.Stream(
438
- async () => {
439
- if(dir === null) dir = await fsPromises.opendir(self_, {bufferSize: 128})
440
- const entry = await dir.read()
441
- if(entry === null) return ff_core_Option.None()
442
- entry.ffPath = self_
443
- return ff_core_Option.Some(entry)
444
- },
445
- async () => {
446
- if(dir !== null) await dir.close()
447
- }
448
- )
434
+
435
+ const fsPromises = import$1
436
+ let dir = null
437
+ return ff_core_Stream.Stream(
438
+ async () => {
439
+ if(dir === null) dir = await fsPromises.opendir(self_, {bufferSize: 128})
440
+ const entry = await dir.read()
441
+ if(entry === null) return ff_core_Option.None()
442
+ entry.ffPath = self_
443
+ return ff_core_Option.Some(entry)
444
+ },
445
+ async () => {
446
+ if(dir !== null) await dir.close()
447
+ }
448
+ )
449
449
 
450
450
  }
451
451
 
452
452
  export async function Path_absolute$(self_, $task) {
453
-
454
- const path = import$2
455
- return path.resolve(self_)
453
+
454
+ const path = import$2
455
+ return path.resolve(self_)
456
456
 
457
457
  }
458
458
 
459
459
  export async function Path_relativeTo$(self_, path_, $task) {
460
-
461
- const path = import$2;
462
- return path.relative(path_, self_);
460
+
461
+ const path = import$2;
462
+ return path.relative(path_, self_);
463
463
 
464
464
  }
465
465
 
@@ -490,61 +490,61 @@ return (await ff_core_Path.Path_contains$(_w1, parts_, $task))
490
490
  }
491
491
 
492
492
  export async function Path_base$(self_, $task) {
493
-
494
- const path = import$2
495
- return path.basename(self_)
493
+
494
+ const path = import$2
495
+ return path.basename(self_)
496
496
 
497
497
  }
498
498
 
499
499
  export async function Path_extension$(self_, $task) {
500
-
501
- const path = import$2
502
- return path.extname(self_)
500
+
501
+ const path = import$2
502
+ return path.extname(self_)
503
503
 
504
504
  }
505
505
 
506
506
  export async function Path_url$(self_, $task) {
507
-
508
- const url = import$3;
509
- return '' + url.pathToFileURL(self_);
507
+
508
+ const url = import$3;
509
+ return '' + url.pathToFileURL(self_);
510
510
 
511
511
  }
512
512
 
513
513
  export async function Path_delimiter$(self_, $task) {
514
-
515
- const path = import$2;
516
- return path.delimiter(self_);
514
+
515
+ const path = import$2;
516
+ return path.delimiter(self_);
517
517
 
518
518
  }
519
519
 
520
520
  export async function Path_separator$(self_, $task) {
521
-
522
- const path = import$2;
523
- return path.separator();
521
+
522
+ const path = import$2;
523
+ return path.separator();
524
524
 
525
525
  }
526
526
 
527
527
  export async function Path_parent$(self_, $task) {
528
-
529
- const path = import$2
530
- const result = path.dirname(self_)
531
- return result !== "" && result !== self_
532
- ? ff_core_Option.Some(result)
533
- : ff_core_Option.None()
528
+
529
+ const path = import$2
530
+ const result = path.dirname(self_)
531
+ return result !== "" && result !== self_
532
+ ? ff_core_Option.Some(result)
533
+ : ff_core_Option.None()
534
534
 
535
535
  }
536
536
 
537
537
  export async function Path_slash$(self_, relativePath_, $task) {
538
-
539
- const path = import$2
540
- return path.join(self_, relativePath_)
538
+
539
+ const path = import$2
540
+ return path.join(self_, relativePath_)
541
541
 
542
542
  }
543
543
 
544
544
  export async function Path_path$(self_, absoluteOrRelativePath_, $task) {
545
-
546
- const path = import$2
547
- return path.resolve(self_, absoluteOrRelativePath_)
545
+
546
+ const path = import$2
547
+ return path.resolve(self_, absoluteOrRelativePath_)
548
548
 
549
549
  }
550
550
 
@@ -563,70 +563,70 @@ if((await ff_core_Path.Path_exists$(path_, false, false, false, $task))) {
563
563
  }
564
564
 
565
565
  export async function Path_createDirectory$(self_, createParentDirectories_ = false, $task) {
566
-
567
- const fsPromises = import$1
568
- await fsPromises.mkdir(self_, {recursive: createParentDirectories_})
566
+
567
+ const fsPromises = import$1
568
+ await fsPromises.mkdir(self_, {recursive: createParentDirectories_})
569
569
 
570
570
  }
571
571
 
572
572
  export async function Path_createSymlinkTo$(self_, path_, $task) {
573
-
574
- const fsPromises = import$1
575
- await fsPromises.symlink(path_, self_)
573
+
574
+ const fsPromises = import$1
575
+ await fsPromises.symlink(path_, self_)
576
576
 
577
577
  }
578
578
 
579
579
  export async function Path_delete$(self_, retries_ = 0, retryDelay_ = 100, $task) {
580
-
581
- const fsPromises = import$1
582
- await fsPromises.rm(self_, {recursive: true, retries: retries_, retryDelay: retryDelay_})
580
+
581
+ const fsPromises = import$1
582
+ await fsPromises.rm(self_, {recursive: true, retries: retries_, retryDelay: retryDelay_})
583
583
 
584
584
  }
585
585
 
586
586
  export async function Path_truncate$(self_, length_ = 0, $task) {
587
-
588
- const fsPromises = import$1
589
- await fsPromises.truncate(self_, length_)
587
+
588
+ const fsPromises = import$1
589
+ await fsPromises.truncate(self_, length_)
590
590
 
591
591
  }
592
592
 
593
593
  export async function Path_renameTo$(self_, path_, $task) {
594
-
595
- const fsPromises = import$1
596
- await fsPromises.rename(self_, path_)
594
+
595
+ const fsPromises = import$1
596
+ await fsPromises.rename(self_, path_)
597
597
 
598
598
  }
599
599
 
600
600
  export async function Path_readText$(self_, $task) {
601
-
602
- const fsPromises = import$1
603
- try {
604
- return await fsPromises.readFile(self_, {encoding: 'UTF-8', signal: $task.controller.signal})
605
- } finally {
606
- if($task.controller.signal.aborted) $task.controller = new AbortController()
607
- }
601
+
602
+ const fsPromises = import$1
603
+ try {
604
+ return await fsPromises.readFile(self_, {encoding: 'UTF-8', signal: $task.controller.signal})
605
+ } finally {
606
+ if($task.controller.signal.aborted) $task.controller = new AbortController()
607
+ }
608
608
 
609
609
  }
610
610
 
611
611
  export async function Path_writeText$(self_, text_, $task) {
612
-
613
- const fsPromises = import$1
614
- try {
615
- await fsPromises.writeFile(self_, text_, {encoding: 'UTF-8', signal: $task.controller.signal})
616
- } finally {
617
- if($task.controller.signal.aborted) $task.controller = new AbortController()
618
- }
612
+
613
+ const fsPromises = import$1
614
+ try {
615
+ await fsPromises.writeFile(self_, text_, {encoding: 'UTF-8', signal: $task.controller.signal})
616
+ } finally {
617
+ if($task.controller.signal.aborted) $task.controller = new AbortController()
618
+ }
619
619
 
620
620
  }
621
621
 
622
622
  export async function Path_appendText$(self_, text_, $task) {
623
-
624
- const fsPromises = import$1
625
- try {
626
- await fsPromises.appendFile(self_, text_, {encoding: 'UTF-8', signal: $task.controller.signal})
627
- } finally {
628
- if($task.controller.signal.aborted) $task.controller = new AbortController()
629
- }
623
+
624
+ const fsPromises = import$1
625
+ try {
626
+ await fsPromises.appendFile(self_, text_, {encoding: 'UTF-8', signal: $task.controller.signal})
627
+ } finally {
628
+ if($task.controller.signal.aborted) $task.controller = new AbortController()
629
+ }
630
630
 
631
631
  }
632
632
 
@@ -643,78 +643,78 @@ export async function Path_appendBuffer$(self_, buffer_, $task) {
643
643
  }
644
644
 
645
645
  export async function Path_readStream$(self_, $task) {
646
-
647
- const fs = import$0
648
- return ff_core_Path.internalReadStream_$(() => fs.createReadStream(self_))
646
+
647
+ const fs = import$0
648
+ return ff_core_Path.internalReadStream_$(() => fs.createReadStream(self_))
649
649
 
650
650
  }
651
651
 
652
652
  export async function Path_writeStream$(self_, stream_, createOnly_ = false, $task) {
653
-
654
- const fs = import$0
655
- let writeable = fs.createWriteStream(self_, {flags: createOnly_ ? 'wx' : 'w'})
656
- try {
657
- await ff_core_Stream.Stream_each$(stream_, async buffer => {
658
- if(!writeable.write(new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength))) {
659
- await new Promise((resolve, reject) => {
660
- $task.controller.signal.addEventListener('abort', reject)
661
- writeable.once('drain', () => {
662
- $task.controller.signal.removeEventListener('abort', reject)
663
- resolve()
664
- })
665
- })
666
- }
667
- }, $task)
668
- } finally {
669
- await new Promise((resolve, reject) => {
670
- writeable.close(err => {if(err) reject(err); else resolve();});
671
- });
672
- }
653
+
654
+ const fs = import$0
655
+ let writeable = fs.createWriteStream(self_, {flags: createOnly_ ? 'wx' : 'w'})
656
+ try {
657
+ await ff_core_Stream.Stream_each$(stream_, async buffer => {
658
+ if(!writeable.write(new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength))) {
659
+ await new Promise((resolve, reject) => {
660
+ $task.controller.signal.addEventListener('abort', reject)
661
+ writeable.once('drain', () => {
662
+ $task.controller.signal.removeEventListener('abort', reject)
663
+ resolve()
664
+ })
665
+ })
666
+ }
667
+ }, $task)
668
+ } finally {
669
+ await new Promise((resolve, reject) => {
670
+ writeable.close(err => {if(err) reject(err); else resolve();});
671
+ });
672
+ }
673
673
 
674
674
  }
675
675
 
676
676
  export async function Path_appendStream$(self_, stream_, $task) {
677
-
678
- const fs = import$0
679
- let writeable = fs.createWriteStream(self_, {flags: 'a'})
680
- try {
681
- await ff_core_Stream.Stream_each$(stream_, async buffer => {
682
- if(!writeable.write(new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength))) {
683
- await new Promise((resolve, reject) => {
684
- $task.controller.signal.addEventListener('abort', reject)
685
- writeable.once('drain', () => {
686
- $task.controller.signal.removeEventListener('abort', reject)
687
- resolve()
688
- })
689
- })
690
- }
691
- }, $task)
692
- } finally {
693
- await new Promise((resolve, reject) => {
694
- writeable.close(err => {if(err) reject(err); else resolve();});
695
- });
696
- }
677
+
678
+ const fs = import$0
679
+ let writeable = fs.createWriteStream(self_, {flags: 'a'})
680
+ try {
681
+ await ff_core_Stream.Stream_each$(stream_, async buffer => {
682
+ if(!writeable.write(new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength))) {
683
+ await new Promise((resolve, reject) => {
684
+ $task.controller.signal.addEventListener('abort', reject)
685
+ writeable.once('drain', () => {
686
+ $task.controller.signal.removeEventListener('abort', reject)
687
+ resolve()
688
+ })
689
+ })
690
+ }
691
+ }, $task)
692
+ } finally {
693
+ await new Promise((resolve, reject) => {
694
+ writeable.close(err => {if(err) reject(err); else resolve();});
695
+ });
696
+ }
697
697
 
698
698
  }
699
699
 
700
700
  export async function Path_readHandle$(self_, alsoWrite_ = false, $task) {
701
-
702
- const fsPromises = import$1
703
- return await fsPromises.open(self_, alsoWrite_ ? 'r+' : 'r')
701
+
702
+ const fsPromises = import$1
703
+ return await fsPromises.open(self_, alsoWrite_ ? 'r+' : 'r')
704
704
 
705
705
  }
706
706
 
707
707
  export async function Path_writeHandle$(self_, alsoRead_ = false, mustCreate_ = false, $task) {
708
-
709
- const fsPromises = import$1
710
- return await fsPromises.open(self_, (mustCreate_ ? 'wx' : 'w') + (alsoRead_ ? '+' : ''))
708
+
709
+ const fsPromises = import$1
710
+ return await fsPromises.open(self_, (mustCreate_ ? 'wx' : 'w') + (alsoRead_ ? '+' : ''))
711
711
 
712
712
  }
713
713
 
714
714
  export async function Path_appendHandle$(self_, alsoRead_ = false, mustCreate_ = false, $task) {
715
-
716
- const fsPromises = import$1
717
- return await fsPromises.open(self_, (mustCreate_ ? 'wx' : 'w') + (alsoRead_ ? '+' : ''))
715
+
716
+ const fsPromises = import$1
717
+ return await fsPromises.open(self_, (mustCreate_ ? 'wx' : 'w') + (alsoRead_ ? '+' : ''))
718
718
 
719
719
  }
720
720
 
@@ -735,27 +735,27 @@ throw new Error('Function PathEntry_isSymbolicLink is missing on this target in
735
735
  }
736
736
 
737
737
  export async function PathEntry_path$(self_, $task) {
738
-
739
- const path = import$2
740
- return path.join(self_.ffPath, self_.name)
738
+
739
+ const path = import$2
740
+ return path.join(self_.ffPath, self_.name)
741
741
 
742
742
  }
743
743
 
744
744
  export async function PathEntry_isDirectory$(self_, $task) {
745
-
746
- return self_.isDirectory()
745
+
746
+ return self_.isDirectory()
747
747
 
748
748
  }
749
749
 
750
750
  export async function PathEntry_isFile$(self_, $task) {
751
-
752
- return self_.isFile()
751
+
752
+ return self_.isFile()
753
753
 
754
754
  }
755
755
 
756
756
  export async function PathEntry_isSymbolicLink$(self_, $task) {
757
-
758
- return self_.isSymbolicLink()
757
+
758
+ return self_.isSymbolicLink()
759
759
 
760
760
  }
761
761