sqlmath 2022.6.30 → 2022.9.20

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.
package/CHANGELOG.md CHANGED
@@ -2,13 +2,49 @@
2
2
 
3
3
  # Todo
4
4
  - add dbtable-crud-operations dbtableOpenCsv, dbtableOpenJson
5
- - sqlmath - add sql-extension carrayblob()
6
5
  - none
7
6
 
8
- # v2022.6.30
7
+ # v2022.9.20
8
+ - sqlmath - bugfix - handle null seriesList, xlabelList, xdata, ydata
9
+ - sqlmath - revamp str99 with sqlite3_str
10
+ - jslint - update jslint v2022.9.9
11
+ - sqlite - revert back to v3.38.5 due to performance-regression
12
+ - sqlmath - add sql-function tofloat64array()
13
+ - sqlite - update to sqlite v3.39.2
14
+
15
+ # v2022.8.20
16
+ - chart-revamp - switch from chart.js to using svg-elements for plots
17
+ --
18
+ - chart - add optional easeout ui-animation, in addition to linear
19
+ - chart - fix render-bug when zooming with no data
20
+ - chart - bugfix - fix xrangeMin being NaN
21
+ - chart - animate crosshair, similar to tooltip
22
+ - chart - remove gridband code
23
+ - chart - remove all classes, and instances of this
24
+ - chart - bugfix - fix x-axis having no padding
25
+ - chart - bugfix - fix chart failing to re-scale after hiding/showing series
26
+ - chart - fix tooltip-indent-bug
27
+ - chart - revamp tooltip-popup in barchart - part1
28
+ - chart - replace Tick class with static-functions uichartAxistickCreate and uichartAxistickRender
29
+ - chart - bugfix - fix tick-cleanup
30
+ - chart - fix seriestracker z-index in reverse-order of series-render
31
+ - chart - bugfix - fix annoying clip-path drifting down-right during startup-animation
32
+ - chart - remove jquery-dependency
33
+ - chart - fix again, zoomout cropping too much of one side, in line-charts
34
+ --
35
+ - remove unused files
36
+ assets.bootstrap-v3.4.1.datatables-v1.10.21.chartjs-v2.9.4.codemirror-5.58.3.rollup.css
37
+ assets.bootstrap-v3.4.1.datatables-v1.10.21.chartjs-v2.9.4.codemirror-5.58.3.rollup.js
38
+ spa.sqlchart.html
39
+ spa.sqlchart.js
40
+ - add dbrow-crud-operations dbrowDelete, dbrowInsert, dbrowUpdate
41
+ - chart - add charting functionality using chart.js
9
42
  - add dbtable-crud-operations dbtableRename, dbcolumnAdd, dbcolumnRename, dbcolumnDrop
10
43
  - demo - add web-demo in README.md
11
44
  - webapp - add ui-loading when running onDbAction(), onDbExec()
45
+ - demo - add github-fork-banner
46
+
47
+ # v2022.6.30
12
48
  - add dbtable-crud-operations dbquerySaveCsv, dbquerySaveJson, dbtableDrop, dbtableSaveCsv, dbtableSaveJson
13
49
  - add contextmenu and dbtable-crud-operation dbtableDrop
14
50
  - add database-crud-operations
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  # Status
5
- | Branch | [master<br>(v2022.6.30)](https://github.com/sqlmath/sqlmath/tree/master) | [beta<br>(Web Demo)](https://github.com/sqlmath/sqlmath/tree/beta) | [alpha<br>(Development)](https://github.com/sqlmath/sqlmath/tree/alpha) |
5
+ | Branch | [master<br>(v2022.9.20)](https://github.com/sqlmath/sqlmath/tree/master) | [beta<br>(Web Demo)](https://github.com/sqlmath/sqlmath/tree/beta) | [alpha<br>(Development)](https://github.com/sqlmath/sqlmath/tree/alpha) |
6
6
  |--:|:--:|:--:|:--:|
7
7
  | CI | [![ci](https://github.com/sqlmath/sqlmath/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/sqlmath/sqlmath/actions?query=branch%3Amaster) | [![ci](https://github.com/sqlmath/sqlmath/actions/workflows/ci.yml/badge.svg?branch=beta)](https://github.com/sqlmath/sqlmath/actions?query=branch%3Abeta) | [![ci](https://github.com/sqlmath/sqlmath/actions/workflows/ci.yml/badge.svg?branch=alpha)](https://github.com/sqlmath/sqlmath/actions?query=branch%3Aalpha) |
8
8
  | Coverage | [![coverage](https://sqlmath.github.io/sqlmath/branch-master/.artifact/coverage/coverage_badge.svg)](https://sqlmath.github.io/sqlmath/branch-master/.artifact/coverage/index.html) | [![coverage](https://sqlmath.github.io/sqlmath/branch-beta/.artifact/coverage/coverage_badge.svg)](https://sqlmath.github.io/sqlmath/branch-beta/.artifact/coverage/index.html) | [![coverage](https://sqlmath.github.io/sqlmath/branch-alpha/.artifact/coverage/coverage_badge.svg)](https://sqlmath.github.io/sqlmath/branch-alpha/.artifact/coverage/index.html) |
Binary file
Binary file
Binary file
package/jslint.mjs CHANGED
@@ -103,14 +103,14 @@
103
103
  delta, devel, directive, directive_ignore_line, directive_list, directives,
104
104
  dirname, disrupt, dot, edition, elem_list, ellipsis, else, end, endOffset,
105
105
  endsWith, entries, env, error, eval, every, example_list, excludeList, exec,
106
- execArgv, exit, exitCode, export_dict, exports, expression, extra, file,
107
- fileList, fileURLToPath, filter, finally, flag, floor, for, forEach,
106
+ execArgv, exit, exitCode, export_dict, exports, expression, extra, fart,
107
+ file, fileList, fileURLToPath, filter, finally, flag, floor, for, forEach,
108
108
  formatted_message, free, freeze, from, froms, fsWriteFileWithParents,
109
109
  fud_stmt, functionName, function_list, function_stack, functions, get,
110
110
  getset, github_repo, globExclude, global, global_dict, global_list,
111
111
  holeList, htmlEscape, id, identifier, import, import_list, import_meta_url,
112
112
  inc, includeList, indent2, index, indexOf, init, initial, isArray,
113
- isBlockCoverage, isHole, isNaN, is_equal, is_fart, is_weird, join, jslint,
113
+ isBlockCoverage, isHole, isNaN, is_equal, is_weird, join, jslint,
114
114
  jslint_apidoc, jslint_assert, jslint_charset_ascii, jslint_cli,
115
115
  jslint_edition, jslint_phase1_split, jslint_phase2_lex, jslint_phase3_parse,
116
116
  jslint_phase4_walk, jslint_phase5_whitage, jslint_report, json,
@@ -153,7 +153,7 @@ let debugInline = (function () {
153
153
  return argv[0];
154
154
  }
155
155
  debug(); // Coverage-hack.
156
- __consoleError = console.error;
156
+ __consoleError = console.error; //jslint-ignore-line
157
157
  return debug;
158
158
  }());
159
159
  let jslint_charset_ascii = (
@@ -165,7 +165,7 @@ let jslint_charset_ascii = (
165
165
  + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
166
166
  + "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
167
167
  );
168
- let jslint_edition = "v2022.7.1-beta";
168
+ let jslint_edition = "v2022.9.1-beta";
169
169
  let jslint_export; // The jslint object to be exported.
170
170
  let jslint_fudge = 1; // Fudge starting line and starting
171
171
  // ... column to 1.
@@ -860,11 +860,22 @@ function jslint(
860
860
  c,
861
861
  d
862
862
  );
863
- if (the_token.warning === undefined) {
864
- the_token.warning = the_warning;
865
- } else {
863
+
864
+ // Issue #408
865
+ // Warnings that should be ignored sometimes suppress legitimate warnings.
866
+
867
+ if (the_warning.directive_ignore_line) {
868
+ return the_warning;
869
+ }
870
+
871
+ // If there is already a warning on this token, suppress the new one. It is
872
+ // likely that the first warning will be the most meaningful.
873
+
874
+ if (the_token.warning) {
866
875
  warning_list.pop();
876
+ return the_warning;
867
877
  }
878
+ the_token.warning = the_warning;
868
879
  return the_warning;
869
880
  }
870
881
 
@@ -1014,6 +1025,7 @@ function jslint(
1014
1025
  break;
1015
1026
 
1016
1027
  // PR-347 - Disable warning "missing_browser".
1028
+ //
1017
1029
  // case "missing_browser":
1018
1030
  // mm = `/*global*/ requires the Assume a browser option.`;
1019
1031
  // break;
@@ -1098,6 +1110,7 @@ function jslint(
1098
1110
  break;
1099
1111
 
1100
1112
  // PR-347 - Disable warning "unexpected_directive_a".
1113
+ //
1101
1114
  // case "unexpected_directive_a":
1102
1115
  // mm = `When using modules, don't use directive '/\u002a${a}'.`;
1103
1116
  // break;
@@ -1328,6 +1341,7 @@ function jslint(
1328
1341
  );
1329
1342
 
1330
1343
  // PR-347 - Disable warning "missing_browser".
1344
+ //
1331
1345
  // if (!option_dict.browser) {
1332
1346
  // directive_list.forEach(function (comment) {
1333
1347
  // if (comment.directive === "global") {
@@ -2700,6 +2714,7 @@ function jslint_phase2_lex(state) {
2700
2714
  return char_after("]");
2701
2715
 
2702
2716
  // PR-362 - Relax regexp-warning against using <space>.
2717
+ //
2703
2718
  // case " ":
2704
2719
  //
2705
2720
  // // test_cause:
@@ -2780,6 +2795,7 @@ function jslint_phase2_lex(state) {
2780
2795
  return;
2781
2796
 
2782
2797
  // PR-362 - Relax regexp-warning against using <space>.
2798
+ //
2783
2799
  // case " ":
2784
2800
  //
2785
2801
  // // test_cause:
@@ -3278,19 +3294,20 @@ function jslint_phase2_lex(state) {
3278
3294
 
3279
3295
  switch (key) {
3280
3296
  case "beta": // Enable experimental warnings.
3281
- case "bitwise": // Allow bitwise operators.
3297
+ case "bitwise": // Allow bitwise operator.
3282
3298
  case "browser": // Assume browser environment.
3283
- case "convert": // Allow conversion operators.
3299
+ case "convert": // Allow conversion operator.
3284
3300
  case "couch": // Assume CouchDb environment.
3285
3301
  case "devel": // Allow console.log() and friends.
3286
3302
  case "ecma": // Assume ECMAScript environment.
3287
3303
  case "eval": // Allow eval().
3304
+ case "fart": // Allow complex fat-arrow.
3288
3305
  case "for": // Allow for-statement.
3289
3306
  case "getset": // Allow get() and set().
3290
3307
  case "indent2": // Use 2-space indent.
3291
3308
  case "long": // Allow long lines.
3292
3309
  case "node": // Assume Node.js environment.
3293
- case "nomen": // Allow weird property names.
3310
+ case "nomen": // Allow weird property name.
3294
3311
  case "single": // Allow single-quote strings.
3295
3312
  case "subscript": // Allow identifier in subscript-notation.
3296
3313
  case "test_cause": // Test jslint's causes.
@@ -3336,12 +3353,16 @@ console.log(JSON.stringify(Object.keys(window).sort(), undefined, 4));
3336
3353
 
3337
3354
  "AbortController",
3338
3355
  // "Buffer",
3339
- "DOMException",
3356
+ // "Crypto",
3357
+ // "CryptoKey",
3340
3358
  "Event",
3341
3359
  "EventTarget",
3342
3360
  "MessageChannel",
3343
3361
  "MessageEvent",
3344
3362
  "MessagePort",
3363
+ // "Request",
3364
+ // "Response",
3365
+ // "SubtleCrypto",
3345
3366
  "TextDecoder",
3346
3367
  "TextEncoder",
3347
3368
  "URL",
@@ -3355,7 +3376,9 @@ console.log(JSON.stringify(Object.keys(window).sort(), undefined, 4));
3355
3376
  "clearInterval",
3356
3377
  "clearTimeout",
3357
3378
  // "console",
3379
+ // "crypto",
3358
3380
  // "exports",
3381
+ // "fetch",
3359
3382
  // "global",
3360
3383
  // "module",
3361
3384
  "performance",
@@ -3365,7 +3388,6 @@ console.log(JSON.stringify(Object.keys(window).sort(), undefined, 4));
3365
3388
  // "setImmediate",
3366
3389
  "setInterval",
3367
3390
  "setTimeout",
3368
- "structuredClone",
3369
3391
 
3370
3392
  // Web worker only.
3371
3393
  // https://github.com/mdn/content/blob/main/files/en-us/web/api
@@ -3408,6 +3430,7 @@ console.log(JSON.stringify(Object.keys(window).sort(), undefined, 4));
3408
3430
  "sessionStorage",
3409
3431
  // "setInterval",
3410
3432
  // "setTimeout",
3433
+ "structuredClone",
3411
3434
  "window"
3412
3435
  ], "browser");
3413
3436
  break;
@@ -3469,6 +3492,7 @@ import https from "https";
3469
3492
 
3470
3493
  case "ecma":
3471
3494
  object_assign_from_list(global_dict, [
3495
+ "AggregateError",
3472
3496
  "Array",
3473
3497
  "ArrayBuffer",
3474
3498
  "Atomics",
@@ -3539,7 +3563,7 @@ import moduleHttps from "https";
3539
3563
  let result = "";
3540
3564
  await new Promise(function (resolve) {
3541
3565
  moduleHttps.get((
3542
- "https://raw.githubusercontent.com/nodejs/node/master/doc/api"
3566
+ "https://raw.githubusercontent.com/nodejs/node/v16.x/doc/api"
3543
3567
  + "/globals.md"
3544
3568
  ), function (res) {
3545
3569
  res.on("data", function (chunk) {
@@ -3562,12 +3586,16 @@ import moduleHttps from "https";
3562
3586
  object_assign_from_list(global_dict, [
3563
3587
  "AbortController",
3564
3588
  "Buffer",
3565
- "DOMException",
3589
+ // "Crypto",
3590
+ // "CryptoKey",
3566
3591
  "Event",
3567
3592
  "EventTarget",
3568
3593
  "MessageChannel",
3569
3594
  "MessageEvent",
3570
3595
  "MessagePort",
3596
+ // "Request",
3597
+ // "Response",
3598
+ // "SubtleCrypto",
3571
3599
  "TextDecoder",
3572
3600
  "TextEncoder",
3573
3601
  "URL",
@@ -3581,7 +3609,9 @@ import moduleHttps from "https";
3581
3609
  "clearInterval",
3582
3610
  "clearTimeout",
3583
3611
  "console",
3612
+ // "crypto",
3584
3613
  "exports",
3614
+ // "fetch",
3585
3615
  "global",
3586
3616
  "module",
3587
3617
  "performance",
@@ -3590,8 +3620,7 @@ import moduleHttps from "https";
3590
3620
  "require",
3591
3621
  "setImmediate",
3592
3622
  "setInterval",
3593
- "setTimeout",
3594
- "structuredClone"
3623
+ "setTimeout"
3595
3624
  ], "Node.js");
3596
3625
  break;
3597
3626
  }
@@ -3742,7 +3771,6 @@ import moduleHttps from "https";
3742
3771
  from,
3743
3772
  id,
3744
3773
  identifier: Boolean(identifier),
3745
- is_fart: false,
3746
3774
  line,
3747
3775
  nr: token_list.length,
3748
3776
  thru: column,
@@ -3807,7 +3835,7 @@ import moduleHttps from "https";
3807
3835
  token_prv_expr.id === ")"
3808
3836
  && paren_backtrack_list[paren_depth]
3809
3837
  ) {
3810
- paren_backtrack_list[paren_depth].is_fart = true;
3838
+ paren_backtrack_list[paren_depth].fart = the_token;
3811
3839
  }
3812
3840
  break;
3813
3841
  }
@@ -3908,7 +3936,11 @@ function jslint_phase3_parse(state) {
3908
3936
 
3909
3937
  // Attempt to give helpful names to anonymous functions.
3910
3938
 
3911
- if (token_now.identifier && token_now.id !== "function") {
3939
+ if (
3940
+ token_now.identifier
3941
+ && token_now.id !== "function"
3942
+ && token_now.id !== "async"
3943
+ ) {
3912
3944
  anon = token_now.id;
3913
3945
  } else if (
3914
3946
  token_now.id === "(string)"
@@ -4841,17 +4873,21 @@ function jslint_phase3_parse(state) {
4841
4873
  return left;
4842
4874
  }
4843
4875
 
4844
- function parse_fart() {
4845
- let parameters;
4846
- let signature;
4847
- let the_fart;
4848
- [parameters, signature] = prefix_function_arg();
4849
- advance("=>");
4850
- the_fart = token_now;
4851
- the_fart.arity = "binary";
4852
- the_fart.name = "=>";
4853
- the_fart.level = functionage.level + 1;
4854
- function_list.push(the_fart);
4876
+ function parse_fart(the_fart) {
4877
+
4878
+ // Give the function properties storing its names and for observing the depth
4879
+ // of loops and switches.
4880
+
4881
+ Object.assign(the_fart, {
4882
+ arity: "binary",
4883
+ context: empty(),
4884
+ finally: 0,
4885
+ level: functionage.level + 1,
4886
+ loop: 0,
4887
+ name: anon,
4888
+ switch: 0,
4889
+ try: 0
4890
+ });
4855
4891
 
4856
4892
  // PR-384 - Relax warning "function_in_loop".
4857
4893
  //
@@ -4863,45 +4899,27 @@ function jslint_phase3_parse(state) {
4863
4899
  // warn("function_in_loop", the_fart);
4864
4900
  // }
4865
4901
 
4866
- // Give the function properties storing its names and for observing the depth
4867
- // of loops and switches.
4868
-
4869
- the_fart.context = empty();
4870
- the_fart.finally = 0;
4871
- the_fart.loop = 0;
4872
- the_fart.parameters = parameters;
4873
- the_fart.signature = signature;
4874
- the_fart.switch = 0;
4875
- the_fart.try = 0;
4876
-
4877
4902
  // Push the current function context and establish a new one.
4878
4903
 
4904
+ function_list.push(the_fart);
4879
4905
  function_stack.push(functionage);
4880
4906
  functionage = the_fart;
4881
- the_fart.parameters.forEach(function enroll_parameter(name) {
4882
- if (name.identifier) {
4883
- enroll(name, "parameter", true);
4884
- } else {
4885
4907
 
4886
- // PR-385 - Bugfix - Fixes issue #382 - fix warnings against destructured fart.
4887
-
4888
- // test_cause:
4889
- // ["([aa])=>0", "enroll_parameter", "use_function_not_fart", "=>", 7]
4890
- // ["({aa})=>0", "enroll_parameter", "use_function_not_fart", "=>", 7]
4908
+ // Parse the parameter list.
4891
4909
 
4892
- warn("use_function_not_fart", the_fart);
4910
+ prefix_function_parameter(the_fart);
4911
+ advance("=>");
4893
4912
 
4894
- // Recurse enroll_parameter().
4913
+ // The function's body is a block.
4895
4914
 
4896
- name.names.forEach(enroll_parameter);
4897
- }
4898
- });
4899
4915
  if (token_nxt.id === "{") {
4916
+ if (!option_dict.fart) {
4900
4917
 
4901
4918
  // test_cause:
4902
4919
  // ["()=>{}", "parse_fart", "use_function_not_fart", "=>", 3]
4903
4920
 
4904
- warn("use_function_not_fart", the_fart);
4921
+ warn("use_function_not_fart", the_fart);
4922
+ }
4905
4923
  the_fart.block = block("body");
4906
4924
  } else if (
4907
4925
  syntax_dict[token_nxt.id] !== undefined
@@ -4914,9 +4932,15 @@ function jslint_phase3_parse(state) {
4914
4932
  // ["()=>delete aa", "parse_fart", "unexpected_a_after_b", "=>", 5]
4915
4933
 
4916
4934
  stop("unexpected_a_after_b", token_nxt, token_nxt.id, "=>");
4935
+
4936
+ // The function's body is an expression.
4937
+
4917
4938
  } else {
4918
4939
  the_fart.expression = parse_expression(0);
4919
4940
  }
4941
+
4942
+ // Restore the previous context.
4943
+
4920
4944
  functionage = function_stack.pop();
4921
4945
  return the_fart;
4922
4946
  }
@@ -5259,15 +5283,35 @@ function jslint_phase3_parse(state) {
5259
5283
  }
5260
5284
 
5261
5285
  function prefix_async() {
5262
- let the_async;
5286
+ let the_async = token_now;
5263
5287
  let the_function;
5264
- the_async = token_now;
5265
- advance("function");
5266
- the_function = Object.assign(token_now, {
5267
- arity: the_async.arity,
5268
- async: 1
5269
- });
5270
- prefix_function();
5288
+ token_nxt.arity = the_async.arity;
5289
+
5290
+ // PR-414 - Parse async fart.
5291
+
5292
+ if (token_nxt.fart) {
5293
+ advance("(");
5294
+ the_function = Object.assign(token_now.fart, {
5295
+ async: 1
5296
+ });
5297
+ if (!option_dict.fart) {
5298
+
5299
+ // test_cause:
5300
+ // ["async()=>0", "prefix_async", "use_function_not_fart", "=>", 8]
5301
+
5302
+ warn("use_function_not_fart", the_function);
5303
+ }
5304
+ prefix_lparen();
5305
+
5306
+ // Parse async function.
5307
+
5308
+ } else {
5309
+ advance("function");
5310
+ the_function = Object.assign(token_now, {
5311
+ async: 1
5312
+ });
5313
+ prefix_function();
5314
+ }
5271
5315
  if (the_function.async === 1) {
5272
5316
 
5273
5317
  // test_cause:
@@ -5354,7 +5398,6 @@ function jslint_phase3_parse(state) {
5354
5398
  }
5355
5399
  }
5356
5400
  }
5357
- the_function.level = functionage.level + 1;
5358
5401
 
5359
5402
  // Probably deadcode.
5360
5403
  // if (mode_mega) {
@@ -5384,6 +5427,7 @@ function jslint_phase3_parse(state) {
5384
5427
  async: the_function.async || 0,
5385
5428
  context: empty(),
5386
5429
  finally: 0,
5430
+ level: functionage.level + 1,
5387
5431
  loop: 0,
5388
5432
  statement_prv: undefined,
5389
5433
  switch: 0,
@@ -5392,43 +5436,27 @@ function jslint_phase3_parse(state) {
5392
5436
  if (the_function.arity !== "statement" && typeof name === "object") {
5393
5437
 
5394
5438
  // test_cause:
5395
- // ["let aa=function bb(){return;};", "prefix_function", "expression", "", 0]
5439
+ // ["let aa=function bb(){return;};", "prefix_function", "expression", "bb", 0]
5396
5440
 
5397
- test_cause("expression");
5441
+ test_cause("expression", name.id);
5398
5442
  enroll(name, "function", true);
5399
5443
  name.dead = false;
5400
5444
  name.init = true;
5401
5445
  name.used = 1;
5402
5446
  }
5403
5447
 
5404
- // Bugfix - fix function-redefinitions not warned inside function-calls.
5448
+ // PR-334 - Bugfix - fix function-redefinition not warned inside function-call.
5405
5449
  // Push the current function context and establish a new one.
5406
5450
 
5407
- function_stack.push(functionage);
5408
5451
  function_list.push(the_function);
5452
+ function_stack.push(functionage);
5409
5453
  functionage = the_function;
5410
5454
 
5411
5455
  // Parse the parameter list.
5412
5456
 
5413
5457
  advance("(");
5414
-
5415
- // test_cause:
5416
- // ["function aa(){}", "prefix_function", "opener", "", 0]
5417
-
5418
- test_cause("opener");
5419
- token_now.free = false;
5420
5458
  token_now.arity = "function";
5421
- [functionage.parameters, functionage.signature] = prefix_function_arg();
5422
- functionage.parameters.forEach(function enroll_parameter(name) {
5423
- if (name.identifier) {
5424
- enroll(name, "parameter", false);
5425
- } else {
5426
-
5427
- // Recurse enroll_parameter().
5428
-
5429
- name.names.forEach(enroll_parameter);
5430
- }
5431
- });
5459
+ prefix_function_parameter(the_function);
5432
5460
 
5433
5461
  // The function's body is a block.
5434
5462
 
@@ -5479,19 +5507,40 @@ function jslint_phase3_parse(state) {
5479
5507
  return the_function;
5480
5508
  }
5481
5509
 
5482
- function prefix_function_arg() {
5483
- const list = [];
5484
- const signature = ["("];
5510
+ function prefix_function_parameter(the_function) {
5511
+
5512
+ // This function will parse input <parameters> at beginning of <the_function>
5513
+
5485
5514
  let optional;
5515
+ let parameters = [];
5516
+ let signature = ["("];
5486
5517
  let subparam;
5487
- function parameter() {
5518
+ function param_enroll(name) {
5519
+ if (name.identifier) {
5520
+ enroll(name, "parameter", false);
5521
+ } else {
5522
+
5523
+ // test_cause:
5524
+ // ["([aa])=>0", "param_enroll", "use_function_not_fart", "=>", 7]
5525
+ // ["({aa})=>0", "param_enroll", "use_function_not_fart", "=>", 7]
5526
+
5527
+ if (the_function.id === "=>" && !option_dict.fart) {
5528
+ warn("use_function_not_fart", the_function);
5529
+ }
5530
+
5531
+ // Recurse param_enroll().
5532
+
5533
+ name.names.forEach(param_enroll);
5534
+ }
5535
+ }
5536
+ function param_parse() {
5488
5537
  let ellipsis = false;
5489
5538
  let param;
5490
5539
  if (token_nxt.id === "{") {
5491
5540
  if (optional !== undefined) {
5492
5541
 
5493
5542
  // test_cause:
5494
- // ["function aa(aa=0,{}){}", "parameter", "required_a_optional_b", "aa", 18]
5543
+ // ["function aa(aa=0,{}){}", "param_parse", "required_a_optional_b", "aa", 18]
5495
5544
 
5496
5545
  warn(
5497
5546
  "required_a_optional_b",
@@ -5509,8 +5558,8 @@ function jslint_phase3_parse(state) {
5509
5558
  if (!subparam.identifier) {
5510
5559
 
5511
5560
  // test_cause:
5512
- // ["function aa(aa=0,{}){}", "parameter", "expected_identifier_a", "}", 19]
5513
- // ["function aa({0}){}", "parameter", "expected_identifier_a", "0", 14]
5561
+ // ["function aa(aa=0,{}){}", "param_parse", "expected_identifier_a", "}", 19]
5562
+ // ["function aa({0}){}", "param_parse", "expected_identifier_a", "0", 14]
5514
5563
 
5515
5564
  return stop("expected_identifier_a");
5516
5565
  }
@@ -5525,7 +5574,7 @@ function jslint_phase3_parse(state) {
5525
5574
  if (!subparam.identifier) {
5526
5575
 
5527
5576
  // test_cause:
5528
- // ["function aa({aa:0}){}", "parameter", "expected_identifier_a", "}", 18]
5577
+ // ["function aa({aa:0}){}", "param_parse", "expected_identifier_a", "}", 18]
5529
5578
 
5530
5579
  return stop(
5531
5580
  "expected_identifier_a",
@@ -5535,7 +5584,7 @@ function jslint_phase3_parse(state) {
5535
5584
  }
5536
5585
 
5537
5586
  // test_cause:
5538
- // ["function aa({aa=aa},aa){}", "parameter", "equal", "", 0]
5587
+ // ["function aa({aa=aa},aa){}", "param_parse", "equal", "", 0]
5539
5588
 
5540
5589
  test_cause("equal");
5541
5590
  if (token_nxt.id === "=") {
@@ -5551,7 +5600,7 @@ function jslint_phase3_parse(state) {
5551
5600
  break;
5552
5601
  }
5553
5602
  }
5554
- list.push(param);
5603
+ parameters.push(param);
5555
5604
 
5556
5605
  // test_cause:
5557
5606
  // ["
@@ -5564,13 +5613,14 @@ function jslint_phase3_parse(state) {
5564
5613
  if (token_nxt.id === ",") {
5565
5614
  advance(",");
5566
5615
  signature.push(", ");
5567
- return parameter();
5616
+ param_parse();
5617
+ return;
5568
5618
  }
5569
5619
  } else if (token_nxt.id === "[") {
5570
5620
  if (optional !== undefined) {
5571
5621
 
5572
5622
  // test_cause:
5573
- // ["function aa(aa=0,[]){}", "parameter", "required_a_optional_b", "aa", 18]
5623
+ // ["function aa(aa=0,[]){}", "param_parse", "required_a_optional_b", "aa", 18]
5574
5624
 
5575
5625
  warn(
5576
5626
  "required_a_optional_b",
@@ -5588,7 +5638,7 @@ function jslint_phase3_parse(state) {
5588
5638
  if (!subparam.identifier) {
5589
5639
 
5590
5640
  // test_cause:
5591
- // ["function aa(aa=0,[]){}", "parameter", "expected_identifier_a", "]", 19]
5641
+ // ["function aa(aa=0,[]){}", "param_parse", "expected_identifier_a", "]", 19]
5592
5642
 
5593
5643
  return stop("expected_identifier_a");
5594
5644
  }
@@ -5596,7 +5646,7 @@ function jslint_phase3_parse(state) {
5596
5646
  param.names.push(subparam);
5597
5647
 
5598
5648
  // test_cause:
5599
- // ["function aa([aa=aa],aa){}", "parameter", "id", "", 0]
5649
+ // ["function aa([aa=aa],aa){}", "param_parse", "id", "", 0]
5600
5650
 
5601
5651
  test_cause("id");
5602
5652
  if (token_nxt.id === "=") {
@@ -5610,12 +5660,13 @@ function jslint_phase3_parse(state) {
5610
5660
  break;
5611
5661
  }
5612
5662
  }
5613
- list.push(param);
5663
+ parameters.push(param);
5614
5664
  advance("]");
5615
5665
  if (token_nxt.id === ",") {
5616
5666
  advance(",");
5617
5667
  signature.push(", ");
5618
- return parameter();
5668
+ param_parse();
5669
+ return;
5619
5670
  }
5620
5671
  } else {
5621
5672
  if (token_nxt.id === "...") {
@@ -5625,7 +5676,7 @@ function jslint_phase3_parse(state) {
5625
5676
  if (optional !== undefined) {
5626
5677
 
5627
5678
  // test_cause:
5628
- // ["function aa(aa=0,...){}", "parameter", "required_a_optional_b", "aa", 21]
5679
+ // ["function aa(aa=0,...){}", "param_parse", "required_a_optional_b", "aa", 21]
5629
5680
 
5630
5681
  warn(
5631
5682
  "required_a_optional_b",
@@ -5638,12 +5689,12 @@ function jslint_phase3_parse(state) {
5638
5689
  if (!token_nxt.identifier) {
5639
5690
 
5640
5691
  // test_cause:
5641
- // ["function aa(0){}", "parameter", "expected_identifier_a", "0", 13]
5692
+ // ["function aa(0){}", "param_parse", "expected_identifier_a", "0", 13]
5642
5693
 
5643
5694
  return stop("expected_identifier_a");
5644
5695
  }
5645
5696
  param = token_nxt;
5646
- list.push(param);
5697
+ parameters.push(param);
5647
5698
  advance();
5648
5699
  signature.push(param.id);
5649
5700
  if (ellipsis) {
@@ -5657,7 +5708,7 @@ function jslint_phase3_parse(state) {
5657
5708
  if (optional !== undefined) {
5658
5709
 
5659
5710
  // test_cause:
5660
- // ["function aa(aa=0,bb){}", "parameter", "required_a_optional_b", "aa", 18]
5711
+ // ["function aa(aa=0,bb){}", "param_parse", "required_a_optional_b", "aa", 18]
5661
5712
 
5662
5713
  warn(
5663
5714
  "required_a_optional_b",
@@ -5670,17 +5721,26 @@ function jslint_phase3_parse(state) {
5670
5721
  if (token_nxt.id === ",") {
5671
5722
  advance(",");
5672
5723
  signature.push(", ");
5673
- return parameter();
5724
+ param_parse();
5725
+ return;
5674
5726
  }
5675
5727
  }
5676
5728
  }
5677
5729
  }
5730
+
5731
+ // test_cause:
5732
+ // ["function aa(){}", "prefix_function_parameter", "opener", "(", 0]
5733
+
5734
+ test_cause("opener", token_now.id);
5735
+ token_now.free = false;
5678
5736
  if (token_nxt.id !== ")" && token_nxt.id !== "(end)") {
5679
- parameter();
5737
+ param_parse();
5680
5738
  }
5681
5739
  advance(")");
5682
5740
  signature.push(")");
5683
- return [list, signature.join("")];
5741
+ parameters.forEach(param_enroll);
5742
+ the_function.parameters = parameters;
5743
+ the_function.signature = signature.join("");
5684
5744
  }
5685
5745
 
5686
5746
  function prefix_lbrace() {
@@ -5891,9 +5951,8 @@ function jslint_phase3_parse(state) {
5891
5951
 
5892
5952
  // PR-385 - Bugfix - Fixes issue #382 - failure to detect destructured fart.
5893
5953
 
5894
- if (token_now.is_fart) {
5895
- the_paren.free = false;
5896
- return parse_fart();
5954
+ if (token_now.fart) {
5955
+ return parse_fart(token_now.fart);
5897
5956
  }
5898
5957
 
5899
5958
  // test_cause:
@@ -7423,7 +7482,7 @@ function jslint_phase4_walk(state) {
7423
7482
  i_set = a_set[the_token.id];
7424
7483
  if (i_set !== undefined) {
7425
7484
  i_set.forEach(function (task) {
7426
- return task(the_token);
7485
+ task(the_token);
7427
7486
  });
7428
7487
  }
7429
7488
 
@@ -7432,7 +7491,7 @@ function jslint_phase4_walk(state) {
7432
7491
  i_set = a_set["(all)"];
7433
7492
  if (i_set !== undefined) {
7434
7493
  i_set.forEach(function (task) {
7435
- return task(the_token);
7494
+ task(the_token);
7436
7495
  });
7437
7496
  }
7438
7497
  }
@@ -8425,12 +8484,16 @@ function jslint_phase4_walk(state) {
8425
8484
  } else {
8426
8485
  preamble(thing);
8427
8486
  walk_expression(thing.expression);
8428
- if (thing.id === "function") {
8487
+
8488
+ // PR-414 - Bugfix - fix fart-body not being walked.
8489
+
8490
+ if (thing.id === "function" || thing.id === "=>") {
8429
8491
 
8430
8492
  // test_cause:
8431
- // ["aa=function(){}", "walk_expression", "function", "", 0]
8493
+ // ["aa=()=>0", "walk_expression", "function", "=>", 0]
8494
+ // ["aa=function(){}", "walk_expression", "function", "function", 0]
8432
8495
 
8433
- test_cause("function");
8496
+ test_cause("function", thing.id);
8434
8497
 
8435
8498
  // Recurse walk_statement().
8436
8499
 
@@ -8466,33 +8529,36 @@ function jslint_phase4_walk(state) {
8466
8529
  }
8467
8530
 
8468
8531
  function walk_statement(thing) {
8469
- if (thing) {
8470
- if (Array.isArray(thing)) {
8532
+ if (!thing) {
8533
+ return;
8534
+ }
8535
+ if (Array.isArray(thing)) {
8471
8536
 
8472
8537
  // test_cause:
8473
8538
  // ["+[]", "walk_statement", "isArray", "", 0]
8474
8539
 
8475
- test_cause("isArray");
8540
+ test_cause("isArray");
8476
8541
 
8477
8542
  // Recurse walk_statement().
8478
8543
 
8479
- thing.forEach(walk_statement);
8480
- } else {
8481
- preamble(thing);
8482
- walk_expression(thing.expression);
8483
- if (thing.arity === "binary") {
8484
- if (thing.id !== "(") {
8544
+ thing.forEach(walk_statement);
8545
+ return;
8546
+ }
8547
+ preamble(thing);
8548
+ walk_expression(thing.expression);
8549
+ if (thing.arity === "binary") {
8550
+ if (thing.id !== "(") {
8485
8551
 
8486
8552
  // test_cause:
8487
8553
  // ["0&&0", "walk_statement", "unexpected_expression_a", "&&", 2]
8488
8554
 
8489
- warn("unexpected_expression_a", thing);
8490
- }
8491
- } else if (
8492
- thing.arity !== "statement"
8493
- && thing.arity !== "assignment"
8494
- && thing.id !== "import"
8495
- ) {
8555
+ warn("unexpected_expression_a", thing);
8556
+ }
8557
+ } else if (
8558
+ thing.arity !== "statement"
8559
+ && thing.arity !== "assignment"
8560
+ && thing.id !== "import"
8561
+ ) {
8496
8562
 
8497
8563
  // test_cause:
8498
8564
  // ["!0", "walk_statement", "unexpected_expression_a", "!", 1]
@@ -8501,16 +8567,14 @@ function jslint_phase4_walk(state) {
8501
8567
  // ["0", "walk_statement", "unexpected_expression_a", "0", 1]
8502
8568
  // ["typeof 0", "walk_statement", "unexpected_expression_a", "typeof", 1]
8503
8569
 
8504
- warn("unexpected_expression_a", thing);
8505
- }
8570
+ warn("unexpected_expression_a", thing);
8571
+ }
8506
8572
 
8507
8573
  // Recurse walk_statement().
8508
8574
 
8509
- walk_statement(thing.block);
8510
- walk_statement(thing.else);
8511
- postamble(thing);
8512
- }
8513
- }
8575
+ walk_statement(thing.block);
8576
+ walk_statement(thing.else);
8577
+ postamble(thing);
8514
8578
  }
8515
8579
 
8516
8580
  postaction = action(posts);
@@ -9189,6 +9253,7 @@ function jslint_phase5_whitage(state) {
9189
9253
  )
9190
9254
  || left.id === "function"
9191
9255
  || left.id === ":"
9256
+ || left.id === "async"
9192
9257
  || (
9193
9258
  (
9194
9259
  left.identifier
@@ -9745,6 +9810,7 @@ pyNj+JctcQLXenBOCms46aMkenIx45WpXqxxVJQLz/vgpmAVa0fmDv6Pue9xVTBPfVxCUGfj\
9745
9810
  let {
9746
9811
  context,
9747
9812
  from,
9813
+ id,
9748
9814
  level,
9749
9815
  line,
9750
9816
  name,
@@ -9761,14 +9827,18 @@ pyNj+JctcQLXenBOCms46aMkenIx45WpXqxxVJQLz/vgpmAVa0fmDv6Pue9xVTBPfVxCUGfj\
9761
9827
  + address(line, from + 1)
9762
9828
  + "<dfn>"
9763
9829
  + (
9764
- name === "=>"
9765
- ? htmlEscape(signature) + " =>"
9830
+ id === "=>"
9831
+ ? (
9832
+ "\u00ab" + htmlEscape(name) + "\u00bb"
9833
+ + htmlEscape(signature)
9834
+ + " =>"
9835
+ )
9766
9836
  : (
9767
9837
  typeof name === "string"
9768
9838
  ? "\u00ab" + htmlEscape(name) + "\u00bb"
9769
9839
  : htmlEscape(name.id)
9770
- )
9771
- ) + htmlEscape(signature)
9840
+ ) + htmlEscape(signature)
9841
+ )
9772
9842
  + "</dfn>"
9773
9843
  );
9774
9844
  params = [];
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "engines": {
12
12
  "node": ">=14"
13
13
  },
14
- "fileCount": 34,
14
+ "fileCount": 30,
15
15
  "homepage": "https://github.com/sqlmath/sqlmath",
16
16
  "keywords": [
17
17
  "data-science",
@@ -37,5 +37,5 @@
37
37
  "test2": "sh jslint_ci.sh shCiBase",
38
38
  "test_win32": "node -e \"require('child_process').spawn('C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe',['-c','npm run test' + ' ' + process.argv.slice(1).join(' ')],{stdio:['ignore',1,2]});\""
39
39
  },
40
- "version": "2022.6.30"
40
+ "version": "2022.9.20"
41
41
  }
package/sqlmath.mjs CHANGED
@@ -81,7 +81,7 @@ let debugInline = (function () {
81
81
  return argv[0];
82
82
  }
83
83
  debug(); // Coverage-hack.
84
- __consoleError = console.error;
84
+ __consoleError = console.error; //jslint-ignore-line
85
85
  return debug;
86
86
  }());
87
87
  let sqlMessageDict = {}; // dict of web-worker-callbacks
@@ -887,17 +887,6 @@ function sqlmathWebworkerInit({
887
887
  }) {
888
888
  sqlMessageDict[data.id](data);
889
889
  };
890
- /*
891
- let db = await dbOpenAsync({ //jslint-quiet
892
- filename: ":memory:"
893
- });
894
- debugInline(
895
- await dbExecAsync({
896
- db,
897
- sql: "aSELECT 1234"
898
- })
899
- );
900
- */
901
890
  }
902
891
 
903
892
  await sqlmathInit({});