[6a3a178] | 1 | function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
---|
| 2 |
|
---|
| 3 | // THIS FILE IS AUTOGENERATED
|
---|
| 4 | // see scripts/generateNodeUtils.js
|
---|
| 5 | function isTypeOf(t) {
|
---|
| 6 | return function (n) {
|
---|
| 7 | return n.type === t;
|
---|
| 8 | };
|
---|
| 9 | }
|
---|
| 10 |
|
---|
| 11 | function assertTypeOf(t) {
|
---|
| 12 | return function (n) {
|
---|
| 13 | return function () {
|
---|
| 14 | if (!(n.type === t)) {
|
---|
| 15 | throw new Error('n.type === t' + " error: " + (undefined || "unknown"));
|
---|
| 16 | }
|
---|
| 17 | }();
|
---|
| 18 | };
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | export function module(id, fields, metadata) {
|
---|
| 22 | if (id !== null && id !== undefined) {
|
---|
| 23 | if (!(typeof id === "string")) {
|
---|
| 24 | throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) {
|
---|
| 29 | throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | var node = {
|
---|
| 33 | type: "Module",
|
---|
| 34 | id: id,
|
---|
| 35 | fields: fields
|
---|
| 36 | };
|
---|
| 37 |
|
---|
| 38 | if (typeof metadata !== "undefined") {
|
---|
| 39 | node.metadata = metadata;
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | return node;
|
---|
| 43 | }
|
---|
| 44 | export function moduleMetadata(sections, functionNames, localNames, producers) {
|
---|
| 45 | if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) {
|
---|
| 46 | throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | if (functionNames !== null && functionNames !== undefined) {
|
---|
| 50 | if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) {
|
---|
| 51 | throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | if (localNames !== null && localNames !== undefined) {
|
---|
| 56 | if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) {
|
---|
| 57 | throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 58 | }
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | if (producers !== null && producers !== undefined) {
|
---|
| 62 | if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
|
---|
| 63 | throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 64 | }
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | var node = {
|
---|
| 68 | type: "ModuleMetadata",
|
---|
| 69 | sections: sections
|
---|
| 70 | };
|
---|
| 71 |
|
---|
| 72 | if (typeof functionNames !== "undefined" && functionNames.length > 0) {
|
---|
| 73 | node.functionNames = functionNames;
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | if (typeof localNames !== "undefined" && localNames.length > 0) {
|
---|
| 77 | node.localNames = localNames;
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 | if (typeof producers !== "undefined" && producers.length > 0) {
|
---|
| 81 | node.producers = producers;
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | return node;
|
---|
| 85 | }
|
---|
| 86 | export function moduleNameMetadata(value) {
|
---|
| 87 | if (!(typeof value === "string")) {
|
---|
| 88 | throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
|
---|
| 89 | }
|
---|
| 90 |
|
---|
| 91 | var node = {
|
---|
| 92 | type: "ModuleNameMetadata",
|
---|
| 93 | value: value
|
---|
| 94 | };
|
---|
| 95 | return node;
|
---|
| 96 | }
|
---|
| 97 | export function functionNameMetadata(value, index) {
|
---|
| 98 | if (!(typeof value === "string")) {
|
---|
| 99 | throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
|
---|
| 100 | }
|
---|
| 101 |
|
---|
| 102 | if (!(typeof index === "number")) {
|
---|
| 103 | throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || "unknown"));
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | var node = {
|
---|
| 107 | type: "FunctionNameMetadata",
|
---|
| 108 | value: value,
|
---|
| 109 | index: index
|
---|
| 110 | };
|
---|
| 111 | return node;
|
---|
| 112 | }
|
---|
| 113 | export function localNameMetadata(value, localIndex, functionIndex) {
|
---|
| 114 | if (!(typeof value === "string")) {
|
---|
| 115 | throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
|
---|
| 116 | }
|
---|
| 117 |
|
---|
| 118 | if (!(typeof localIndex === "number")) {
|
---|
| 119 | throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || "unknown"));
|
---|
| 120 | }
|
---|
| 121 |
|
---|
| 122 | if (!(typeof functionIndex === "number")) {
|
---|
| 123 | throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || "unknown"));
|
---|
| 124 | }
|
---|
| 125 |
|
---|
| 126 | var node = {
|
---|
| 127 | type: "LocalNameMetadata",
|
---|
| 128 | value: value,
|
---|
| 129 | localIndex: localIndex,
|
---|
| 130 | functionIndex: functionIndex
|
---|
| 131 | };
|
---|
| 132 | return node;
|
---|
| 133 | }
|
---|
| 134 | export function binaryModule(id, blob) {
|
---|
| 135 | if (id !== null && id !== undefined) {
|
---|
| 136 | if (!(typeof id === "string")) {
|
---|
| 137 | throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
|
---|
| 138 | }
|
---|
| 139 | }
|
---|
| 140 |
|
---|
| 141 | if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) {
|
---|
| 142 | throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 143 | }
|
---|
| 144 |
|
---|
| 145 | var node = {
|
---|
| 146 | type: "BinaryModule",
|
---|
| 147 | id: id,
|
---|
| 148 | blob: blob
|
---|
| 149 | };
|
---|
| 150 | return node;
|
---|
| 151 | }
|
---|
| 152 | export function quoteModule(id, string) {
|
---|
| 153 | if (id !== null && id !== undefined) {
|
---|
| 154 | if (!(typeof id === "string")) {
|
---|
| 155 | throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
|
---|
| 156 | }
|
---|
| 157 | }
|
---|
| 158 |
|
---|
| 159 | if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) {
|
---|
| 160 | throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 161 | }
|
---|
| 162 |
|
---|
| 163 | var node = {
|
---|
| 164 | type: "QuoteModule",
|
---|
| 165 | id: id,
|
---|
| 166 | string: string
|
---|
| 167 | };
|
---|
| 168 | return node;
|
---|
| 169 | }
|
---|
| 170 | export function sectionMetadata(section, startOffset, size, vectorOfSize) {
|
---|
| 171 | if (!(typeof startOffset === "number")) {
|
---|
| 172 | throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || "unknown"));
|
---|
| 173 | }
|
---|
| 174 |
|
---|
| 175 | var node = {
|
---|
| 176 | type: "SectionMetadata",
|
---|
| 177 | section: section,
|
---|
| 178 | startOffset: startOffset,
|
---|
| 179 | size: size,
|
---|
| 180 | vectorOfSize: vectorOfSize
|
---|
| 181 | };
|
---|
| 182 | return node;
|
---|
| 183 | }
|
---|
| 184 | export function producersSectionMetadata(producers) {
|
---|
| 185 | if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
|
---|
| 186 | throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 187 | }
|
---|
| 188 |
|
---|
| 189 | var node = {
|
---|
| 190 | type: "ProducersSectionMetadata",
|
---|
| 191 | producers: producers
|
---|
| 192 | };
|
---|
| 193 | return node;
|
---|
| 194 | }
|
---|
| 195 | export function producerMetadata(language, processedBy, sdk) {
|
---|
| 196 | if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) {
|
---|
| 197 | throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 198 | }
|
---|
| 199 |
|
---|
| 200 | if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) {
|
---|
| 201 | throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 202 | }
|
---|
| 203 |
|
---|
| 204 | if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) {
|
---|
| 205 | throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 206 | }
|
---|
| 207 |
|
---|
| 208 | var node = {
|
---|
| 209 | type: "ProducerMetadata",
|
---|
| 210 | language: language,
|
---|
| 211 | processedBy: processedBy,
|
---|
| 212 | sdk: sdk
|
---|
| 213 | };
|
---|
| 214 | return node;
|
---|
| 215 | }
|
---|
| 216 | export function producerMetadataVersionedName(name, version) {
|
---|
| 217 | if (!(typeof name === "string")) {
|
---|
| 218 | throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
|
---|
| 219 | }
|
---|
| 220 |
|
---|
| 221 | if (!(typeof version === "string")) {
|
---|
| 222 | throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || "unknown"));
|
---|
| 223 | }
|
---|
| 224 |
|
---|
| 225 | var node = {
|
---|
| 226 | type: "ProducerMetadataVersionedName",
|
---|
| 227 | name: name,
|
---|
| 228 | version: version
|
---|
| 229 | };
|
---|
| 230 | return node;
|
---|
| 231 | }
|
---|
| 232 | export function loopInstruction(label, resulttype, instr) {
|
---|
| 233 | if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
|
---|
| 234 | throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 235 | }
|
---|
| 236 |
|
---|
| 237 | var node = {
|
---|
| 238 | type: "LoopInstruction",
|
---|
| 239 | id: "loop",
|
---|
| 240 | label: label,
|
---|
| 241 | resulttype: resulttype,
|
---|
| 242 | instr: instr
|
---|
| 243 | };
|
---|
| 244 | return node;
|
---|
| 245 | }
|
---|
| 246 | export function instr(id, object, args, namedArgs) {
|
---|
| 247 | if (!(typeof id === "string")) {
|
---|
| 248 | throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
|
---|
| 249 | }
|
---|
| 250 |
|
---|
| 251 | if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) {
|
---|
| 252 | throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 253 | }
|
---|
| 254 |
|
---|
| 255 | var node = {
|
---|
| 256 | type: "Instr",
|
---|
| 257 | id: id,
|
---|
| 258 | args: args
|
---|
| 259 | };
|
---|
| 260 |
|
---|
| 261 | if (typeof object !== "undefined") {
|
---|
| 262 | node.object = object;
|
---|
| 263 | }
|
---|
| 264 |
|
---|
| 265 | if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) {
|
---|
| 266 | node.namedArgs = namedArgs;
|
---|
| 267 | }
|
---|
| 268 |
|
---|
| 269 | return node;
|
---|
| 270 | }
|
---|
| 271 | export function ifInstruction(testLabel, test, result, consequent, alternate) {
|
---|
| 272 | if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) {
|
---|
| 273 | throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 274 | }
|
---|
| 275 |
|
---|
| 276 | if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) {
|
---|
| 277 | throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 278 | }
|
---|
| 279 |
|
---|
| 280 | if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) {
|
---|
| 281 | throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 282 | }
|
---|
| 283 |
|
---|
| 284 | var node = {
|
---|
| 285 | type: "IfInstruction",
|
---|
| 286 | id: "if",
|
---|
| 287 | testLabel: testLabel,
|
---|
| 288 | test: test,
|
---|
| 289 | result: result,
|
---|
| 290 | consequent: consequent,
|
---|
| 291 | alternate: alternate
|
---|
| 292 | };
|
---|
| 293 | return node;
|
---|
| 294 | }
|
---|
| 295 | export function stringLiteral(value) {
|
---|
| 296 | if (!(typeof value === "string")) {
|
---|
| 297 | throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
|
---|
| 298 | }
|
---|
| 299 |
|
---|
| 300 | var node = {
|
---|
| 301 | type: "StringLiteral",
|
---|
| 302 | value: value
|
---|
| 303 | };
|
---|
| 304 | return node;
|
---|
| 305 | }
|
---|
| 306 | export function numberLiteral(value, raw) {
|
---|
| 307 | if (!(typeof value === "number")) {
|
---|
| 308 | throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
|
---|
| 309 | }
|
---|
| 310 |
|
---|
| 311 | if (!(typeof raw === "string")) {
|
---|
| 312 | throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
|
---|
| 313 | }
|
---|
| 314 |
|
---|
| 315 | var node = {
|
---|
| 316 | type: "NumberLiteral",
|
---|
| 317 | value: value,
|
---|
| 318 | raw: raw
|
---|
| 319 | };
|
---|
| 320 | return node;
|
---|
| 321 | }
|
---|
| 322 | export function longNumberLiteral(value, raw) {
|
---|
| 323 | if (!(typeof raw === "string")) {
|
---|
| 324 | throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
|
---|
| 325 | }
|
---|
| 326 |
|
---|
| 327 | var node = {
|
---|
| 328 | type: "LongNumberLiteral",
|
---|
| 329 | value: value,
|
---|
| 330 | raw: raw
|
---|
| 331 | };
|
---|
| 332 | return node;
|
---|
| 333 | }
|
---|
| 334 | export function floatLiteral(value, nan, inf, raw) {
|
---|
| 335 | if (!(typeof value === "number")) {
|
---|
| 336 | throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
|
---|
| 337 | }
|
---|
| 338 |
|
---|
| 339 | if (nan !== null && nan !== undefined) {
|
---|
| 340 | if (!(typeof nan === "boolean")) {
|
---|
| 341 | throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || "unknown"));
|
---|
| 342 | }
|
---|
| 343 | }
|
---|
| 344 |
|
---|
| 345 | if (inf !== null && inf !== undefined) {
|
---|
| 346 | if (!(typeof inf === "boolean")) {
|
---|
| 347 | throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || "unknown"));
|
---|
| 348 | }
|
---|
| 349 | }
|
---|
| 350 |
|
---|
| 351 | if (!(typeof raw === "string")) {
|
---|
| 352 | throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
|
---|
| 353 | }
|
---|
| 354 |
|
---|
| 355 | var node = {
|
---|
| 356 | type: "FloatLiteral",
|
---|
| 357 | value: value,
|
---|
| 358 | raw: raw
|
---|
| 359 | };
|
---|
| 360 |
|
---|
| 361 | if (nan === true) {
|
---|
| 362 | node.nan = true;
|
---|
| 363 | }
|
---|
| 364 |
|
---|
| 365 | if (inf === true) {
|
---|
| 366 | node.inf = true;
|
---|
| 367 | }
|
---|
| 368 |
|
---|
| 369 | return node;
|
---|
| 370 | }
|
---|
| 371 | export function elem(table, offset, funcs) {
|
---|
| 372 | if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) {
|
---|
| 373 | throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 374 | }
|
---|
| 375 |
|
---|
| 376 | if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) {
|
---|
| 377 | throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 378 | }
|
---|
| 379 |
|
---|
| 380 | var node = {
|
---|
| 381 | type: "Elem",
|
---|
| 382 | table: table,
|
---|
| 383 | offset: offset,
|
---|
| 384 | funcs: funcs
|
---|
| 385 | };
|
---|
| 386 | return node;
|
---|
| 387 | }
|
---|
| 388 | export function indexInFuncSection(index) {
|
---|
| 389 | var node = {
|
---|
| 390 | type: "IndexInFuncSection",
|
---|
| 391 | index: index
|
---|
| 392 | };
|
---|
| 393 | return node;
|
---|
| 394 | }
|
---|
| 395 | export function valtypeLiteral(name) {
|
---|
| 396 | var node = {
|
---|
| 397 | type: "ValtypeLiteral",
|
---|
| 398 | name: name
|
---|
| 399 | };
|
---|
| 400 | return node;
|
---|
| 401 | }
|
---|
| 402 | export function typeInstruction(id, functype) {
|
---|
| 403 | var node = {
|
---|
| 404 | type: "TypeInstruction",
|
---|
| 405 | id: id,
|
---|
| 406 | functype: functype
|
---|
| 407 | };
|
---|
| 408 | return node;
|
---|
| 409 | }
|
---|
| 410 | export function start(index) {
|
---|
| 411 | var node = {
|
---|
| 412 | type: "Start",
|
---|
| 413 | index: index
|
---|
| 414 | };
|
---|
| 415 | return node;
|
---|
| 416 | }
|
---|
| 417 | export function globalType(valtype, mutability) {
|
---|
| 418 | var node = {
|
---|
| 419 | type: "GlobalType",
|
---|
| 420 | valtype: valtype,
|
---|
| 421 | mutability: mutability
|
---|
| 422 | };
|
---|
| 423 | return node;
|
---|
| 424 | }
|
---|
| 425 | export function leadingComment(value) {
|
---|
| 426 | if (!(typeof value === "string")) {
|
---|
| 427 | throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
|
---|
| 428 | }
|
---|
| 429 |
|
---|
| 430 | var node = {
|
---|
| 431 | type: "LeadingComment",
|
---|
| 432 | value: value
|
---|
| 433 | };
|
---|
| 434 | return node;
|
---|
| 435 | }
|
---|
| 436 | export function blockComment(value) {
|
---|
| 437 | if (!(typeof value === "string")) {
|
---|
| 438 | throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
|
---|
| 439 | }
|
---|
| 440 |
|
---|
| 441 | var node = {
|
---|
| 442 | type: "BlockComment",
|
---|
| 443 | value: value
|
---|
| 444 | };
|
---|
| 445 | return node;
|
---|
| 446 | }
|
---|
| 447 | export function data(memoryIndex, offset, init) {
|
---|
| 448 | var node = {
|
---|
| 449 | type: "Data",
|
---|
| 450 | memoryIndex: memoryIndex,
|
---|
| 451 | offset: offset,
|
---|
| 452 | init: init
|
---|
| 453 | };
|
---|
| 454 | return node;
|
---|
| 455 | }
|
---|
| 456 | export function global(globalType, init, name) {
|
---|
| 457 | if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) {
|
---|
| 458 | throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 459 | }
|
---|
| 460 |
|
---|
| 461 | var node = {
|
---|
| 462 | type: "Global",
|
---|
| 463 | globalType: globalType,
|
---|
| 464 | init: init,
|
---|
| 465 | name: name
|
---|
| 466 | };
|
---|
| 467 | return node;
|
---|
| 468 | }
|
---|
| 469 | export function table(elementType, limits, name, elements) {
|
---|
| 470 | if (!(limits.type === "Limit")) {
|
---|
| 471 | throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || "unknown"));
|
---|
| 472 | }
|
---|
| 473 |
|
---|
| 474 | if (elements !== null && elements !== undefined) {
|
---|
| 475 | if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) {
|
---|
| 476 | throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 477 | }
|
---|
| 478 | }
|
---|
| 479 |
|
---|
| 480 | var node = {
|
---|
| 481 | type: "Table",
|
---|
| 482 | elementType: elementType,
|
---|
| 483 | limits: limits,
|
---|
| 484 | name: name
|
---|
| 485 | };
|
---|
| 486 |
|
---|
| 487 | if (typeof elements !== "undefined" && elements.length > 0) {
|
---|
| 488 | node.elements = elements;
|
---|
| 489 | }
|
---|
| 490 |
|
---|
| 491 | return node;
|
---|
| 492 | }
|
---|
| 493 | export function memory(limits, id) {
|
---|
| 494 | var node = {
|
---|
| 495 | type: "Memory",
|
---|
| 496 | limits: limits,
|
---|
| 497 | id: id
|
---|
| 498 | };
|
---|
| 499 | return node;
|
---|
| 500 | }
|
---|
| 501 | export function funcImportDescr(id, signature) {
|
---|
| 502 | var node = {
|
---|
| 503 | type: "FuncImportDescr",
|
---|
| 504 | id: id,
|
---|
| 505 | signature: signature
|
---|
| 506 | };
|
---|
| 507 | return node;
|
---|
| 508 | }
|
---|
| 509 | export function moduleImport(module, name, descr) {
|
---|
| 510 | if (!(typeof module === "string")) {
|
---|
| 511 | throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || "unknown"));
|
---|
| 512 | }
|
---|
| 513 |
|
---|
| 514 | if (!(typeof name === "string")) {
|
---|
| 515 | throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
|
---|
| 516 | }
|
---|
| 517 |
|
---|
| 518 | var node = {
|
---|
| 519 | type: "ModuleImport",
|
---|
| 520 | module: module,
|
---|
| 521 | name: name,
|
---|
| 522 | descr: descr
|
---|
| 523 | };
|
---|
| 524 | return node;
|
---|
| 525 | }
|
---|
| 526 | export function moduleExportDescr(exportType, id) {
|
---|
| 527 | var node = {
|
---|
| 528 | type: "ModuleExportDescr",
|
---|
| 529 | exportType: exportType,
|
---|
| 530 | id: id
|
---|
| 531 | };
|
---|
| 532 | return node;
|
---|
| 533 | }
|
---|
| 534 | export function moduleExport(name, descr) {
|
---|
| 535 | if (!(typeof name === "string")) {
|
---|
| 536 | throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
|
---|
| 537 | }
|
---|
| 538 |
|
---|
| 539 | var node = {
|
---|
| 540 | type: "ModuleExport",
|
---|
| 541 | name: name,
|
---|
| 542 | descr: descr
|
---|
| 543 | };
|
---|
| 544 | return node;
|
---|
| 545 | }
|
---|
| 546 | export function limit(min, max, shared) {
|
---|
| 547 | if (!(typeof min === "number")) {
|
---|
| 548 | throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || "unknown"));
|
---|
| 549 | }
|
---|
| 550 |
|
---|
| 551 | if (max !== null && max !== undefined) {
|
---|
| 552 | if (!(typeof max === "number")) {
|
---|
| 553 | throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || "unknown"));
|
---|
| 554 | }
|
---|
| 555 | }
|
---|
| 556 |
|
---|
| 557 | if (shared !== null && shared !== undefined) {
|
---|
| 558 | if (!(typeof shared === "boolean")) {
|
---|
| 559 | throw new Error('typeof shared === "boolean"' + " error: " + ("Argument shared must be of type boolean, given: " + _typeof(shared) || "unknown"));
|
---|
| 560 | }
|
---|
| 561 | }
|
---|
| 562 |
|
---|
| 563 | var node = {
|
---|
| 564 | type: "Limit",
|
---|
| 565 | min: min
|
---|
| 566 | };
|
---|
| 567 |
|
---|
| 568 | if (typeof max !== "undefined") {
|
---|
| 569 | node.max = max;
|
---|
| 570 | }
|
---|
| 571 |
|
---|
| 572 | if (shared === true) {
|
---|
| 573 | node.shared = true;
|
---|
| 574 | }
|
---|
| 575 |
|
---|
| 576 | return node;
|
---|
| 577 | }
|
---|
| 578 | export function signature(params, results) {
|
---|
| 579 | if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) {
|
---|
| 580 | throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 581 | }
|
---|
| 582 |
|
---|
| 583 | if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) {
|
---|
| 584 | throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 585 | }
|
---|
| 586 |
|
---|
| 587 | var node = {
|
---|
| 588 | type: "Signature",
|
---|
| 589 | params: params,
|
---|
| 590 | results: results
|
---|
| 591 | };
|
---|
| 592 | return node;
|
---|
| 593 | }
|
---|
| 594 | export function program(body) {
|
---|
| 595 | if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
|
---|
| 596 | throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 597 | }
|
---|
| 598 |
|
---|
| 599 | var node = {
|
---|
| 600 | type: "Program",
|
---|
| 601 | body: body
|
---|
| 602 | };
|
---|
| 603 | return node;
|
---|
| 604 | }
|
---|
| 605 | export function identifier(value, raw) {
|
---|
| 606 | if (!(typeof value === "string")) {
|
---|
| 607 | throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
|
---|
| 608 | }
|
---|
| 609 |
|
---|
| 610 | if (raw !== null && raw !== undefined) {
|
---|
| 611 | if (!(typeof raw === "string")) {
|
---|
| 612 | throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
|
---|
| 613 | }
|
---|
| 614 | }
|
---|
| 615 |
|
---|
| 616 | var node = {
|
---|
| 617 | type: "Identifier",
|
---|
| 618 | value: value
|
---|
| 619 | };
|
---|
| 620 |
|
---|
| 621 | if (typeof raw !== "undefined") {
|
---|
| 622 | node.raw = raw;
|
---|
| 623 | }
|
---|
| 624 |
|
---|
| 625 | return node;
|
---|
| 626 | }
|
---|
| 627 | export function blockInstruction(label, instr, result) {
|
---|
| 628 | if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
|
---|
| 629 | throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 630 | }
|
---|
| 631 |
|
---|
| 632 | var node = {
|
---|
| 633 | type: "BlockInstruction",
|
---|
| 634 | id: "block",
|
---|
| 635 | label: label,
|
---|
| 636 | instr: instr,
|
---|
| 637 | result: result
|
---|
| 638 | };
|
---|
| 639 | return node;
|
---|
| 640 | }
|
---|
| 641 | export function callInstruction(index, instrArgs, numeric) {
|
---|
| 642 | if (instrArgs !== null && instrArgs !== undefined) {
|
---|
| 643 | if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) {
|
---|
| 644 | throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 645 | }
|
---|
| 646 | }
|
---|
| 647 |
|
---|
| 648 | var node = {
|
---|
| 649 | type: "CallInstruction",
|
---|
| 650 | id: "call",
|
---|
| 651 | index: index
|
---|
| 652 | };
|
---|
| 653 |
|
---|
| 654 | if (typeof instrArgs !== "undefined" && instrArgs.length > 0) {
|
---|
| 655 | node.instrArgs = instrArgs;
|
---|
| 656 | }
|
---|
| 657 |
|
---|
| 658 | if (typeof numeric !== "undefined") {
|
---|
| 659 | node.numeric = numeric;
|
---|
| 660 | }
|
---|
| 661 |
|
---|
| 662 | return node;
|
---|
| 663 | }
|
---|
| 664 | export function callIndirectInstruction(signature, intrs) {
|
---|
| 665 | if (intrs !== null && intrs !== undefined) {
|
---|
| 666 | if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) {
|
---|
| 667 | throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 668 | }
|
---|
| 669 | }
|
---|
| 670 |
|
---|
| 671 | var node = {
|
---|
| 672 | type: "CallIndirectInstruction",
|
---|
| 673 | id: "call_indirect",
|
---|
| 674 | signature: signature
|
---|
| 675 | };
|
---|
| 676 |
|
---|
| 677 | if (typeof intrs !== "undefined" && intrs.length > 0) {
|
---|
| 678 | node.intrs = intrs;
|
---|
| 679 | }
|
---|
| 680 |
|
---|
| 681 | return node;
|
---|
| 682 | }
|
---|
| 683 | export function byteArray(values) {
|
---|
| 684 | if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) {
|
---|
| 685 | throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 686 | }
|
---|
| 687 |
|
---|
| 688 | var node = {
|
---|
| 689 | type: "ByteArray",
|
---|
| 690 | values: values
|
---|
| 691 | };
|
---|
| 692 | return node;
|
---|
| 693 | }
|
---|
| 694 | export function func(name, signature, body, isExternal, metadata) {
|
---|
| 695 | if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
|
---|
| 696 | throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
|
---|
| 697 | }
|
---|
| 698 |
|
---|
| 699 | if (isExternal !== null && isExternal !== undefined) {
|
---|
| 700 | if (!(typeof isExternal === "boolean")) {
|
---|
| 701 | throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || "unknown"));
|
---|
| 702 | }
|
---|
| 703 | }
|
---|
| 704 |
|
---|
| 705 | var node = {
|
---|
| 706 | type: "Func",
|
---|
| 707 | name: name,
|
---|
| 708 | signature: signature,
|
---|
| 709 | body: body
|
---|
| 710 | };
|
---|
| 711 |
|
---|
| 712 | if (isExternal === true) {
|
---|
| 713 | node.isExternal = true;
|
---|
| 714 | }
|
---|
| 715 |
|
---|
| 716 | if (typeof metadata !== "undefined") {
|
---|
| 717 | node.metadata = metadata;
|
---|
| 718 | }
|
---|
| 719 |
|
---|
| 720 | return node;
|
---|
| 721 | }
|
---|
| 722 | export function internalBrUnless(target) {
|
---|
| 723 | if (!(typeof target === "number")) {
|
---|
| 724 | throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
|
---|
| 725 | }
|
---|
| 726 |
|
---|
| 727 | var node = {
|
---|
| 728 | type: "InternalBrUnless",
|
---|
| 729 | target: target
|
---|
| 730 | };
|
---|
| 731 | return node;
|
---|
| 732 | }
|
---|
| 733 | export function internalGoto(target) {
|
---|
| 734 | if (!(typeof target === "number")) {
|
---|
| 735 | throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
|
---|
| 736 | }
|
---|
| 737 |
|
---|
| 738 | var node = {
|
---|
| 739 | type: "InternalGoto",
|
---|
| 740 | target: target
|
---|
| 741 | };
|
---|
| 742 | return node;
|
---|
| 743 | }
|
---|
| 744 | export function internalCallExtern(target) {
|
---|
| 745 | if (!(typeof target === "number")) {
|
---|
| 746 | throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
|
---|
| 747 | }
|
---|
| 748 |
|
---|
| 749 | var node = {
|
---|
| 750 | type: "InternalCallExtern",
|
---|
| 751 | target: target
|
---|
| 752 | };
|
---|
| 753 | return node;
|
---|
| 754 | }
|
---|
| 755 | export function internalEndAndReturn() {
|
---|
| 756 | var node = {
|
---|
| 757 | type: "InternalEndAndReturn"
|
---|
| 758 | };
|
---|
| 759 | return node;
|
---|
| 760 | }
|
---|
| 761 | export var isModule = isTypeOf("Module");
|
---|
| 762 | export var isModuleMetadata = isTypeOf("ModuleMetadata");
|
---|
| 763 | export var isModuleNameMetadata = isTypeOf("ModuleNameMetadata");
|
---|
| 764 | export var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata");
|
---|
| 765 | export var isLocalNameMetadata = isTypeOf("LocalNameMetadata");
|
---|
| 766 | export var isBinaryModule = isTypeOf("BinaryModule");
|
---|
| 767 | export var isQuoteModule = isTypeOf("QuoteModule");
|
---|
| 768 | export var isSectionMetadata = isTypeOf("SectionMetadata");
|
---|
| 769 | export var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata");
|
---|
| 770 | export var isProducerMetadata = isTypeOf("ProducerMetadata");
|
---|
| 771 | export var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName");
|
---|
| 772 | export var isLoopInstruction = isTypeOf("LoopInstruction");
|
---|
| 773 | export var isInstr = isTypeOf("Instr");
|
---|
| 774 | export var isIfInstruction = isTypeOf("IfInstruction");
|
---|
| 775 | export var isStringLiteral = isTypeOf("StringLiteral");
|
---|
| 776 | export var isNumberLiteral = isTypeOf("NumberLiteral");
|
---|
| 777 | export var isLongNumberLiteral = isTypeOf("LongNumberLiteral");
|
---|
| 778 | export var isFloatLiteral = isTypeOf("FloatLiteral");
|
---|
| 779 | export var isElem = isTypeOf("Elem");
|
---|
| 780 | export var isIndexInFuncSection = isTypeOf("IndexInFuncSection");
|
---|
| 781 | export var isValtypeLiteral = isTypeOf("ValtypeLiteral");
|
---|
| 782 | export var isTypeInstruction = isTypeOf("TypeInstruction");
|
---|
| 783 | export var isStart = isTypeOf("Start");
|
---|
| 784 | export var isGlobalType = isTypeOf("GlobalType");
|
---|
| 785 | export var isLeadingComment = isTypeOf("LeadingComment");
|
---|
| 786 | export var isBlockComment = isTypeOf("BlockComment");
|
---|
| 787 | export var isData = isTypeOf("Data");
|
---|
| 788 | export var isGlobal = isTypeOf("Global");
|
---|
| 789 | export var isTable = isTypeOf("Table");
|
---|
| 790 | export var isMemory = isTypeOf("Memory");
|
---|
| 791 | export var isFuncImportDescr = isTypeOf("FuncImportDescr");
|
---|
| 792 | export var isModuleImport = isTypeOf("ModuleImport");
|
---|
| 793 | export var isModuleExportDescr = isTypeOf("ModuleExportDescr");
|
---|
| 794 | export var isModuleExport = isTypeOf("ModuleExport");
|
---|
| 795 | export var isLimit = isTypeOf("Limit");
|
---|
| 796 | export var isSignature = isTypeOf("Signature");
|
---|
| 797 | export var isProgram = isTypeOf("Program");
|
---|
| 798 | export var isIdentifier = isTypeOf("Identifier");
|
---|
| 799 | export var isBlockInstruction = isTypeOf("BlockInstruction");
|
---|
| 800 | export var isCallInstruction = isTypeOf("CallInstruction");
|
---|
| 801 | export var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction");
|
---|
| 802 | export var isByteArray = isTypeOf("ByteArray");
|
---|
| 803 | export var isFunc = isTypeOf("Func");
|
---|
| 804 | export var isInternalBrUnless = isTypeOf("InternalBrUnless");
|
---|
| 805 | export var isInternalGoto = isTypeOf("InternalGoto");
|
---|
| 806 | export var isInternalCallExtern = isTypeOf("InternalCallExtern");
|
---|
| 807 | export var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn");
|
---|
| 808 | export var isNode = function isNode(node) {
|
---|
| 809 | return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
|
---|
| 810 | };
|
---|
| 811 | export var isBlock = function isBlock(node) {
|
---|
| 812 | return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node);
|
---|
| 813 | };
|
---|
| 814 | export var isInstruction = function isInstruction(node) {
|
---|
| 815 | return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node);
|
---|
| 816 | };
|
---|
| 817 | export var isExpression = function isExpression(node) {
|
---|
| 818 | return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node);
|
---|
| 819 | };
|
---|
| 820 | export var isNumericLiteral = function isNumericLiteral(node) {
|
---|
| 821 | return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node);
|
---|
| 822 | };
|
---|
| 823 | export var isImportDescr = function isImportDescr(node) {
|
---|
| 824 | return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node);
|
---|
| 825 | };
|
---|
| 826 | export var isIntrinsic = function isIntrinsic(node) {
|
---|
| 827 | return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
|
---|
| 828 | };
|
---|
| 829 | export var assertModule = assertTypeOf("Module");
|
---|
| 830 | export var assertModuleMetadata = assertTypeOf("ModuleMetadata");
|
---|
| 831 | export var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata");
|
---|
| 832 | export var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata");
|
---|
| 833 | export var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata");
|
---|
| 834 | export var assertBinaryModule = assertTypeOf("BinaryModule");
|
---|
| 835 | export var assertQuoteModule = assertTypeOf("QuoteModule");
|
---|
| 836 | export var assertSectionMetadata = assertTypeOf("SectionMetadata");
|
---|
| 837 | export var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata");
|
---|
| 838 | export var assertProducerMetadata = assertTypeOf("ProducerMetadata");
|
---|
| 839 | export var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName");
|
---|
| 840 | export var assertLoopInstruction = assertTypeOf("LoopInstruction");
|
---|
| 841 | export var assertInstr = assertTypeOf("Instr");
|
---|
| 842 | export var assertIfInstruction = assertTypeOf("IfInstruction");
|
---|
| 843 | export var assertStringLiteral = assertTypeOf("StringLiteral");
|
---|
| 844 | export var assertNumberLiteral = assertTypeOf("NumberLiteral");
|
---|
| 845 | export var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral");
|
---|
| 846 | export var assertFloatLiteral = assertTypeOf("FloatLiteral");
|
---|
| 847 | export var assertElem = assertTypeOf("Elem");
|
---|
| 848 | export var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection");
|
---|
| 849 | export var assertValtypeLiteral = assertTypeOf("ValtypeLiteral");
|
---|
| 850 | export var assertTypeInstruction = assertTypeOf("TypeInstruction");
|
---|
| 851 | export var assertStart = assertTypeOf("Start");
|
---|
| 852 | export var assertGlobalType = assertTypeOf("GlobalType");
|
---|
| 853 | export var assertLeadingComment = assertTypeOf("LeadingComment");
|
---|
| 854 | export var assertBlockComment = assertTypeOf("BlockComment");
|
---|
| 855 | export var assertData = assertTypeOf("Data");
|
---|
| 856 | export var assertGlobal = assertTypeOf("Global");
|
---|
| 857 | export var assertTable = assertTypeOf("Table");
|
---|
| 858 | export var assertMemory = assertTypeOf("Memory");
|
---|
| 859 | export var assertFuncImportDescr = assertTypeOf("FuncImportDescr");
|
---|
| 860 | export var assertModuleImport = assertTypeOf("ModuleImport");
|
---|
| 861 | export var assertModuleExportDescr = assertTypeOf("ModuleExportDescr");
|
---|
| 862 | export var assertModuleExport = assertTypeOf("ModuleExport");
|
---|
| 863 | export var assertLimit = assertTypeOf("Limit");
|
---|
| 864 | export var assertSignature = assertTypeOf("Signature");
|
---|
| 865 | export var assertProgram = assertTypeOf("Program");
|
---|
| 866 | export var assertIdentifier = assertTypeOf("Identifier");
|
---|
| 867 | export var assertBlockInstruction = assertTypeOf("BlockInstruction");
|
---|
| 868 | export var assertCallInstruction = assertTypeOf("CallInstruction");
|
---|
| 869 | export var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction");
|
---|
| 870 | export var assertByteArray = assertTypeOf("ByteArray");
|
---|
| 871 | export var assertFunc = assertTypeOf("Func");
|
---|
| 872 | export var assertInternalBrUnless = assertTypeOf("InternalBrUnless");
|
---|
| 873 | export var assertInternalGoto = assertTypeOf("InternalGoto");
|
---|
| 874 | export var assertInternalCallExtern = assertTypeOf("InternalCallExtern");
|
---|
| 875 | export var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn");
|
---|
| 876 | export var unionTypesMap = {
|
---|
| 877 | Module: ["Node"],
|
---|
| 878 | ModuleMetadata: ["Node"],
|
---|
| 879 | ModuleNameMetadata: ["Node"],
|
---|
| 880 | FunctionNameMetadata: ["Node"],
|
---|
| 881 | LocalNameMetadata: ["Node"],
|
---|
| 882 | BinaryModule: ["Node"],
|
---|
| 883 | QuoteModule: ["Node"],
|
---|
| 884 | SectionMetadata: ["Node"],
|
---|
| 885 | ProducersSectionMetadata: ["Node"],
|
---|
| 886 | ProducerMetadata: ["Node"],
|
---|
| 887 | ProducerMetadataVersionedName: ["Node"],
|
---|
| 888 | LoopInstruction: ["Node", "Block", "Instruction"],
|
---|
| 889 | Instr: ["Node", "Expression", "Instruction"],
|
---|
| 890 | IfInstruction: ["Node", "Instruction"],
|
---|
| 891 | StringLiteral: ["Node", "Expression"],
|
---|
| 892 | NumberLiteral: ["Node", "NumericLiteral", "Expression"],
|
---|
| 893 | LongNumberLiteral: ["Node", "NumericLiteral", "Expression"],
|
---|
| 894 | FloatLiteral: ["Node", "NumericLiteral", "Expression"],
|
---|
| 895 | Elem: ["Node"],
|
---|
| 896 | IndexInFuncSection: ["Node"],
|
---|
| 897 | ValtypeLiteral: ["Node", "Expression"],
|
---|
| 898 | TypeInstruction: ["Node", "Instruction"],
|
---|
| 899 | Start: ["Node"],
|
---|
| 900 | GlobalType: ["Node", "ImportDescr"],
|
---|
| 901 | LeadingComment: ["Node"],
|
---|
| 902 | BlockComment: ["Node"],
|
---|
| 903 | Data: ["Node"],
|
---|
| 904 | Global: ["Node"],
|
---|
| 905 | Table: ["Node", "ImportDescr"],
|
---|
| 906 | Memory: ["Node", "ImportDescr"],
|
---|
| 907 | FuncImportDescr: ["Node", "ImportDescr"],
|
---|
| 908 | ModuleImport: ["Node"],
|
---|
| 909 | ModuleExportDescr: ["Node"],
|
---|
| 910 | ModuleExport: ["Node"],
|
---|
| 911 | Limit: ["Node"],
|
---|
| 912 | Signature: ["Node"],
|
---|
| 913 | Program: ["Node"],
|
---|
| 914 | Identifier: ["Node", "Expression"],
|
---|
| 915 | BlockInstruction: ["Node", "Block", "Instruction"],
|
---|
| 916 | CallInstruction: ["Node", "Instruction"],
|
---|
| 917 | CallIndirectInstruction: ["Node", "Instruction"],
|
---|
| 918 | ByteArray: ["Node"],
|
---|
| 919 | Func: ["Node", "Block"],
|
---|
| 920 | InternalBrUnless: ["Node", "Intrinsic"],
|
---|
| 921 | InternalGoto: ["Node", "Intrinsic"],
|
---|
| 922 | InternalCallExtern: ["Node", "Intrinsic"],
|
---|
| 923 | InternalEndAndReturn: ["Node", "Intrinsic"]
|
---|
| 924 | };
|
---|
| 925 | export var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"]; |
---|