firefly-compiler 0.5.35 → 0.5.37

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 (225) hide show
  1. package/.hintrc +4 -4
  2. package/.vscode/settings.json +4 -4
  3. package/bin/Release.ff +157 -154
  4. package/bin/firefly.mjs +1 -1
  5. package/compiler/Builder.ff +275 -277
  6. package/compiler/Compiler.ff +234 -233
  7. package/compiler/Dependencies.ff +186 -187
  8. package/compiler/DependencyLock.ff +17 -17
  9. package/compiler/Deriver.ff +23 -31
  10. package/compiler/Dictionaries.ff +1 -1
  11. package/compiler/Inference.ff +43 -20
  12. package/compiler/JsEmitter.ff +1437 -1282
  13. package/compiler/LspHook.ff +202 -202
  14. package/compiler/Main.ff +25 -24
  15. package/compiler/ModuleCache.ff +178 -178
  16. package/compiler/Parser.ff +36 -109
  17. package/compiler/Resolver.ff +5 -8
  18. package/compiler/Substitution.ff +1 -1
  19. package/compiler/Syntax.ff +1 -16
  20. package/compiler/Token.ff +9 -0
  21. package/compiler/Tokenizer.ff +4 -0
  22. package/compiler/Workspace.ff +88 -88
  23. package/core/.firefly/include/package.json +5 -5
  24. package/core/.firefly/package.ff +2 -2
  25. package/core/Any.ff +26 -30
  26. package/core/Array.ff +298 -265
  27. package/core/Atomic.ff +63 -64
  28. package/core/Box.ff +7 -7
  29. package/core/BrowserSystem.ff +40 -40
  30. package/core/Buffer.ff +185 -152
  31. package/core/BuildSystem.ff +156 -148
  32. package/core/Channel.ff +95 -92
  33. package/core/Char.ff +3 -2
  34. package/core/Core.ff +16 -23
  35. package/core/Crypto.ff +94 -96
  36. package/core/Equal.ff +41 -36
  37. package/core/Error.ff +15 -10
  38. package/core/FileHandle.ff +45 -37
  39. package/core/Float.ff +176 -200
  40. package/core/HttpClient.ff +142 -148
  41. package/core/Instant.ff +6 -8
  42. package/core/Int.ff +40 -24
  43. package/core/IntMap.ff +61 -39
  44. package/core/Js.ff +305 -0
  45. package/core/JsSystem.ff +135 -114
  46. package/core/JsValue.ff +303 -159
  47. package/core/Json.ff +423 -443
  48. package/core/List.ff +482 -486
  49. package/core/Lock.ff +108 -144
  50. package/core/Log.ff +25 -14
  51. package/core/NodeSystem.ff +198 -191
  52. package/core/Ordering.ff +160 -161
  53. package/core/Path.ff +377 -409
  54. package/core/Queue.ff +90 -0
  55. package/core/Random.ff +140 -134
  56. package/core/RbMap.ff +216 -216
  57. package/core/Serializable.ff +16 -13
  58. package/core/Show.ff +44 -43
  59. package/core/SourceLocation.ff +68 -68
  60. package/core/Stream.ff +1 -1
  61. package/core/String.ff +224 -202
  62. package/core/StringMap.ff +58 -36
  63. package/core/Task.ff +165 -149
  64. package/experimental/benchmarks/ListGrab.ff +23 -23
  65. package/experimental/benchmarks/ListGrab.java +55 -55
  66. package/experimental/benchmarks/Pyrotek45.ff +30 -30
  67. package/experimental/benchmarks/Pyrotek45.java +64 -64
  68. package/experimental/bidirectional/Bidi.ff +88 -88
  69. package/experimental/lines/Main.ff +40 -0
  70. package/experimental/random/Index.ff +53 -53
  71. package/experimental/random/Process.ff +120 -120
  72. package/experimental/random/RunLength.ff +65 -65
  73. package/experimental/random/Scrape.ff +51 -51
  74. package/experimental/random/Symbols.ff +73 -73
  75. package/experimental/random/Tensor.ff +52 -52
  76. package/experimental/random/Units.ff +36 -36
  77. package/experimental/s3/S3TestAuthorizationHeader.ff +39 -39
  78. package/experimental/s3/S3TestPut.ff +16 -16
  79. package/experimental/tests/TestJson.ff +26 -26
  80. package/firefly.sh +0 -0
  81. package/fireflysite/.firefly/package.ff +4 -4
  82. package/fireflysite/CommunityOverview.ff +20 -20
  83. package/fireflysite/CountingButtonDemo.ff +58 -58
  84. package/fireflysite/DocumentParser.ff +325 -331
  85. package/fireflysite/ExamplesOverview.ff +40 -40
  86. package/fireflysite/FrontPage.ff +344 -344
  87. package/fireflysite/GettingStarted.ff +45 -45
  88. package/fireflysite/Guide.ff +456 -456
  89. package/fireflysite/Main.ff +163 -152
  90. package/fireflysite/MatchingPasswordsDemo.ff +82 -82
  91. package/fireflysite/PackagesOverview.ff +49 -49
  92. package/fireflysite/PostgresqlDemo.ff +34 -34
  93. package/fireflysite/ReferenceAll.ff +18 -18
  94. package/fireflysite/ReferenceIntroduction.ff +11 -11
  95. package/fireflysite/Styles.ff +567 -567
  96. package/fireflysite/Test.ff +121 -62
  97. package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -209
  98. package/fireflysite/assets/markdown/reference/EmittedJavascript.md +65 -65
  99. package/fireflysite/assets/markdown/reference/Exceptions.md +101 -101
  100. package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +364 -364
  101. package/fireflysite/assets/markdown/reference/JavascriptInterop.md +235 -172
  102. package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +162 -162
  103. package/fireflysite/assets/markdown/reference/OldStructuredConcurrency.md +48 -48
  104. package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -224
  105. package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -86
  106. package/fireflysite/assets/markdown/reference/StructuredConcurrency.md +99 -99
  107. package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -100
  108. package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -184
  109. package/fireflysite/assets/markdown/scratch/ControlFlow.md +136 -136
  110. package/fireflysite/assets/markdown/scratch/Toc.md +40 -40
  111. package/lsp/.firefly/package.ff +1 -1
  112. package/lsp/CompletionHandler.ff +827 -827
  113. package/lsp/Handler.ff +714 -714
  114. package/lsp/HoverHandler.ff +79 -79
  115. package/lsp/LanguageServer.ff +272 -272
  116. package/lsp/SignatureHelpHandler.ff +55 -55
  117. package/lsp/SymbolHandler.ff +181 -181
  118. package/lsp/TestReferences.ff +17 -17
  119. package/lsp/TestReferencesCase.ff +7 -7
  120. package/lsp/stderr.txt +1 -1
  121. package/lsp/stdout.txt +34 -34
  122. package/lux/.firefly/package.ff +1 -1
  123. package/lux/Css.ff +648 -648
  124. package/lux/CssTest.ff +48 -48
  125. package/lux/Lux.ff +608 -617
  126. package/lux/LuxEvent.ff +79 -116
  127. package/lux/Main.ff +123 -123
  128. package/lux/Main2.ff +143 -143
  129. package/lux/TestDry.ff +28 -28
  130. package/output/js/ff/compiler/Builder.mjs +72 -71
  131. package/output/js/ff/compiler/Compiler.mjs +19 -13
  132. package/output/js/ff/compiler/Dependencies.mjs +8 -7
  133. package/output/js/ff/compiler/DependencyLock.mjs +6 -4
  134. package/output/js/ff/compiler/Deriver.mjs +26 -24
  135. package/output/js/ff/compiler/Dictionaries.mjs +14 -18
  136. package/output/js/ff/compiler/Environment.mjs +6 -4
  137. package/output/js/ff/compiler/Inference.mjs +238 -164
  138. package/output/js/ff/compiler/JsEmitter.mjs +1160 -350
  139. package/output/js/ff/compiler/JsImporter.mjs +20 -18
  140. package/output/js/ff/compiler/LspHook.mjs +12 -10
  141. package/output/js/ff/compiler/Main.mjs +61 -41
  142. package/output/js/ff/compiler/ModuleCache.mjs +10 -8
  143. package/output/js/ff/compiler/Parser.mjs +153 -669
  144. package/output/js/ff/compiler/Patterns.mjs +12 -10
  145. package/output/js/ff/compiler/Resolver.mjs +52 -78
  146. package/output/js/ff/compiler/Substitution.mjs +12 -16
  147. package/output/js/ff/compiler/Syntax.mjs +50 -341
  148. package/output/js/ff/compiler/Token.mjs +126 -4
  149. package/output/js/ff/compiler/Tokenizer.mjs +62 -52
  150. package/output/js/ff/compiler/Unification.mjs +74 -90
  151. package/output/js/ff/compiler/Wildcards.mjs +4 -2
  152. package/output/js/ff/compiler/Workspace.mjs +26 -20
  153. package/output/js/ff/core/Any.mjs +20 -20
  154. package/output/js/ff/core/Array.mjs +268 -175
  155. package/output/js/ff/core/AssetSystem.mjs +8 -6
  156. package/output/js/ff/core/Atomic.mjs +84 -52
  157. package/output/js/ff/core/Bool.mjs +6 -4
  158. package/output/js/ff/core/BrowserSystem.mjs +38 -29
  159. package/output/js/ff/core/Buffer.mjs +285 -133
  160. package/output/js/ff/core/BuildSystem.mjs +36 -56
  161. package/output/js/ff/core/Channel.mjs +250 -97
  162. package/output/js/ff/core/Char.mjs +5 -3
  163. package/output/js/ff/core/Core.mjs +28 -34
  164. package/output/js/ff/core/Crypto.mjs +30 -52
  165. package/output/js/ff/core/Duration.mjs +4 -2
  166. package/output/js/ff/core/Equal.mjs +14 -12
  167. package/output/js/ff/core/Error.mjs +17 -11
  168. package/output/js/ff/core/FileHandle.mjs +76 -38
  169. package/output/js/ff/core/Float.mjs +92 -160
  170. package/output/js/ff/core/HttpClient.mjs +208 -76
  171. package/output/js/ff/core/Instant.mjs +8 -10
  172. package/output/js/ff/core/Int.mjs +36 -26
  173. package/output/js/ff/core/IntMap.mjs +79 -33
  174. package/output/js/ff/core/Js.mjs +751 -0
  175. package/output/js/ff/core/JsSystem.mjs +54 -60
  176. package/output/js/ff/core/JsValue.mjs +294 -143
  177. package/output/js/ff/core/Json.mjs +443 -253
  178. package/output/js/ff/core/List.mjs +262 -214
  179. package/output/js/ff/core/Lock.mjs +156 -125
  180. package/output/js/ff/core/Log.mjs +20 -10
  181. package/output/js/ff/core/Map.mjs +10 -8
  182. package/output/js/ff/core/NodeSystem.mjs +189 -123
  183. package/output/js/ff/core/Nothing.mjs +4 -2
  184. package/output/js/ff/core/Option.mjs +40 -38
  185. package/output/js/ff/core/Ordering.mjs +26 -20
  186. package/output/js/ff/core/Pair.mjs +4 -2
  187. package/output/js/ff/core/Path.mjs +517 -315
  188. package/output/js/ff/core/Queue.mjs +306 -0
  189. package/output/js/ff/core/Random.mjs +141 -77
  190. package/output/js/ff/core/RbMap.mjs +36 -34
  191. package/output/js/ff/core/Serializable.mjs +44 -28
  192. package/output/js/ff/core/Set.mjs +6 -4
  193. package/output/js/ff/core/Show.mjs +8 -6
  194. package/output/js/ff/core/SourceLocation.mjs +4 -2
  195. package/output/js/ff/core/Stream.mjs +30 -50
  196. package/output/js/ff/core/String.mjs +263 -172
  197. package/output/js/ff/core/StringMap.mjs +77 -31
  198. package/output/js/ff/core/Task.mjs +91 -76
  199. package/output/js/ff/core/Try.mjs +20 -18
  200. package/output/js/ff/core/Unit.mjs +4 -2
  201. package/package.json +1 -1
  202. package/postgresql/Pg.ff +53 -59
  203. package/rpc/.firefly/package.ff +1 -1
  204. package/rpc/Rpc.ff +70 -70
  205. package/s3/.firefly/package.ff +1 -1
  206. package/s3/S3.ff +92 -94
  207. package/vscode/LICENSE.txt +21 -21
  208. package/vscode/Prepublish.ff +15 -15
  209. package/vscode/README.md +16 -16
  210. package/vscode/client/package-lock.json +544 -544
  211. package/vscode/client/package.json +22 -22
  212. package/vscode/client/src/extension.ts +104 -104
  213. package/vscode/icons/firefly-icon.svg +10 -10
  214. package/vscode/language-configuration.json +61 -61
  215. package/vscode/package-lock.json +3623 -3623
  216. package/vscode/package.json +1 -1
  217. package/vscode/snippets.json +241 -241
  218. package/vscode/syntaxes/firefly-markdown-injection.json +45 -45
  219. package/webserver/.firefly/include/package.json +5 -5
  220. package/webserver/.firefly/package.ff +2 -2
  221. package/webserver/WebServer.ff +647 -685
  222. package/websocket/.firefly/package.ff +1 -1
  223. package/websocket/WebSocket.ff +100 -131
  224. package/core/UnsafeJs.ff +0 -42
  225. package/output/js/ff/core/UnsafeJs.mjs +0 -191
@@ -42,6 +42,8 @@ import * as ff_core_Int from "../../ff/core/Int.mjs"
42
42
 
43
43
  import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
44
44
 
45
+ import * as ff_core_Js from "../../ff/core/Js.mjs"
46
+
45
47
  import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
48
 
47
49
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
@@ -68,6 +70,8 @@ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
68
70
 
69
71
  import * as ff_core_Path from "../../ff/core/Path.mjs"
70
72
 
73
+ import * as ff_core_Queue from "../../ff/core/Queue.mjs"
74
+
71
75
  import * as ff_core_Random from "../../ff/core/Random.mjs"
72
76
 
73
77
  import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
@@ -90,8 +94,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
90
94
 
91
95
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
92
96
 
93
- import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
94
-
95
97
  // type JsValue
96
98
 
97
99
 
@@ -102,67 +104,84 @@ import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
102
104
 
103
105
 
104
106
  export function JsValue_grabString(self_) {
107
+ if((!ff_core_JsValue.JsValue_isString(self_))) {
108
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
109
+ };
105
110
  return self_
106
111
  }
107
112
 
108
113
  export function JsValue_grabChar(self_) {
114
+ if((!ff_core_JsValue.JsValue_isChar(self_))) {
115
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
116
+ };
109
117
  return self_
110
118
  }
111
119
 
112
120
  export function JsValue_grabInt(self_) {
121
+ if((!ff_core_JsValue.JsValue_isInt(self_))) {
122
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
123
+ };
113
124
  return self_
114
125
  }
115
126
 
116
127
  export function JsValue_grabFloat(self_) {
128
+ if((!ff_core_JsValue.JsValue_isFloat(self_))) {
129
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
130
+ };
117
131
  return self_
118
132
  }
119
133
 
120
134
  export function JsValue_grabBool(self_) {
135
+ if((!ff_core_JsValue.JsValue_isBool(self_))) {
136
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
137
+ };
121
138
  return self_
122
139
  }
123
140
 
124
141
  export function JsValue_grabArray(self_) {
142
+ if((!ff_core_JsValue.JsValue_isArray(self_))) {
143
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
144
+ };
125
145
  return self_
126
146
  }
127
147
 
128
148
  export function JsValue_grabBuffer(self_) {
129
-
130
- if(!(self_ instanceof DataView)) throw new Error('Expected buffer, got '+ typeof self_);
131
- return self_
132
-
149
+ if((!ff_core_JsValue.JsValue_isBuffer(self_))) {
150
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
151
+ };
152
+ return self_
133
153
  }
134
154
 
135
155
  export function JsValue_grabJson(self_) {
136
-
137
- return self_
138
-
156
+ return self_
139
157
  }
140
158
 
141
159
  export function JsValue_equals(self_, value_, ff_core_JsValue_IsJsValue$V) {
142
- return self_ === value_
160
+ return (self_ === value_)
161
+ }
162
+
163
+ export function JsValue_notEquals(self_, value_, ff_core_JsValue_IsJsValue$V) {
164
+ return (self_ !== value_)
143
165
  }
144
166
 
145
167
  export function JsValue_isString(self_) {
146
- return typeof self_ === 'string'
168
+ return ((typeof self_) === "string")
147
169
  }
148
170
 
149
171
  export function JsValue_isChar(self_) {
150
-
151
- return Number.isInteger(self_) && Math.abs(self_) <= Number.MAX_SAFE_INTEGER
152
- && self_ >= 0 && self_ < 1114112
153
-
172
+ return (((Number.isInteger(self_) && ff_core_Ordering.notAfter_(Math.abs(self_), Number["MAX_SAFE_INTEGER"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Nothing_Nothing)) && (self_ >= 0)) && (self_ < 1114112))
154
173
  }
155
174
 
156
175
  export function JsValue_isInt(self_) {
157
- return Number.isInteger(self_) && Math.abs(self_) <= Number.MAX_SAFE_INTEGER
176
+ return (Number.isInteger(self_) && ff_core_Ordering.notAfter_(Math.abs(self_), Number["MAX_SAFE_INTEGER"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Nothing_Nothing))
158
177
  }
159
178
 
160
179
  export function JsValue_isFloat(self_) {
161
- return typeof self_ === 'number'
180
+ return ((typeof self_) === "number")
162
181
  }
163
182
 
164
183
  export function JsValue_isBool(self_) {
165
- return typeof self_ === 'boolean'
184
+ return ((typeof self_) === "boolean")
166
185
  }
167
186
 
168
187
  export function JsValue_isArray(self_) {
@@ -170,31 +189,35 @@ return Array.isArray(self_)
170
189
  }
171
190
 
172
191
  export function JsValue_isObject(self_) {
173
- return self_ != null && typeof self_ === 'object'
192
+ return ((!ff_core_JsValue.JsValue_isNull(self_)) && ((typeof self_) === "object"))
174
193
  }
175
194
 
176
195
  export function JsValue_isFunction(self_) {
177
- return typeof self_ === 'function'
196
+ return ((typeof self_) === "function")
197
+ }
198
+
199
+ export function JsValue_isBuffer(self_) {
200
+ return (self_ instanceof DataView)
178
201
  }
179
202
 
180
203
  export function JsValue_isNull(self_) {
181
- return self_ === null
204
+ return (self_ === null)
182
205
  }
183
206
 
184
207
  export function JsValue_isUndefined(self_) {
185
- return typeof self_ === 'undefined'
208
+ return (self_ === (void 0))
186
209
  }
187
210
 
188
211
  export function JsValue_isNullOrUndefined(self_) {
189
- return self_ == null
212
+ return (ff_core_JsValue.JsValue_isNull(self_) || ff_core_JsValue.JsValue_isUndefined(self_))
190
213
  }
191
214
 
192
215
  export function JsValue_isNan(self_) {
193
- return typeof self_ === 'number' && self_ !== self_
216
+ return (((typeof self_) === "number") && (self_ !== self_))
194
217
  }
195
218
 
196
219
  export function JsValue_isFinite(self_) {
197
- return typeof self_ === 'number' && isFinite(self_)
220
+ return (((typeof self_) === "number") && isFinite(self_))
198
221
  }
199
222
 
200
223
  export function JsValue_get(self_, key_, ff_core_JsValue_IsJsValue$K) {
@@ -222,7 +245,7 @@ self_[key_] -= value_
222
245
  }
223
246
 
224
247
  export function JsValue_delete(self_, key_, ff_core_JsValue_IsJsValue$K) {
225
- delete self_[key_]
248
+ ff_core_JsValue.JsValue_delete(self_, key_, ff_core_JsValue_IsJsValue$K)
226
249
  }
227
250
 
228
251
  export function JsValue_with(self_, key_, value_, ff_core_JsValue_IsJsValue$K, ff_core_JsValue_IsJsValue$V) {
@@ -234,59 +257,70 @@ return Object.prototype.hasOwnProperty.call(self_, name_)
234
257
  }
235
258
 
236
259
  export function JsValue_assign(self_, source_, source2_ = source_) {
237
- return Object.assign(self_, source_, source2_ !== source_ ? source2_ : null)
260
+ return Object.assign(self_, source_, ((source2_ !== source_)
261
+ ? source2_
262
+ : null))
238
263
  }
239
264
 
240
265
  export function JsValue_each(self_, body_) {
241
- for(const value of self_) body_(value)
266
+ const iterator_ = self_[Symbol.iterator]();
267
+ let result_ = iterator_.next();
268
+ while((!result_.done)) {
269
+ body_(result_.value);
270
+ result_ = iterator_.next()
271
+ }
242
272
  }
243
273
 
244
274
  export function JsValue_eachWhile(self_, body_) {
245
- for(const value of self_) if(!body_(value)) break
275
+ const iterator_ = self_[Symbol.iterator]();
276
+ let result_ = iterator_.next();
277
+ while(((!result_.done) && body_(result_.value))) {
278
+ result_ = iterator_.next()
279
+ }
246
280
  }
247
281
 
248
282
  export function JsValue_call(self_, name_, arguments_, ff_core_JsValue_IsJsValue$A0) {
249
- return self_[name_].apply(this_, arguments_)
283
+ return self_[name_].apply(self_, arguments_)
250
284
  }
251
285
 
252
286
  export function JsValue_call0(self_, name_, ff_core_JsValue_IsJsValue$A0) {
253
- return self_[name_].call(self_)
287
+ return self_[name_]()
254
288
  }
255
289
 
256
290
  export function JsValue_call1(self_, name_, a1_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1) {
257
- return self_[name_].call(self_, a1_)
291
+ return self_[name_](a1_)
258
292
  }
259
293
 
260
294
  export function JsValue_call2(self_, name_, a1_, a2_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2) {
261
- return self_[name_].call(self_, a1_, a2_)
295
+ return self_[name_](a1_, a2_)
262
296
  }
263
297
 
264
298
  export function JsValue_call3(self_, name_, a1_, a2_, a3_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3) {
265
- return self_[name_].call(self_, a1_, a2_, a3_)
299
+ return self_[name_](a1_, a2_, a3_)
266
300
  }
267
301
 
268
302
  export function JsValue_call4(self_, name_, a1_, a2_, a3_, a4_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4) {
269
- return self_[name_].call(self_, a1_, a2_, a3_, a4_)
303
+ return self_[name_](a1_, a2_, a3_, a4_)
270
304
  }
271
305
 
272
306
  export function JsValue_call5(self_, name_, a1_, a2_, a3_, a4_, a5_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5) {
273
- return self_[name_].call(self_, a1_, a2_, a3_, a4_, a5_)
307
+ return self_[name_](a1_, a2_, a3_, a4_, a5_)
274
308
  }
275
309
 
276
310
  export function JsValue_call6(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6) {
277
- return self_[name_].call(self_, a1_, a2_, a3_, a4_, a5_, a6_)
311
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_)
278
312
  }
279
313
 
280
314
  export function JsValue_call7(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7) {
281
- return self_[name_].call(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_)
315
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_, a7_)
282
316
  }
283
317
 
284
318
  export function JsValue_call8(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8) {
285
- return self_[name_].call(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_)
319
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_)
286
320
  }
287
321
 
288
322
  export function JsValue_call9(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9) {
289
- return self_[name_].call(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
323
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
290
324
  }
291
325
 
292
326
  export function JsValue_callValue(self_, this_, arguments_) {
@@ -294,94 +328,96 @@ return self_.apply(this_, arguments_)
294
328
  }
295
329
 
296
330
  export function JsValue_callValue0(self_) {
297
- return self_.call(void 0)
331
+ return self_()
298
332
  }
299
333
 
300
334
  export function JsValue_callValue1(self_, a1_, ff_core_JsValue_IsJsValue$A1) {
301
- return self_.call(void 0, a1_)
335
+ return self_(a1_)
302
336
  }
303
337
 
304
338
  export function JsValue_callValue2(self_, a1_, a2_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2) {
305
- return self_.call(void 0, a1_, a2_)
339
+ return self_(a1_, a2_)
306
340
  }
307
341
 
308
342
  export function JsValue_callValue3(self_, a1_, a2_, a3_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3) {
309
- return self_.call(void 0, a1_, a2_, a3_)
343
+ return self_(a1_, a2_, a3_)
310
344
  }
311
345
 
312
346
  export function JsValue_callValue4(self_, a1_, a2_, a3_, a4_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4) {
313
- return self_.call(void 0, a1_, a2_, a3_, a4_)
347
+ return self_(a1_, a2_, a3_, a4_)
314
348
  }
315
349
 
316
350
  export function JsValue_callValue5(self_, a1_, a2_, a3_, a4_, a5_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5) {
317
- return self_.call(void 0, a1_, a2_, a3_, a4_, a5_)
351
+ return self_(a1_, a2_, a3_, a4_, a5_)
318
352
  }
319
353
 
320
354
  export function JsValue_callValue6(self_, a1_, a2_, a3_, a4_, a5_, a6_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6) {
321
- return self_.call(void 0, a1_, a2_, a3_, a4_, a5_, a6_)
355
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_)
322
356
  }
323
357
 
324
358
  export function JsValue_callValue7(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7) {
325
- return self_.call(void 0, a1_, a2_, a3_, a4_, a5_, a6_, a7_)
359
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_)
326
360
  }
327
361
 
328
362
  export function JsValue_callValue8(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8) {
329
- return self_.call(void 0, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_)
363
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_)
330
364
  }
331
365
 
332
366
  export function JsValue_callValue9(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9) {
333
- return self_.call(void 0, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
367
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
334
368
  }
335
369
 
336
- export function JsValue_new(self_, this_, arguments_) {
337
- return new (Function.prototype.bind.apply(self_, arguments_))
370
+ export function JsValue_new(self_, arguments_) {
371
+ return (new Function.prototype.bind.apply(self_, arguments_))
338
372
  }
339
373
 
340
374
  export function JsValue_new0(self_) {
341
- return new self_()
375
+ return (new self_())
342
376
  }
343
377
 
344
378
  export function JsValue_new1(self_, a1_, ff_core_JsValue_IsJsValue$A1) {
345
- return new self_(a1_)
379
+ return (new self_(a1_))
346
380
  }
347
381
 
348
382
  export function JsValue_new2(self_, a1_, a2_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2) {
349
- return new self_(a1_, a2_)
383
+ return (new self_(a1_, a2_))
350
384
  }
351
385
 
352
386
  export function JsValue_new3(self_, a1_, a2_, a3_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3) {
353
- return new self_(a1_, a2_, a3_)
387
+ return (new self_(a1_, a2_, a3_))
354
388
  }
355
389
 
356
390
  export function JsValue_new4(self_, a1_, a2_, a3_, a4_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4) {
357
- return new self_(a1_, a2_, a3_, a4_)
391
+ return (new self_(a1_, a2_, a3_, a4_))
358
392
  }
359
393
 
360
394
  export function JsValue_new5(self_, a1_, a2_, a3_, a4_, a5_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5) {
361
- return new self_(a1_, a2_, a3_, a4_, a5_)
395
+ return (new self_(a1_, a2_, a3_, a4_, a5_))
362
396
  }
363
397
 
364
398
  export function JsValue_new6(self_, a1_, a2_, a3_, a4_, a5_, a6_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6) {
365
- return new self_(a1_, a2_, a3_, a4_, a5_, a6_)
399
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_))
366
400
  }
367
401
 
368
402
  export function JsValue_new7(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7) {
369
- return new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_)
403
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_))
370
404
  }
371
405
 
372
406
  export function JsValue_new8(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8) {
373
- return new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_)
407
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_))
374
408
  }
375
409
 
376
410
  export function JsValue_new9(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9) {
377
- return new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
411
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_))
378
412
  }
379
413
 
380
414
  export function JsValue_grabPairs(self_) {
381
-
382
- if(!(self_ instanceof Object)) throw new Error('Expected object, got '+ typeof self_);;
383
- return Object.getOwnPropertyNames(self_).map((name, i) => ff_core_Pair.Pair(name, self_[name]));
384
-
415
+ if((!ff_core_JsValue.JsValue_isObject(self_))) {
416
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
417
+ };
418
+ return Object.getOwnPropertyNames(self_).map(((name_, i_) => {
419
+ return ff_core_Pair.Pair(name_, self_[name_])
420
+ }))
385
421
  }
386
422
 
387
423
  export function JsValue_grabMap(self_) {
@@ -389,109 +425,170 @@ return ff_core_List.List_toMap(ff_core_JsValue.JsValue_grabPairs(self_), ff_core
389
425
  }
390
426
 
391
427
  export function JsValue_grabIntMap(self_) {
392
-
393
- if(!(self_ instanceof Map)) throw new Error('Expected map, got '+ typeof self_);;
394
- return self_
395
-
428
+ if((!(self_ instanceof Map))) {
429
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
430
+ };
431
+ return self_
396
432
  }
397
433
 
398
434
  export function JsValue_grabStringMap(self_) {
399
-
400
- if(!(self_ instanceof Map)) throw new Error('Expected map, got '+ typeof self_);;
401
- return self_
402
-
435
+ if((!(self_ instanceof Map))) {
436
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
437
+ };
438
+ return self_
439
+ }
440
+
441
+ export function JsValue_spreadToArray(self_) {
442
+ return [...self_]
443
+ }
444
+
445
+ export function JsValue_coalesce(self_, defaultValue_, ff_core_JsValue_IsJsValue$T) {
446
+ if(ff_core_JsValue.JsValue_isNullOrUndefined(self_)) {
447
+ return defaultValue_
448
+ } else {
449
+ return self_
450
+ }
451
+ }
452
+
453
+ export function JsValue_typeof(self_) {
454
+ return (typeof self_)
455
+ }
456
+
457
+ export function JsValue_instanceof(self_, type_) {
458
+ return (self_ instanceof type_)
459
+ }
460
+
461
+ export function JsValue_truthy(self_) {
462
+ return (!!self_)
463
+ }
464
+
465
+ export function JsValue_falsy(self_) {
466
+ return (!self_)
467
+ }
468
+
469
+ export function JsValue_nullish(self_) {
470
+ return ff_core_JsValue.JsValue_isNullOrUndefined(self_)
403
471
  }
404
472
 
405
473
  export async function JsValue_grabString$(self_, $task) {
406
- throw new Error('Function JsValue_grabString is missing on this target in async context.');
474
+ if((!ff_core_JsValue.JsValue_isString(self_))) {
475
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
476
+ };
477
+ return self_
407
478
  }
408
479
 
409
480
  export async function JsValue_grabChar$(self_, $task) {
410
- throw new Error('Function JsValue_grabChar is missing on this target in async context.');
481
+ if((!ff_core_JsValue.JsValue_isChar(self_))) {
482
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
483
+ };
484
+ return self_
411
485
  }
412
486
 
413
487
  export async function JsValue_grabInt$(self_, $task) {
414
- throw new Error('Function JsValue_grabInt is missing on this target in async context.');
488
+ if((!ff_core_JsValue.JsValue_isInt(self_))) {
489
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
490
+ };
491
+ return self_
415
492
  }
416
493
 
417
494
  export async function JsValue_grabFloat$(self_, $task) {
418
- throw new Error('Function JsValue_grabFloat is missing on this target in async context.');
495
+ if((!ff_core_JsValue.JsValue_isFloat(self_))) {
496
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
497
+ };
498
+ return self_
419
499
  }
420
500
 
421
501
  export async function JsValue_grabBool$(self_, $task) {
422
- throw new Error('Function JsValue_grabBool is missing on this target in async context.');
502
+ if((!ff_core_JsValue.JsValue_isBool(self_))) {
503
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
504
+ };
505
+ return self_
423
506
  }
424
507
 
425
508
  export async function JsValue_grabArray$(self_, $task) {
426
- throw new Error('Function JsValue_grabArray is missing on this target in async context.');
509
+ if((!ff_core_JsValue.JsValue_isArray(self_))) {
510
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
511
+ };
512
+ return self_
427
513
  }
428
514
 
429
515
  export async function JsValue_grabBuffer$(self_, $task) {
430
- throw new Error('Function JsValue_grabBuffer is missing on this target in async context.');
516
+ if((!ff_core_JsValue.JsValue_isBuffer(self_))) {
517
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
518
+ };
519
+ return self_
431
520
  }
432
521
 
433
522
  export async function JsValue_grabJson$(self_, $task) {
434
- throw new Error('Function JsValue_grabJson is missing on this target in async context.');
523
+ return self_
435
524
  }
436
525
 
437
526
  export async function JsValue_equals$(self_, value_, ff_core_JsValue_IsJsValue$V, $task) {
438
- throw new Error('Function JsValue_equals is missing on this target in async context.');
527
+ return (self_ === value_)
528
+ }
529
+
530
+ export async function JsValue_notEquals$(self_, value_, ff_core_JsValue_IsJsValue$V, $task) {
531
+ return (self_ !== value_)
439
532
  }
440
533
 
441
534
  export async function JsValue_isString$(self_, $task) {
442
- throw new Error('Function JsValue_isString is missing on this target in async context.');
535
+ return ((typeof self_) === "string")
443
536
  }
444
537
 
445
538
  export async function JsValue_isChar$(self_, $task) {
446
- throw new Error('Function JsValue_isChar is missing on this target in async context.');
539
+ return (((Number.isInteger(self_) && ff_core_Ordering.notAfter_(Math.abs(self_), Number["MAX_SAFE_INTEGER"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Nothing_Nothing)) && (self_ >= 0)) && (self_ < 1114112))
447
540
  }
448
541
 
449
542
  export async function JsValue_isInt$(self_, $task) {
450
- throw new Error('Function JsValue_isInt is missing on this target in async context.');
543
+ return (Number.isInteger(self_) && ff_core_Ordering.notAfter_(Math.abs(self_), Number["MAX_SAFE_INTEGER"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_Nothing_Nothing))
451
544
  }
452
545
 
453
546
  export async function JsValue_isFloat$(self_, $task) {
454
- throw new Error('Function JsValue_isFloat is missing on this target in async context.');
547
+ return ((typeof self_) === "number")
455
548
  }
456
549
 
457
550
  export async function JsValue_isBool$(self_, $task) {
458
- throw new Error('Function JsValue_isBool is missing on this target in async context.');
551
+ return ((typeof self_) === "boolean")
459
552
  }
460
553
 
461
554
  export async function JsValue_isArray$(self_, $task) {
462
- throw new Error('Function JsValue_isArray is missing on this target in async context.');
555
+ return Array.isArray(self_)
463
556
  }
464
557
 
465
558
  export async function JsValue_isObject$(self_, $task) {
466
- throw new Error('Function JsValue_isObject is missing on this target in async context.');
559
+ return ((!ff_core_JsValue.JsValue_isNull(self_)) && ((typeof self_) === "object"))
467
560
  }
468
561
 
469
562
  export async function JsValue_isFunction$(self_, $task) {
470
- throw new Error('Function JsValue_isFunction is missing on this target in async context.');
563
+ return ((typeof self_) === "function")
564
+ }
565
+
566
+ export async function JsValue_isBuffer$(self_, $task) {
567
+ return (self_ instanceof DataView)
471
568
  }
472
569
 
473
570
  export async function JsValue_isNull$(self_, $task) {
474
- throw new Error('Function JsValue_isNull is missing on this target in async context.');
571
+ return (self_ === null)
475
572
  }
476
573
 
477
574
  export async function JsValue_isUndefined$(self_, $task) {
478
- throw new Error('Function JsValue_isUndefined is missing on this target in async context.');
575
+ return (self_ === (void 0))
479
576
  }
480
577
 
481
578
  export async function JsValue_isNullOrUndefined$(self_, $task) {
482
- throw new Error('Function JsValue_isNullOrUndefined is missing on this target in async context.');
579
+ return (ff_core_JsValue.JsValue_isNull(self_) || ff_core_JsValue.JsValue_isUndefined(self_))
483
580
  }
484
581
 
485
582
  export async function JsValue_isNan$(self_, $task) {
486
- throw new Error('Function JsValue_isNan is missing on this target in async context.');
583
+ return (((typeof self_) === "number") && (self_ !== self_))
487
584
  }
488
585
 
489
586
  export async function JsValue_isFinite$(self_, $task) {
490
- throw new Error('Function JsValue_isFinite is missing on this target in async context.');
587
+ return (((typeof self_) === "number") && isFinite(self_))
491
588
  }
492
589
 
493
590
  export async function JsValue_get$(self_, key_, ff_core_JsValue_IsJsValue$K, $task) {
494
- throw new Error('Function JsValue_get is missing on this target in async context.');
591
+ return self_[key_]
495
592
  }
496
593
 
497
594
  export async function JsValue_getOwn$(self_, key_, $task) {
@@ -503,175 +600,191 @@ return ff_core_Option.None()
503
600
  }
504
601
 
505
602
  export async function JsValue_set$(self_, key_, value_, ff_core_JsValue_IsJsValue$K, ff_core_JsValue_IsJsValue$V, $task) {
506
- throw new Error('Function JsValue_set is missing on this target in async context.');
603
+ self_[key_] = value_
507
604
  }
508
605
 
509
606
  export async function JsValue_increment$(self_, key_, value_, ff_core_JsValue_IsJsValue$K, ff_core_JsValue_IsJsValue$V, $task) {
510
- throw new Error('Function JsValue_increment is missing on this target in async context.');
607
+ self_[key_] += value_
511
608
  }
512
609
 
513
610
  export async function JsValue_decrement$(self_, key_, value_, ff_core_JsValue_IsJsValue$K, ff_core_JsValue_IsJsValue$V, $task) {
514
- throw new Error('Function JsValue_decrement is missing on this target in async context.');
611
+ self_[key_] -= value_
515
612
  }
516
613
 
517
614
  export async function JsValue_delete$(self_, key_, ff_core_JsValue_IsJsValue$K, $task) {
518
- throw new Error('Function JsValue_delete is missing on this target in async context.');
615
+ ff_core_JsValue.JsValue_delete(self_, key_, ff_core_JsValue_IsJsValue$K)
519
616
  }
520
617
 
521
618
  export async function JsValue_with$(self_, key_, value_, ff_core_JsValue_IsJsValue$K, ff_core_JsValue_IsJsValue$V, $task) {
522
- throw new Error('Function JsValue_with is missing on this target in async context.');
619
+ return {...self_, [key_]: value_}
523
620
  }
524
621
 
525
622
  export async function JsValue_hasOwn$(self_, name_, $task) {
526
- throw new Error('Function JsValue_hasOwn is missing on this target in async context.');
623
+ return Object.prototype.hasOwnProperty.call(self_, name_)
527
624
  }
528
625
 
529
626
  export async function JsValue_assign$(self_, source_, source2_ = source_, $task) {
530
- throw new Error('Function JsValue_assign is missing on this target in async context.');
627
+ return Object.assign(self_, source_, ((source2_ !== source_)
628
+ ? source2_
629
+ : null))
531
630
  }
532
631
 
533
632
  export async function JsValue_each$(self_, body_, $task) {
534
- for(const value of self_) await body_(value, $task)
633
+ const iterator_ = self_[Symbol.iterator]();
634
+ let result_ = iterator_.next();
635
+ while((!result_.done)) {
636
+ (await body_(result_.value, $task));
637
+ result_ = iterator_.next()
638
+ }
535
639
  }
536
640
 
537
641
  export async function JsValue_eachWhile$(self_, body_, $task) {
538
- for(const value of self_) if(!await body_(value, $task)) break
642
+ const iterator_ = self_[Symbol.iterator]();
643
+ let result_ = iterator_.next();
644
+ while(((!result_.done) && (await body_(result_.value, $task)))) {
645
+ result_ = iterator_.next()
646
+ }
539
647
  }
540
648
 
541
649
  export async function JsValue_call$(self_, name_, arguments_, ff_core_JsValue_IsJsValue$A0, $task) {
542
- throw new Error('Function JsValue_call is missing on this target in async context.');
650
+ return self_[name_].apply(self_, arguments_)
543
651
  }
544
652
 
545
653
  export async function JsValue_call0$(self_, name_, ff_core_JsValue_IsJsValue$A0, $task) {
546
- throw new Error('Function JsValue_call0 is missing on this target in async context.');
654
+ return self_[name_]()
547
655
  }
548
656
 
549
657
  export async function JsValue_call1$(self_, name_, a1_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, $task) {
550
- throw new Error('Function JsValue_call1 is missing on this target in async context.');
658
+ return self_[name_](a1_)
551
659
  }
552
660
 
553
661
  export async function JsValue_call2$(self_, name_, a1_, a2_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, $task) {
554
- throw new Error('Function JsValue_call2 is missing on this target in async context.');
662
+ return self_[name_](a1_, a2_)
555
663
  }
556
664
 
557
665
  export async function JsValue_call3$(self_, name_, a1_, a2_, a3_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, $task) {
558
- throw new Error('Function JsValue_call3 is missing on this target in async context.');
666
+ return self_[name_](a1_, a2_, a3_)
559
667
  }
560
668
 
561
669
  export async function JsValue_call4$(self_, name_, a1_, a2_, a3_, a4_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, $task) {
562
- throw new Error('Function JsValue_call4 is missing on this target in async context.');
670
+ return self_[name_](a1_, a2_, a3_, a4_)
563
671
  }
564
672
 
565
673
  export async function JsValue_call5$(self_, name_, a1_, a2_, a3_, a4_, a5_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, $task) {
566
- throw new Error('Function JsValue_call5 is missing on this target in async context.');
674
+ return self_[name_](a1_, a2_, a3_, a4_, a5_)
567
675
  }
568
676
 
569
677
  export async function JsValue_call6$(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, $task) {
570
- throw new Error('Function JsValue_call6 is missing on this target in async context.');
678
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_)
571
679
  }
572
680
 
573
681
  export async function JsValue_call7$(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, $task) {
574
- throw new Error('Function JsValue_call7 is missing on this target in async context.');
682
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_, a7_)
575
683
  }
576
684
 
577
685
  export async function JsValue_call8$(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, $task) {
578
- throw new Error('Function JsValue_call8 is missing on this target in async context.');
686
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_)
579
687
  }
580
688
 
581
689
  export async function JsValue_call9$(self_, name_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, ff_core_JsValue_IsJsValue$A0, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9, $task) {
582
- throw new Error('Function JsValue_call9 is missing on this target in async context.');
690
+ return self_[name_](a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
583
691
  }
584
692
 
585
693
  export async function JsValue_callValue$(self_, this_, arguments_, $task) {
586
- throw new Error('Function JsValue_callValue is missing on this target in async context.');
694
+ return self_.apply(this_, arguments_)
587
695
  }
588
696
 
589
697
  export async function JsValue_callValue0$(self_, $task) {
590
- throw new Error('Function JsValue_callValue0 is missing on this target in async context.');
698
+ return self_()
591
699
  }
592
700
 
593
701
  export async function JsValue_callValue1$(self_, a1_, ff_core_JsValue_IsJsValue$A1, $task) {
594
- throw new Error('Function JsValue_callValue1 is missing on this target in async context.');
702
+ return self_(a1_)
595
703
  }
596
704
 
597
705
  export async function JsValue_callValue2$(self_, a1_, a2_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, $task) {
598
- throw new Error('Function JsValue_callValue2 is missing on this target in async context.');
706
+ return self_(a1_, a2_)
599
707
  }
600
708
 
601
709
  export async function JsValue_callValue3$(self_, a1_, a2_, a3_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, $task) {
602
- throw new Error('Function JsValue_callValue3 is missing on this target in async context.');
710
+ return self_(a1_, a2_, a3_)
603
711
  }
604
712
 
605
713
  export async function JsValue_callValue4$(self_, a1_, a2_, a3_, a4_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, $task) {
606
- throw new Error('Function JsValue_callValue4 is missing on this target in async context.');
714
+ return self_(a1_, a2_, a3_, a4_)
607
715
  }
608
716
 
609
717
  export async function JsValue_callValue5$(self_, a1_, a2_, a3_, a4_, a5_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, $task) {
610
- throw new Error('Function JsValue_callValue5 is missing on this target in async context.');
718
+ return self_(a1_, a2_, a3_, a4_, a5_)
611
719
  }
612
720
 
613
721
  export async function JsValue_callValue6$(self_, a1_, a2_, a3_, a4_, a5_, a6_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, $task) {
614
- throw new Error('Function JsValue_callValue6 is missing on this target in async context.');
722
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_)
615
723
  }
616
724
 
617
725
  export async function JsValue_callValue7$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, $task) {
618
- throw new Error('Function JsValue_callValue7 is missing on this target in async context.');
726
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_)
619
727
  }
620
728
 
621
729
  export async function JsValue_callValue8$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, $task) {
622
- throw new Error('Function JsValue_callValue8 is missing on this target in async context.');
730
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_)
623
731
  }
624
732
 
625
733
  export async function JsValue_callValue9$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9, $task) {
626
- throw new Error('Function JsValue_callValue9 is missing on this target in async context.');
734
+ return self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
627
735
  }
628
736
 
629
- export async function JsValue_new$(self_, this_, arguments_, $task) {
630
- throw new Error('Function JsValue_new is missing on this target in async context.');
737
+ export async function JsValue_new$(self_, arguments_, $task) {
738
+ return (new Function.prototype.bind.apply(self_, arguments_))
631
739
  }
632
740
 
633
741
  export async function JsValue_new0$(self_, $task) {
634
- throw new Error('Function JsValue_new0 is missing on this target in async context.');
742
+ return (new self_())
635
743
  }
636
744
 
637
745
  export async function JsValue_new1$(self_, a1_, ff_core_JsValue_IsJsValue$A1, $task) {
638
- throw new Error('Function JsValue_new1 is missing on this target in async context.');
746
+ return (new self_(a1_))
639
747
  }
640
748
 
641
749
  export async function JsValue_new2$(self_, a1_, a2_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, $task) {
642
- throw new Error('Function JsValue_new2 is missing on this target in async context.');
750
+ return (new self_(a1_, a2_))
643
751
  }
644
752
 
645
753
  export async function JsValue_new3$(self_, a1_, a2_, a3_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, $task) {
646
- throw new Error('Function JsValue_new3 is missing on this target in async context.');
754
+ return (new self_(a1_, a2_, a3_))
647
755
  }
648
756
 
649
757
  export async function JsValue_new4$(self_, a1_, a2_, a3_, a4_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, $task) {
650
- throw new Error('Function JsValue_new4 is missing on this target in async context.');
758
+ return (new self_(a1_, a2_, a3_, a4_))
651
759
  }
652
760
 
653
761
  export async function JsValue_new5$(self_, a1_, a2_, a3_, a4_, a5_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, $task) {
654
- throw new Error('Function JsValue_new5 is missing on this target in async context.');
762
+ return (new self_(a1_, a2_, a3_, a4_, a5_))
655
763
  }
656
764
 
657
765
  export async function JsValue_new6$(self_, a1_, a2_, a3_, a4_, a5_, a6_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, $task) {
658
- throw new Error('Function JsValue_new6 is missing on this target in async context.');
766
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_))
659
767
  }
660
768
 
661
769
  export async function JsValue_new7$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, $task) {
662
- throw new Error('Function JsValue_new7 is missing on this target in async context.');
770
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_))
663
771
  }
664
772
 
665
773
  export async function JsValue_new8$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, $task) {
666
- throw new Error('Function JsValue_new8 is missing on this target in async context.');
774
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_))
667
775
  }
668
776
 
669
777
  export async function JsValue_new9$(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_, ff_core_JsValue_IsJsValue$A1, ff_core_JsValue_IsJsValue$A2, ff_core_JsValue_IsJsValue$A3, ff_core_JsValue_IsJsValue$A4, ff_core_JsValue_IsJsValue$A5, ff_core_JsValue_IsJsValue$A6, ff_core_JsValue_IsJsValue$A7, ff_core_JsValue_IsJsValue$A8, ff_core_JsValue_IsJsValue$A9, $task) {
670
- throw new Error('Function JsValue_new9 is missing on this target in async context.');
778
+ return (new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_))
671
779
  }
672
780
 
673
781
  export async function JsValue_grabPairs$(self_, $task) {
674
- throw new Error('Function JsValue_grabPairs is missing on this target in async context.');
782
+ if((!ff_core_JsValue.JsValue_isObject(self_))) {
783
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
784
+ };
785
+ return Object.getOwnPropertyNames(self_).map(((name_, i_) => {
786
+ return ff_core_Pair.Pair(name_, self_[name_])
787
+ }))
675
788
  }
676
789
 
677
790
  export async function JsValue_grabMap$(self_, $task) {
@@ -679,11 +792,49 @@ return ff_core_List.List_toMap(ff_core_JsValue.JsValue_grabPairs(self_), ff_core
679
792
  }
680
793
 
681
794
  export async function JsValue_grabIntMap$(self_, $task) {
682
- throw new Error('Function JsValue_grabIntMap is missing on this target in async context.');
795
+ if((!(self_ instanceof Map))) {
796
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
797
+ };
798
+ return self_
683
799
  }
684
800
 
685
801
  export async function JsValue_grabStringMap$(self_, $task) {
686
- throw new Error('Function JsValue_grabStringMap is missing on this target in async context.');
802
+ if((!(self_ instanceof Map))) {
803
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
804
+ };
805
+ return self_
806
+ }
807
+
808
+ export async function JsValue_spreadToArray$(self_, $task) {
809
+ return [...self_]
810
+ }
811
+
812
+ export async function JsValue_coalesce$(self_, defaultValue_, ff_core_JsValue_IsJsValue$T, $task) {
813
+ if(ff_core_JsValue.JsValue_isNullOrUndefined(self_)) {
814
+ return defaultValue_
815
+ } else {
816
+ return self_
817
+ }
818
+ }
819
+
820
+ export async function JsValue_typeof$(self_, $task) {
821
+ return (typeof self_)
822
+ }
823
+
824
+ export async function JsValue_instanceof$(self_, type_, $task) {
825
+ return (self_ instanceof type_)
826
+ }
827
+
828
+ export async function JsValue_truthy$(self_, $task) {
829
+ return (!!self_)
830
+ }
831
+
832
+ export async function JsValue_falsy$(self_, $task) {
833
+ return (!self_)
834
+ }
835
+
836
+ export async function JsValue_nullish$(self_, $task) {
837
+ return ff_core_JsValue.JsValue_isNullOrUndefined(self_)
687
838
  }
688
839
 
689
840
  export const ff_core_JsValue_IsJsValue$ff_core_JsValue_JsValue = {