vxrn 2.6.8 → 2.6.10

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.
@@ -351,6 +351,16 @@ function declarationStart(list, floor, keyword) {
351
351
  }
352
352
  return first;
353
353
  }
354
+ function declarationModifiers(list, floor, keyword) {
355
+ var words = [];
356
+ for (var i = declarationStart(list, floor, keyword), depth = 0; i < keyword; i++) {
357
+ var text = list[i].text;
358
+ if (text === "(") depth++;
359
+ else if (text === ")") depth--;
360
+ else if (depth === 0) words.push(text);
361
+ }
362
+ return words;
363
+ }
354
364
  function subscriptionPayload(file, typeTokens, language, named) {
355
365
  try {
356
366
  var _typeTokens_at, _fn_, _fn_1, _fn_2, _fn_3;
@@ -402,9 +412,7 @@ function methods(file, list, start, end, language, named) {
402
412
  i++;
403
413
  return "continue";
404
414
  }
405
- var modifiers = list.slice(declarationStart(list, previous, i), i).map(function(token) {
406
- return token.text;
407
- });
415
+ var modifiers = declarationModifiers(list, previous, i);
408
416
  var hidden = modifiers.includes("private") || modifiers.includes("fileprivate");
409
417
  if (!hidden && (modifiers.includes("static") || modifiers.includes("class"))) {
410
418
  fail(file, list[i], "static native exports are unsupported");
@@ -672,9 +680,7 @@ function swiftView(file, list, keyword, floor, body, end, named) {
672
680
  }
673
681
  };
674
682
  var _list_;
675
- var modifiers = list.slice(declarationStart(list, floor, keyword), keyword).map(function(token) {
676
- return token.text;
677
- });
683
+ var modifiers = declarationModifiers(list, floor, keyword);
678
684
  if (list[keyword].text !== "struct" || !modifiers.includes("public")) return null;
679
685
  if (!list.slice(keyword + 2, body).some(function(token) {
680
686
  return token.text === "View";
@@ -693,9 +699,7 @@ function swiftView(file, list, keyword, floor, body, end, named) {
693
699
  }
694
700
  function collectDataClass(file, list, keyword, name, token, generic, packageName) {
695
701
  var _list_scan, _list_scan1, _list_scan2;
696
- var modifiers = list.slice(declarationStart(list, 0, keyword - 1), keyword).map(function(entry) {
697
- return entry.text;
698
- });
702
+ var modifiers = declarationModifiers(list, 0, keyword - 1);
699
703
  var problem = null;
700
704
  if (modifiers.includes("private")) {
701
705
  problem = `data class ${name} must be public to cross the boundary`;
@@ -1385,9 +1389,7 @@ function collectNamedTypes(file, list, language, packageName) {
1385
1389
  var inherits = header.map(function(entry) {
1386
1390
  return entry.text;
1387
1391
  });
1388
- var modifiers = list.slice(declarationStart(list, 0, i), i).map(function(entry) {
1389
- return entry.text;
1390
- });
1392
+ var modifiers = declarationModifiers(list, 0, i);
1391
1393
  structs.push({
1392
1394
  name,
1393
1395
  token,
@@ -1425,9 +1427,7 @@ function collectNamedTypes(file, list, language, packageName) {
1425
1427
  }
1426
1428
  function composableView(file, list, keyword, floor, named) {
1427
1429
  var _list_, _list_1, _list_2;
1428
- var modifiers = list.slice(declarationStart(list, floor, keyword), keyword).map(function(token) {
1429
- return token.text;
1430
- });
1430
+ var modifiers = declarationModifiers(list, floor, keyword);
1431
1431
  if (!modifiers.some(function(value, index) {
1432
1432
  return value === "@" && modifiers[index + 1] === "Composable";
1433
1433
  })) return null;