lilact 0.3.0 → 0.5.0
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/README.md +2 -2
- package/bin/transpile-dir.js +2 -2
- package/bin/transpile.js +5 -5
- package/dist/lilact.development.min.js +1 -1
- package/dist/lilact.development.min.js.LICENSE.txt +1 -1
- package/dist/lilact.development.min.js.map +1 -1
- package/dist/lilact.production.min.js +1 -1
- package/dist/lilact.production.min.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +10 -10
- package/docs/classes/components.HTMLComponent.html +10 -10
- package/docs/classes/components.RootComponent.html +10 -10
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/functions/jsx.transpileJSX.html +3 -3
- package/docs/functions/misc.classNames.html +1 -1
- package/docs/functions/misc.deepEqual.html +1 -1
- package/docs/functions/misc.getComponentByPointer.html +1 -1
- package/docs/functions/misc.isAsync.html +1 -1
- package/docs/functions/misc.isClass.html +1 -1
- package/docs/functions/misc.isEmpty.html +1 -1
- package/docs/functions/misc.isError.html +1 -1
- package/docs/functions/misc.isThenable.html +1 -1
- package/docs/functions/misc.shallowEqual.html +1 -1
- package/docs/functions/misc.toBool.html +3 -0
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/transition.Transition.html +3 -3
- package/docs/index.html +3 -3
- package/docs/modules/misc.html +1 -1
- package/docs/modules/run.html +1 -1
- package/docs/static/demos/error-1.jsx +10 -0
- package/docs/static/demos/error-2.jsx +7 -0
- package/docs/static/demos/error-3.jsx +9 -0
- package/docs/static/demos/form-elements.jsx +110 -0
- package/docs/static/index.html +8 -4
- package/docs/static/lilact.development.min.js +1 -1
- package/docs/static/lilact.production.min.js +1 -1
- package/docs/variables/misc.required_scripts.html +1 -0
- package/package.json +2 -2
- package/root/demos/error-1.jsx +10 -0
- package/root/demos/error-2.jsx +7 -0
- package/root/demos/error-3.jsx +9 -0
- package/root/demos/form-elements.jsx +110 -0
- package/root/index.html +8 -4
- package/root/lilact.development.min.js +1 -1
- package/root/lilact.production.min.js +1 -1
- package/src/components.jsx +41 -22
- package/src/errors.jsx +217 -0
- package/src/events.jsx +4 -14
- package/src/jsx.js +35 -43
- package/src/lilact.jsx +13 -5
- package/src/misc.jsx +44 -73
- package/src/run.jsx +22 -96
- package/docs/functions/run.traceError.html +0 -6
- /package/docs/static/demos/{boundary.jsx → error-boundary.jsx} +0 -0
- /package/root/demos/{boundary.jsx → error-boundary.jsx} +0 -0
package/src/misc.jsx
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
modification, are permitted provided that the following conditions are met:
|
|
11
11
|
|
|
12
12
|
* Redistributions of source code must retain the above copyright
|
|
13
|
-
|
|
13
|
+
notice, this list of conditions and the following disclaimer.
|
|
14
14
|
* Redistributions in binary form must reproduce the above copyright
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
notice, this list of conditions and the following disclaimer in the
|
|
16
|
+
documentation and/or other materials provided with the distribution.
|
|
17
17
|
|
|
18
18
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
19
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
@@ -38,10 +38,10 @@ const typeOf = (input) => {
|
|
|
38
38
|
// used for object comparison functions
|
|
39
39
|
// https://monsterlessons-academy.com/posts/shallow-comparison-vs-deep-comparison-in-javascript
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const rawObject = Object.prototype.toString.call(input).toLowerCase();
|
|
42
|
+
const typeOfRegex = /\[object (.*)]/g;
|
|
43
|
+
const type = typeOfRegex.exec(rawObject)[1];
|
|
44
|
+
return type;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
|
|
@@ -146,63 +146,6 @@ export const Children = {
|
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
|
|
149
|
-
// Lilact API
|
|
150
|
-
/** @ignore */
|
|
151
|
-
export function getErrorLocation(err) // works for both error and error-event, and also in node env
|
|
152
|
-
{
|
|
153
|
-
if(err.lineno!==undefined || err.line!==undefined || err.lineNumber!==undefined) {
|
|
154
|
-
const l = err.lineno || err.line || err.lineNumber;
|
|
155
|
-
const c = err.colno || err.column || err.columnNumber;
|
|
156
|
-
|
|
157
|
-
return [l, c];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
let match = /:(\d+):(\d+)[\n].*/m.exec(err.stack);
|
|
161
|
-
if(match===null) {
|
|
162
|
-
match = /:(\d+):(\d+)\)\s+at .*/m.exec(err.stack);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if(match) {
|
|
166
|
-
return [parseInt(match[1]), parseInt(match[2])]
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/** @ignore */
|
|
173
|
-
export function mapLocation(mps, r,c)
|
|
174
|
-
{
|
|
175
|
-
let map = [0,0,0,0];
|
|
176
|
-
|
|
177
|
-
for(const i in mps) {
|
|
178
|
-
if(mps[i][0]<r) continue;
|
|
179
|
-
if(mps[i][0]>r || mps[i][1]>=c) {
|
|
180
|
-
map = mps[i-1];
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return [r-map[0]+map[2], ((r-map[0]===0)?map[3]:0)];
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
/** @ignore */
|
|
190
|
-
export function scanFunctionLabels(code, path)
|
|
191
|
-
{
|
|
192
|
-
const ls = Array.from( code.matchAll(/LILACTBLOCK(\d+):(\d+),(\d+):([^*]+)\*\//mg) );
|
|
193
|
-
|
|
194
|
-
ls.forEach(
|
|
195
|
-
(x) => Lilact.transpilerConfig.func_labels[x[1]] = {
|
|
196
|
-
path,
|
|
197
|
-
row: parseInt(x[2])+1,
|
|
198
|
-
col: parseInt(x[3])+1,
|
|
199
|
-
label: x[4],
|
|
200
|
-
required: Lilact.transpilerConfig.required[path]
|
|
201
|
-
} );
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
149
|
/**
|
|
207
150
|
* Debug tool to detect the component visible at a point on screen.
|
|
208
151
|
*
|
|
@@ -347,7 +290,7 @@ export function isClass(func) {
|
|
|
347
290
|
* @returns True if the value is an async function; otherwise false.
|
|
348
291
|
*/
|
|
349
292
|
export function isAsync(fn) {
|
|
350
|
-
|
|
293
|
+
return typeof fn === 'function' && fn.constructor && fn.constructor.name === 'AsyncFunction';
|
|
351
294
|
}
|
|
352
295
|
|
|
353
296
|
/**
|
|
@@ -370,11 +313,31 @@ export function isError(x) {
|
|
|
370
313
|
return x instanceof Error || Object.prototype.toString.call(x) === '[object Error]';
|
|
371
314
|
}
|
|
372
315
|
|
|
316
|
+
/**
|
|
317
|
+
* Converts the input to a boolean value
|
|
318
|
+
*
|
|
319
|
+
* @param value - Value to inspect.
|
|
320
|
+
* @returns boolean value
|
|
321
|
+
*/
|
|
322
|
+
export function toBool(x) {
|
|
323
|
+
if (typeof x === "boolean") return x;
|
|
373
324
|
|
|
325
|
+
if (typeof x === "number") return x !== 0;
|
|
326
|
+
|
|
327
|
+
if (typeof x === "string") {
|
|
328
|
+
x = x.trim().toLowerCase();
|
|
329
|
+
if (x === "true") return true;
|
|
330
|
+
if (x === "false") return false;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return Boolean(x);
|
|
334
|
+
}
|
|
374
335
|
|
|
375
336
|
|
|
376
337
|
// Internals
|
|
377
338
|
|
|
339
|
+
export const required_scripts = {};
|
|
340
|
+
|
|
378
341
|
/** @ignore */
|
|
379
342
|
export let update_timeout = undefined;
|
|
380
343
|
/** @ignore */
|
|
@@ -395,13 +358,16 @@ export let update_cbs = new Set;
|
|
|
395
358
|
/** @ignore */
|
|
396
359
|
export let roots = new Set;
|
|
397
360
|
/** @ignore */
|
|
398
|
-
export let special_attributes = new Set(["classname", "classname", "ref", "action", "lilact_jsx_loc", "children", "key"]);
|
|
399
|
-
/** @ignore */
|
|
400
|
-
export let err = null; // this is only to ease debuggin,
|
|
401
|
-
/** @ignore */
|
|
402
361
|
export let layout_effects = new Set;
|
|
362
|
+
|
|
363
|
+
/** @ignore */
|
|
364
|
+
export const special_attributes = new Set([
|
|
365
|
+
"classname", "classname", "ref", "action", "lilact_jsx_loc", "children", "key",
|
|
366
|
+
"defaultvalue", "defaultchecked"
|
|
367
|
+
]);
|
|
368
|
+
|
|
403
369
|
/** @ignore */
|
|
404
|
-
export
|
|
370
|
+
export const events_set = new Set([
|
|
405
371
|
"onafterprint","onbeforeprint","onbeforeunload","onerror","onhashchange","onload","onmessage",
|
|
406
372
|
"onoffline","ononline","onpagehide","onpageshow","onpopstate","onresize","onstorage","onunload",
|
|
407
373
|
"onblur","onchange","oncontextmenu","onfocus","oninput","oninvalid","onreset","onsearch","onselect",
|
|
@@ -418,14 +384,19 @@ export let events_set = new Set([
|
|
|
418
384
|
|
|
419
385
|
"onpointerdown", "onpointerup", "onpointermove", "onpointercancel", "onpointerover", "onpointerout",
|
|
420
386
|
"onpointerenter", "onpointerleave"
|
|
421
|
-
])
|
|
387
|
+
]);
|
|
388
|
+
|
|
422
389
|
/** @ignore */
|
|
423
|
-
export
|
|
390
|
+
export const length_css_attributes_set = new Set([
|
|
424
391
|
"width","height","minWidth","minHeight","maxWidth","maxHeight","top","right","bottom","left","margin",
|
|
425
392
|
"marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom",
|
|
426
393
|
"paddingLeft","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth",
|
|
427
394
|
"outlineWidth","fontSize","lineHeight","letterSpacing","wordSpacing","textIndent","borderRadius",
|
|
428
395
|
"borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius",
|
|
429
396
|
"columnGap","rowGap","gap"
|
|
430
|
-
])
|
|
397
|
+
]);
|
|
431
398
|
|
|
399
|
+
/** @ignore */
|
|
400
|
+
export const boolean_html_attributes_set = new
|
|
401
|
+
Set(["disabled", "readOnly", "required", "checked", "multiple",
|
|
402
|
+
"hidden","open","loop","muted","controls","playsInline","allowFullScreen"]);
|
package/src/run.jsx
CHANGED
|
@@ -50,12 +50,19 @@ import Lilact from './lilact.jsx';
|
|
|
50
50
|
*/
|
|
51
51
|
export function run(jsx, path=`<string input ${++Lilact.eval_num}>`, is_inline=true)
|
|
52
52
|
{
|
|
53
|
-
if(Lilact.checkTraceErrors) Lilact.checkTraceErrors;
|
|
54
|
-
|
|
55
53
|
const mappings = [];
|
|
56
|
-
|
|
54
|
+
const module = {};
|
|
57
55
|
let processed;
|
|
58
56
|
|
|
57
|
+
Lilact.required_scripts[path] = {
|
|
58
|
+
mappings,
|
|
59
|
+
module,
|
|
60
|
+
is_inline,
|
|
61
|
+
path,
|
|
62
|
+
code: jsx,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
|
|
59
66
|
try {
|
|
60
67
|
processed = Lilact.transpileJSX( jsx,
|
|
61
68
|
{
|
|
@@ -63,37 +70,23 @@ export function run(jsx, path=`<string input ${++Lilact.eval_num}>`, is_inline=t
|
|
|
63
70
|
mappings,
|
|
64
71
|
factory: "Lilact.createComponent",
|
|
65
72
|
append_sourcemap: !is_inline,
|
|
66
|
-
|
|
73
|
+
blocks_info: Lilact.blocks_info,
|
|
74
|
+
|
|
75
|
+
injectTraceLabels: true,
|
|
67
76
|
} );
|
|
68
77
|
}
|
|
69
78
|
catch(e) {
|
|
70
|
-
e
|
|
79
|
+
//e = Lilact.traceError(e);
|
|
80
|
+
Lilact.error = e;
|
|
71
81
|
throw e;
|
|
72
82
|
}
|
|
73
83
|
|
|
74
|
-
// the separation of module property is to create the required object even on error
|
|
75
|
-
|
|
76
|
-
const module = {};
|
|
77
|
-
|
|
78
|
-
Lilact.transpilerConfig.required[path] = {
|
|
79
|
-
mappings,
|
|
80
|
-
processed,
|
|
81
|
-
module,
|
|
82
|
-
is_inline,
|
|
83
|
-
path,
|
|
84
|
-
code: jsx
|
|
85
|
-
};
|
|
86
84
|
|
|
85
|
+
ʔ if(DEBUG) {
|
|
86
|
+
Lilact.required_scripts[path].processed = processed;
|
|
87
|
+
ʔ }
|
|
87
88
|
|
|
88
|
-
Lilact.
|
|
89
|
-
|
|
90
|
-
Lilact.transpilerConfig.func_labels[path] = {
|
|
91
|
-
path,
|
|
92
|
-
row: 0,
|
|
93
|
-
col: 0,
|
|
94
|
-
label: "<EXEC>",
|
|
95
|
-
required: Lilact.transpilerConfig.required[path]
|
|
96
|
-
}
|
|
89
|
+
Lilact.scanBlockLabels(processed, path);
|
|
97
90
|
|
|
98
91
|
try {
|
|
99
92
|
globalThis.Lilact = Lilact;
|
|
@@ -103,7 +96,7 @@ export function run(jsx, path=`<string input ${++Lilact.eval_num}>`, is_inline=t
|
|
|
103
96
|
return res;
|
|
104
97
|
}
|
|
105
98
|
catch(e) {
|
|
106
|
-
e
|
|
99
|
+
e = Lilact.traceError(e);
|
|
107
100
|
throw e;
|
|
108
101
|
}
|
|
109
102
|
}
|
|
@@ -220,74 +213,6 @@ export function lazy(factory) {
|
|
|
220
213
|
return LazyComponent;
|
|
221
214
|
}
|
|
222
215
|
|
|
223
|
-
/**
|
|
224
|
-
* Debug tool to get the Lilact traced location of an error. It can also produce some block based stack trace
|
|
225
|
-
* if `Lilact.transpilerConfig.enableLabelStack` is set to `true` before loading the script. This is `false`
|
|
226
|
-
* by default for efficiency.
|
|
227
|
-
*
|
|
228
|
-
* @returns A new object that includes `path`, `row`, `col`, `msg`, `name`, and optional `stack`.
|
|
229
|
-
* The exception itself is stored as `err`.
|
|
230
|
-
*/
|
|
231
|
-
export function traceError(err)
|
|
232
|
-
{
|
|
233
|
-
const loc = Lilact.getErrorLocation(err);
|
|
234
|
-
|
|
235
|
-
const obj = {
|
|
236
|
-
path: err.fileName,
|
|
237
|
-
label: null,
|
|
238
|
-
|
|
239
|
-
row: loc[0],
|
|
240
|
-
col: loc[1],
|
|
241
|
-
|
|
242
|
-
msg: err.message,
|
|
243
|
-
name: err.name,
|
|
244
|
-
|
|
245
|
-
stack: null,
|
|
246
|
-
err: err
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if(err.lilact_trace!==undefined) {
|
|
251
|
-
|
|
252
|
-
// to be able to trace, we assume that all of the scripts are running inside lilact.
|
|
253
|
-
// if not, the error is returned unchanged and stack and label would remain null.
|
|
254
|
-
|
|
255
|
-
let mps;
|
|
256
|
-
let blk;
|
|
257
|
-
if(typeof(err.lilact_trace)==='string') {
|
|
258
|
-
blk = Lilact.func_labels[err.lilact_trace];
|
|
259
|
-
mps = blk.required.mappings;
|
|
260
|
-
}
|
|
261
|
-
else if(typeof(err.lilact_trace)==='object') {
|
|
262
|
-
blk = Lilact.func_labels[err.lilact_trace[0]];
|
|
263
|
-
mps = blk.mappings;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
obj.path = blk.path;
|
|
267
|
-
obj.label = blk.label;
|
|
268
|
-
|
|
269
|
-
[obj.row, obj.col] = Lilact.mapLocation(mps, obj.row,obj.col);
|
|
270
|
-
|
|
271
|
-
//const rm = Lilact.func_labels[func_num].required;
|
|
272
|
-
|
|
273
|
-
// Lilact.onError( err.message,
|
|
274
|
-
// rm.path,
|
|
275
|
-
// Lilact.func_labels[func_num].label,
|
|
276
|
-
// ...Lilact.mapLocation(...loc,mps),
|
|
277
|
-
// Lilact.call_stack.map(
|
|
278
|
-
// (x)=>({ path: Lilact.func_labels[x].path,
|
|
279
|
-
// label: Lilact.func_labels[x].label,
|
|
280
|
-
// row: Lilact.func_labels[x].row
|
|
281
|
-
// })
|
|
282
|
-
// ), err );
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return obj;
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
291
216
|
function scanScriptTagsWithType() {
|
|
292
217
|
const scripts = Array.from(
|
|
293
218
|
document.querySelectorAll('script[type="text/jsx"]')
|
|
@@ -320,4 +245,5 @@ export function runScripts()
|
|
|
320
245
|
if(s.src) Lilact.require(s.src);
|
|
321
246
|
if(s.content) Lilact.run(s.content);
|
|
322
247
|
}
|
|
323
|
-
}
|
|
248
|
+
}
|
|
249
|
+
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>traceError | Lilact</title><meta name="description" content="Documentation for Lilact"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Lilact</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/run.html">run</a></li><li><a href="" aria-current="page">traceError</a></li></ul><h1>Function traceError</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="traceerror"><span class="tsd-kind-call-signature">traceError</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">err</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">col</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">err</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">label</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">msg</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">path</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">row</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">stack</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><a href="#traceerror" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Debug tool to get the Lilact traced location of an error. It can also produce some block based stack trace
|
|
2
|
-
if <code>Lilact.transpilerConfig.enableLabelStack</code> is set to <code>true</code> before loading the script. This is <code>false</code>
|
|
3
|
-
by default for efficiency.</p>
|
|
4
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">err</span>: <span class="tsd-signature-type">any</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">col</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">err</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">label</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">msg</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">path</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">row</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">stack</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></h4><p>A new object that includes <code>path</code>, <code>row</code>, <code>col</code>, <code>msg</code>, <code>name</code>, and optional <code>stack</code>.
|
|
5
|
-
The exception itself is stored as <code>err</code>.</p>
|
|
6
|
-
<aside class="tsd-sources"><ul><li>Defined in run.js:231</li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Lilact</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
File without changes
|
|
File without changes
|