This is page 159 of 181. Use http://codebase.md/xmlui-org/xmlui?lines=true&page={x} to view the full context. # Directory Structure ``` ├── .changeset │ └── config.json ├── .eslintrc.cjs ├── .github │ ├── build-checklist.png │ ├── ISSUE_TEMPLATE │ │ ├── bug_report.md │ │ └── feature_request.md │ └── workflows │ ├── deploy-blog.yml │ ├── deploy-docs-optimized.yml │ ├── deploy-docs.yml │ ├── prepare-versions.yml │ ├── release-packages.yml │ ├── run-all-tests.yml │ └── run-smoke-tests.yml ├── .gitignore ├── .prettierrc.js ├── .vscode │ ├── launch.json │ └── settings.json ├── blog │ ├── .gitignore │ ├── .gitkeep │ ├── CHANGELOG.md │ ├── extensions.ts │ ├── index.html │ ├── index.ts │ ├── layout-changes.md │ ├── package.json │ ├── public │ │ ├── blog │ │ │ ├── images │ │ │ │ ├── blog-page-component.png │ │ │ │ ├── blog-scrabble.png │ │ │ │ ├── integrated-blog-search.png │ │ │ │ └── lorem-ipsum.png │ │ │ ├── lorem-ipsum.md │ │ │ ├── newest-post.md │ │ │ ├── older-post.md │ │ │ └── welcome-to-the-xmlui-blog.md │ │ ├── mockServiceWorker.js │ │ ├── netlify.toml │ │ ├── resources │ │ │ ├── favicon.ico │ │ │ ├── files │ │ │ │ └── for-download │ │ │ │ └── xmlui │ │ │ │ └── xmlui-standalone.umd.js │ │ │ ├── github.svg │ │ │ ├── llms.txt │ │ │ ├── logo-dark.svg │ │ │ ├── logo.svg │ │ │ ├── pg-popout.svg │ │ │ └── xmlui-logo.svg │ │ ├── serve.json │ │ └── web.config │ ├── scripts │ │ ├── download-latest-xmlui.js │ │ ├── generate-rss.js │ │ ├── get-releases.js │ │ └── utils.js │ ├── src │ │ ├── components │ │ │ ├── BlogOverview.xmlui │ │ │ ├── BlogPage.xmlui │ │ │ ├── Debug.xmlui │ │ │ ├── Headlines.xmlui │ │ │ └── PageNotFound.xmlui │ │ ├── config.ts │ │ ├── Main.xmlui │ │ └── themes │ │ └── blog-theme.ts │ └── tsconfig.json ├── CONTRIBUTING.md ├── docs │ ├── .gitignore │ ├── CHANGELOG.md │ ├── ComponentRefLinks.txt │ ├── content │ │ ├── _meta.json │ │ ├── components │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ ├── APICall.md │ │ │ ├── App.md │ │ │ ├── AppHeader.md │ │ │ ├── AppState.md │ │ │ ├── AutoComplete.md │ │ │ ├── Avatar.md │ │ │ ├── Backdrop.md │ │ │ ├── Badge.md │ │ │ ├── BarChart.md │ │ │ ├── Bookmark.md │ │ │ ├── Breakout.md │ │ │ ├── Button.md │ │ │ ├── Card.md │ │ │ ├── Carousel.md │ │ │ ├── ChangeListener.md │ │ │ ├── Checkbox.md │ │ │ ├── CHStack.md │ │ │ ├── ColorPicker.md │ │ │ ├── Column.md │ │ │ ├── ContentSeparator.md │ │ │ ├── CVStack.md │ │ │ ├── DataSource.md │ │ │ ├── DateInput.md │ │ │ ├── DatePicker.md │ │ │ ├── DonutChart.md │ │ │ ├── DropdownMenu.md │ │ │ ├── EmojiSelector.md │ │ │ ├── ExpandableItem.md │ │ │ ├── FileInput.md │ │ │ ├── FileUploadDropZone.md │ │ │ ├── FlowLayout.md │ │ │ ├── Footer.md │ │ │ ├── Form.md │ │ │ ├── FormItem.md │ │ │ ├── FormSection.md │ │ │ ├── Fragment.md │ │ │ ├── H1.md │ │ │ ├── H2.md │ │ │ ├── H3.md │ │ │ ├── H4.md │ │ │ ├── H5.md │ │ │ ├── H6.md │ │ │ ├── Heading.md │ │ │ ├── HSplitter.md │ │ │ ├── HStack.md │ │ │ ├── Icon.md │ │ │ ├── IFrame.md │ │ │ ├── Image.md │ │ │ ├── Items.md │ │ │ ├── LabelList.md │ │ │ ├── Legend.md │ │ │ ├── LineChart.md │ │ │ ├── Link.md │ │ │ ├── List.md │ │ │ ├── Logo.md │ │ │ ├── Markdown.md │ │ │ ├── MenuItem.md │ │ │ ├── MenuSeparator.md │ │ │ ├── ModalDialog.md │ │ │ ├── NavGroup.md │ │ │ ├── NavLink.md │ │ │ ├── NavPanel.md │ │ │ ├── NoResult.md │ │ │ ├── NumberBox.md │ │ │ ├── Option.md │ │ │ ├── Page.md │ │ │ ├── PageMetaTitle.md │ │ │ ├── Pages.md │ │ │ ├── Pagination.md │ │ │ ├── PasswordInput.md │ │ │ ├── PieChart.md │ │ │ ├── ProgressBar.md │ │ │ ├── Queue.md │ │ │ ├── RadioGroup.md │ │ │ ├── RealTimeAdapter.md │ │ │ ├── Redirect.md │ │ │ ├── Select.md │ │ │ ├── Slider.md │ │ │ ├── Slot.md │ │ │ ├── SpaceFiller.md │ │ │ ├── Spinner.md │ │ │ ├── Splitter.md │ │ │ ├── Stack.md │ │ │ ├── StickyBox.md │ │ │ ├── SubMenuItem.md │ │ │ ├── Switch.md │ │ │ ├── TabItem.md │ │ │ ├── Table.md │ │ │ ├── TableOfContents.md │ │ │ ├── Tabs.md │ │ │ ├── Text.md │ │ │ ├── TextArea.md │ │ │ ├── TextBox.md │ │ │ ├── Theme.md │ │ │ ├── TimeInput.md │ │ │ ├── Timer.md │ │ │ ├── ToneChangerButton.md │ │ │ ├── ToneSwitch.md │ │ │ ├── Tooltip.md │ │ │ ├── Tree.md │ │ │ ├── VSplitter.md │ │ │ ├── VStack.md │ │ │ ├── xmlui-animations │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ ├── Animation.md │ │ │ │ ├── FadeAnimation.md │ │ │ │ ├── FadeInAnimation.md │ │ │ │ ├── FadeOutAnimation.md │ │ │ │ ├── ScaleAnimation.md │ │ │ │ └── SlideInAnimation.md │ │ │ ├── xmlui-pdf │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ └── Pdf.md │ │ │ ├── xmlui-spreadsheet │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ └── Spreadsheet.md │ │ │ └── xmlui-website-blocks │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ ├── Carousel.md │ │ │ ├── HelloMd.md │ │ │ ├── HeroSection.md │ │ │ └── ScrollToTop.md │ │ └── extensions │ │ ├── _meta.json │ │ ├── xmlui-animations │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ ├── Animation.md │ │ │ ├── FadeAnimation.md │ │ │ ├── FadeInAnimation.md │ │ │ ├── FadeOutAnimation.md │ │ │ ├── ScaleAnimation.md │ │ │ └── SlideInAnimation.md │ │ └── xmlui-website-blocks │ │ ├── _meta.json │ │ ├── _overview.md │ │ ├── Carousel.md │ │ ├── HelloMd.md │ │ ├── HeroSection.md │ │ └── ScrollToTop.md │ ├── extensions.ts │ ├── index.html │ ├── index.ts │ ├── package.json │ ├── public │ │ ├── feed.rss │ │ ├── mockServiceWorker.js │ │ ├── pages │ │ │ ├── _meta.json │ │ │ ├── app-structure.md │ │ │ ├── build-editor-component.md │ │ │ ├── build-hello-world-component.md │ │ │ ├── components-intro.md │ │ │ ├── context-variables.md │ │ │ ├── forms.md │ │ │ ├── globals.md │ │ │ ├── glossary.md │ │ │ ├── helper-tags.md │ │ │ ├── hosted-deployment.md │ │ │ ├── howto │ │ │ │ ├── assign-a-complex-json-literal-to-a-component-variable.md │ │ │ │ ├── chain-a-refetch.md │ │ │ │ ├── debug-a-component.md │ │ │ │ ├── delay-a-datasource-until-another-datasource-is-ready.md │ │ │ │ ├── delegate-a-method.md │ │ │ │ ├── do-custom-form-validation.md │ │ │ │ ├── expose-a-method-from-a-component.md │ │ │ │ ├── filter-and-transform-data-from-an-api.md │ │ │ │ ├── group-items-in-list-by-a-property.md │ │ │ │ ├── handle-background-operations.md │ │ │ │ ├── hide-an-element-until-its-datasource-is-ready.md │ │ │ │ ├── make-a-set-of-equal-width-cards.md │ │ │ │ ├── make-a-table-responsive.md │ │ │ │ ├── make-navpanel-width-responsive.md │ │ │ │ ├── modify-a-value-reported-in-a-column.md │ │ │ │ ├── paginate-a-list.md │ │ │ │ ├── pass-data-to-a-modal-dialog.md │ │ │ │ ├── react-to-button-click-not-keystrokes.md │ │ │ │ ├── set-the-initial-value-of-a-select-from-fetched-data.md │ │ │ │ ├── share-a-modaldialog-across-components.md │ │ │ │ ├── sync-selections-between-table-and-list-views.md │ │ │ │ ├── update-ui-optimistically.md │ │ │ │ ├── use-built-in-form-validation.md │ │ │ │ └── use-the-same-modaldialog-to-add-or-edit.md │ │ │ ├── howto.md │ │ │ ├── intro.md │ │ │ ├── layout.md │ │ │ ├── markup.md │ │ │ ├── mcp.md │ │ │ ├── modal-dialogs.md │ │ │ ├── news-and-reviews.md │ │ │ ├── reactive-intro.md │ │ │ ├── refactoring.md │ │ │ ├── routing-and-links.md │ │ │ ├── samples │ │ │ │ ├── color-palette.xmlui │ │ │ │ ├── color-values.xmlui │ │ │ │ ├── shadow-sizes.xmlui │ │ │ │ ├── spacing-sizes.xmlui │ │ │ │ ├── swatch.xmlui │ │ │ │ ├── theme-gallery-brief.xmlui │ │ │ │ └── theme-gallery.xmlui │ │ │ ├── scoping.md │ │ │ ├── scripting.md │ │ │ ├── styles-and-themes │ │ │ │ ├── common-units.md │ │ │ │ ├── layout-props.md │ │ │ │ ├── theme-variable-defaults.md │ │ │ │ ├── theme-variables.md │ │ │ │ └── themes.md │ │ │ ├── template-properties.md │ │ │ ├── test.md │ │ │ ├── tutorial-01.md │ │ │ ├── tutorial-02.md │ │ │ ├── tutorial-03.md │ │ │ ├── tutorial-04.md │ │ │ ├── tutorial-05.md │ │ │ ├── tutorial-06.md │ │ │ ├── tutorial-07.md │ │ │ ├── tutorial-08.md │ │ │ ├── tutorial-09.md │ │ │ ├── tutorial-10.md │ │ │ ├── tutorial-11.md │ │ │ ├── tutorial-12.md │ │ │ ├── universal-properties.md │ │ │ ├── user-defined-components.md │ │ │ ├── vscode.md │ │ │ ├── working-with-markdown.md │ │ │ ├── working-with-text.md │ │ │ ├── xmlui-animations │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ ├── Animation.md │ │ │ │ ├── FadeAnimation.md │ │ │ │ ├── FadeInAnimation.md │ │ │ │ ├── FadeOutAnimation.md │ │ │ │ ├── ScaleAnimation.md │ │ │ │ └── SlideInAnimation.md │ │ │ ├── xmlui-charts │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ ├── BarChart.md │ │ │ │ ├── DonutChart.md │ │ │ │ ├── LabelList.md │ │ │ │ ├── Legend.md │ │ │ │ ├── LineChart.md │ │ │ │ └── PieChart.md │ │ │ ├── xmlui-pdf │ │ │ │ ├── _meta.json │ │ │ │ ├── _overview.md │ │ │ │ └── Pdf.md │ │ │ └── xmlui-spreadsheet │ │ │ ├── _meta.json │ │ │ ├── _overview.md │ │ │ └── Spreadsheet.md │ │ ├── resources │ │ │ ├── devdocs │ │ │ │ ├── debug-proxy-object-2.png │ │ │ │ ├── debug-proxy-object.png │ │ │ │ ├── table_editor_01.png │ │ │ │ ├── table_editor_02.png │ │ │ │ ├── table_editor_03.png │ │ │ │ ├── table_editor_04.png │ │ │ │ ├── table_editor_05.png │ │ │ │ ├── table_editor_06.png │ │ │ │ ├── table_editor_07.png │ │ │ │ ├── table_editor_08.png │ │ │ │ ├── table_editor_09.png │ │ │ │ ├── table_editor_10.png │ │ │ │ ├── table_editor_11.png │ │ │ │ ├── table-editor-01.png │ │ │ │ ├── table-editor-02.png │ │ │ │ ├── table-editor-03.png │ │ │ │ ├── table-editor-04.png │ │ │ │ ├── table-editor-06.png │ │ │ │ ├── table-editor-07.png │ │ │ │ ├── table-editor-08.png │ │ │ │ ├── table-editor-09.png │ │ │ │ └── xmlui-rendering-of-tiptap-markdown.png │ │ │ ├── favicon.ico │ │ │ ├── files │ │ │ │ ├── clients.json │ │ │ │ ├── daily-revenue.json │ │ │ │ ├── dashboard-stats.json │ │ │ │ ├── demo.xmlui │ │ │ │ ├── demo.xmlui.xs │ │ │ │ ├── downloads │ │ │ │ │ └── downloads.json │ │ │ │ ├── for-download │ │ │ │ │ ├── index-with-api.html │ │ │ │ │ ├── index.html │ │ │ │ │ ├── mockApi.js │ │ │ │ │ ├── start-darwin.sh │ │ │ │ │ ├── start-linux.sh │ │ │ │ │ ├── start.bat │ │ │ │ │ └── xmlui │ │ │ │ │ └── xmlui-standalone.umd.js │ │ │ │ ├── getting-started │ │ │ │ │ ├── cl-tutorial-final.zip │ │ │ │ │ ├── cl-tutorial.zip │ │ │ │ │ ├── cl-tutorial2.zip │ │ │ │ │ ├── cl-tutorial3.zip │ │ │ │ │ ├── cl-tutorial4.zip │ │ │ │ │ ├── cl-tutorial5.zip │ │ │ │ │ ├── cl-tutorial6.zip │ │ │ │ │ ├── getting-started.zip │ │ │ │ │ ├── hello-xmlui.zip │ │ │ │ │ ├── xmlui-empty.zip │ │ │ │ │ └── xmlui-starter.zip │ │ │ │ ├── howto │ │ │ │ │ └── component-icons │ │ │ │ │ └── up-arrow.svg │ │ │ │ ├── invoices.json │ │ │ │ ├── monthly-status.json │ │ │ │ ├── news-and-reviews.json │ │ │ │ ├── products.json │ │ │ │ ├── releases.json │ │ │ │ ├── tutorials │ │ │ │ │ ├── datasource │ │ │ │ │ │ └── api.ts │ │ │ │ │ └── p2do │ │ │ │ │ ├── api.ts │ │ │ │ │ └── todo-logo.svg │ │ │ │ └── xmlui.json │ │ │ ├── github.svg │ │ │ ├── images │ │ │ │ ├── apiaction-tutorial │ │ │ │ │ ├── add-success.png │ │ │ │ │ ├── apiaction-param.png │ │ │ │ │ ├── change-completed.png │ │ │ │ │ ├── change-in-progress.png │ │ │ │ │ ├── confirm-delete.png │ │ │ │ │ ├── data-error.png │ │ │ │ │ ├── data-progress.png │ │ │ │ │ ├── data-success.png │ │ │ │ │ ├── display-1.png │ │ │ │ │ ├── item-deleted.png │ │ │ │ │ ├── item-updated.png │ │ │ │ │ ├── missing-api-key.png │ │ │ │ │ ├── new-item-added.png │ │ │ │ │ └── test-message.png │ │ │ │ ├── chat-api │ │ │ │ │ └── domain-model.svg │ │ │ │ ├── components │ │ │ │ │ ├── image │ │ │ │ │ │ └── breakfast.jpg │ │ │ │ │ ├── markdown │ │ │ │ │ │ └── colors.png │ │ │ │ │ └── modal │ │ │ │ │ ├── deep_link_dialog_1.jpg │ │ │ │ │ └── deep_link_dialog_2.jpg │ │ │ │ ├── create-apps │ │ │ │ │ ├── collapsed-vertical.png │ │ │ │ │ ├── using-forms-warning-dialog.png │ │ │ │ │ └── using-forms.png │ │ │ │ ├── datasource-tutorial │ │ │ │ │ ├── data-with-header.png │ │ │ │ │ ├── filtered-data.png │ │ │ │ │ ├── filtered-items.png │ │ │ │ │ ├── initial-page-items.png │ │ │ │ │ ├── list-items.png │ │ │ │ │ ├── next-page-items.png │ │ │ │ │ ├── no-data.png │ │ │ │ │ ├── pagination-1.jpg │ │ │ │ │ ├── pagination-1.png │ │ │ │ │ ├── polling-1.png │ │ │ │ │ ├── refetch-data.png │ │ │ │ │ ├── slow-loading.png │ │ │ │ │ ├── test-message.png │ │ │ │ │ ├── Thumbs.db │ │ │ │ │ ├── unconventional-data.png │ │ │ │ │ └── unfiltered-items.png │ │ │ │ ├── flower.jpg │ │ │ │ ├── get-started │ │ │ │ │ ├── add-new-contact.png │ │ │ │ │ ├── app-modified.png │ │ │ │ │ ├── app-start.png │ │ │ │ │ ├── app-with-boxes.png │ │ │ │ │ ├── app-with-toast.png │ │ │ │ │ ├── boilerplate-structure.png │ │ │ │ │ ├── cl-initial.png │ │ │ │ │ ├── cl-start.png │ │ │ │ │ ├── contact-counts.png │ │ │ │ │ ├── contact-dialog-title.png │ │ │ │ │ ├── contact-dialog.png │ │ │ │ │ ├── contact-menus.png │ │ │ │ │ ├── contact-predicates.png │ │ │ │ │ ├── context-menu.png │ │ │ │ │ ├── dashboard-numbers.png │ │ │ │ │ ├── default-contact-list.png │ │ │ │ │ ├── delete-contact.png │ │ │ │ │ ├── delete-task.png │ │ │ │ │ ├── detailed-template.png │ │ │ │ │ ├── edit-contact-details.png │ │ │ │ │ ├── edited-contact-saved.png │ │ │ │ │ ├── empty-sections.png │ │ │ │ │ ├── filter-completed.png │ │ │ │ │ ├── fullwidth-desktop.png │ │ │ │ │ ├── fullwidth-mobile.png │ │ │ │ │ ├── initial-table.png │ │ │ │ │ ├── items-and-badges.png │ │ │ │ │ ├── loading-message.png │ │ │ │ │ ├── new-contact-button.png │ │ │ │ │ ├── new-contact-saved.png │ │ │ │ │ ├── no-empty-sections.png │ │ │ │ │ ├── personal-todo-initial.png │ │ │ │ │ ├── piechart.png │ │ │ │ │ ├── review-today.png │ │ │ │ │ ├── rudimentary-dashboard.png │ │ │ │ │ ├── section-collapsed.png │ │ │ │ │ ├── sectioned-items.png │ │ │ │ │ ├── sections-ordered.png │ │ │ │ │ ├── spacex-list-with-links.png │ │ │ │ │ ├── spacex-list.png │ │ │ │ │ ├── start-personal-todo-1.png │ │ │ │ │ ├── submit-new-contact.png │ │ │ │ │ ├── submit-new-task.png │ │ │ │ │ ├── syntax-highlighting.png │ │ │ │ │ ├── table-with-badge.png │ │ │ │ │ ├── template-with-card.png │ │ │ │ │ ├── test-emulated-api.png │ │ │ │ │ ├── Thumbs.db │ │ │ │ │ ├── todo-logo.png │ │ │ │ │ └── xmlui-tools.png │ │ │ │ ├── HelloApp.png │ │ │ │ ├── HelloApp2.png │ │ │ │ ├── logos │ │ │ │ │ ├── xmlui1.svg │ │ │ │ │ ├── xmlui2.svg │ │ │ │ │ ├── xmlui3.svg │ │ │ │ │ ├── xmlui4.svg │ │ │ │ │ ├── xmlui5.svg │ │ │ │ │ ├── xmlui6.svg │ │ │ │ │ └── xmlui7.svg │ │ │ │ ├── pdf │ │ │ │ │ └── dummy-pdf.jpg │ │ │ │ ├── rendering-engine │ │ │ │ │ ├── AppEngine-flow.svg │ │ │ │ │ ├── Component.svg │ │ │ │ │ ├── CompoundComponent.svg │ │ │ │ │ ├── RootComponent.svg │ │ │ │ │ └── tree-with-containers.svg │ │ │ │ ├── reviewers-guide │ │ │ │ │ ├── AppEngine-flow.svg │ │ │ │ │ └── incbutton-in-action.png │ │ │ │ ├── tools │ │ │ │ │ └── boilerplate-structure.png │ │ │ │ ├── try.svg │ │ │ │ ├── tutorial │ │ │ │ │ ├── app-chat-history.png │ │ │ │ │ ├── app-content-placeholder.png │ │ │ │ │ ├── app-header-and-content.png │ │ │ │ │ ├── app-links-channel-selected.png │ │ │ │ │ ├── app-links-click.png │ │ │ │ │ ├── app-navigation.png │ │ │ │ │ ├── finished-ex01.png │ │ │ │ │ ├── finished-ex02.png │ │ │ │ │ ├── hello.png │ │ │ │ │ ├── splash-screen-advanced.png │ │ │ │ │ ├── splash-screen-after-click.png │ │ │ │ │ ├── splash-screen-centered.png │ │ │ │ │ ├── splash-screen-events.png │ │ │ │ │ ├── splash-screen-expression.png │ │ │ │ │ ├── splash-screen-reuse-after.png │ │ │ │ │ ├── splash-screen-reuse-before.png │ │ │ │ │ └── splash-screen.png │ │ │ │ └── tutorial-01.png │ │ │ ├── llms.txt │ │ │ ├── logo-dark.svg │ │ │ ├── logo.svg │ │ │ ├── pg-popout.svg │ │ │ └── xmlui-logo.svg │ │ ├── serve.json │ │ └── web.config │ ├── scripts │ │ ├── download-latest-xmlui.js │ │ ├── generate-rss.js │ │ ├── get-releases.js │ │ └── utils.js │ ├── src │ │ ├── components │ │ │ ├── BlogOverview.xmlui │ │ │ ├── BlogPage.xmlui │ │ │ ├── Boxes.xmlui │ │ │ ├── Breadcrumb.xmlui │ │ │ ├── ChangeLog.xmlui │ │ │ ├── ColorPalette.xmlui │ │ │ ├── DocumentLinks.xmlui │ │ │ ├── DocumentPage.xmlui │ │ │ ├── DocumentPageNoTOC.xmlui │ │ │ ├── Icons.xmlui │ │ │ ├── IncButton.xmlui │ │ │ ├── IncButton2.xmlui │ │ │ ├── NameValue.xmlui │ │ │ ├── PageNotFound.xmlui │ │ │ ├── PaletteItem.xmlui │ │ │ ├── Palettes.xmlui │ │ │ ├── SectionHeader.xmlui │ │ │ ├── TBD.xmlui │ │ │ ├── Test.xmlui │ │ │ ├── ThemesIntro.xmlui │ │ │ ├── ThousandThemes.xmlui │ │ │ ├── TubeStops.xmlui │ │ │ ├── TubeStops.xmlui.xs │ │ │ └── TwoColumnCode.xmlui │ │ ├── config.ts │ │ ├── Main.xmlui │ │ └── themes │ │ ├── docs-theme.ts │ │ ├── earthtone.ts │ │ ├── xmlui-gray-on-default.ts │ │ ├── xmlui-green-on-default.ts │ │ └── xmlui-orange-on-default.ts │ └── tsconfig.json ├── LICENSE ├── package-lock.json ├── package.json ├── packages │ ├── xmlui-animations │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── Animation.tsx │ │ │ ├── AnimationNative.tsx │ │ │ ├── FadeAnimation.tsx │ │ │ ├── FadeInAnimation.tsx │ │ │ ├── FadeOutAnimation.tsx │ │ │ ├── index.tsx │ │ │ ├── ScaleAnimation.tsx │ │ │ └── SlideInAnimation.tsx │ │ └── tsconfig.json │ ├── xmlui-devtools │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── devtools │ │ │ │ ├── DevTools.tsx │ │ │ │ ├── DevToolsNative.module.scss │ │ │ │ ├── DevToolsNative.tsx │ │ │ │ ├── ModalDialog.module.scss │ │ │ │ ├── ModalDialog.tsx │ │ │ │ ├── ModalVisibilityContext.tsx │ │ │ │ ├── Tooltip.module.scss │ │ │ │ ├── Tooltip.tsx │ │ │ │ └── utils.ts │ │ │ ├── editor │ │ │ │ └── Editor.tsx │ │ │ └── index.tsx │ │ ├── tsconfig.json │ │ └── vite.config-overrides.ts │ ├── xmlui-hello-world │ │ ├── .gitignore │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── HelloWorld.module.scss │ │ │ ├── HelloWorld.tsx │ │ │ ├── HelloWorldNative.tsx │ │ │ └── index.tsx │ │ └── tsconfig.json │ ├── xmlui-os-frames │ │ ├── .gitignore │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── IPhoneFrame.module.scss │ │ │ ├── IPhoneFrame.tsx │ │ │ ├── MacOSAppFrame.module.scss │ │ │ ├── MacOSAppFrame.tsx │ │ │ ├── WindowsAppFrame.module.scss │ │ │ └── WindowsAppFrame.tsx │ │ └── tsconfig.json │ ├── xmlui-pdf │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ ├── components │ │ │ │ └── Pdf.xmlui │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── LazyPdfNative.tsx │ │ │ ├── Pdf.module.scss │ │ │ └── Pdf.tsx │ │ └── tsconfig.json │ ├── xmlui-playground │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── hooks │ │ │ │ ├── usePlayground.ts │ │ │ │ └── useToast.ts │ │ │ ├── index.tsx │ │ │ ├── playground │ │ │ │ ├── Box.module.scss │ │ │ │ ├── Box.tsx │ │ │ │ ├── CodeSelector.tsx │ │ │ │ ├── ConfirmationDialog.module.scss │ │ │ │ ├── ConfirmationDialog.tsx │ │ │ │ ├── Editor.tsx │ │ │ │ ├── Header.module.scss │ │ │ │ ├── Header.tsx │ │ │ │ ├── Playground.tsx │ │ │ │ ├── PlaygroundContent.module.scss │ │ │ │ ├── PlaygroundContent.tsx │ │ │ │ ├── PlaygroundNative.module.scss │ │ │ │ ├── PlaygroundNative.tsx │ │ │ │ ├── Preview.module.scss │ │ │ │ ├── Preview.tsx │ │ │ │ ├── Select.module.scss │ │ │ │ ├── StandalonePlayground.tsx │ │ │ │ ├── StandalonePlaygroundNative.module.scss │ │ │ │ ├── StandalonePlaygroundNative.tsx │ │ │ │ ├── ThemeSwitcher.module.scss │ │ │ │ ├── ThemeSwitcher.tsx │ │ │ │ ├── ToneSwitcher.tsx │ │ │ │ ├── Tooltip.module.scss │ │ │ │ ├── Tooltip.tsx │ │ │ │ └── utils.ts │ │ │ ├── providers │ │ │ │ ├── Toast.module.scss │ │ │ │ └── ToastProvider.tsx │ │ │ ├── state │ │ │ │ └── store.ts │ │ │ ├── themes │ │ │ │ └── theme.ts │ │ │ └── utils │ │ │ └── helpers.ts │ │ └── tsconfig.json │ ├── xmlui-search │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── Search.module.scss │ │ │ └── Search.tsx │ │ └── tsconfig.json │ ├── xmlui-spreadsheet │ │ ├── .gitignore │ │ ├── demo │ │ │ └── Main.xmlui │ │ ├── index.html │ │ ├── index.ts │ │ ├── meta │ │ │ └── componentsMetadata.ts │ │ ├── package.json │ │ ├── src │ │ │ ├── index.tsx │ │ │ ├── Spreadsheet.tsx │ │ │ └── SpreadsheetNative.tsx │ │ └── tsconfig.json │ └── xmlui-website-blocks │ ├── .gitignore │ ├── CHANGELOG.md │ ├── demo │ │ ├── components │ │ │ ├── HeroBackgroundBreakoutPage.xmlui │ │ │ ├── HeroBackgroundsPage.xmlui │ │ │ ├── HeroContentsPage.xmlui │ │ │ ├── HeroTextAlignPage.xmlui │ │ │ ├── HeroTextPage.xmlui │ │ │ └── HeroTonesPage.xmlui │ │ ├── Main.xmlui │ │ └── themes │ │ └── default.ts │ ├── index.html │ ├── index.ts │ ├── meta │ │ └── componentsMetadata.ts │ ├── package.json │ ├── public │ │ └── resources │ │ ├── building.jpg │ │ └── xmlui-logo.svg │ ├── src │ │ ├── Carousel │ │ │ ├── Carousel.module.scss │ │ │ ├── Carousel.tsx │ │ │ ├── CarouselContext.tsx │ │ │ └── CarouselNative.tsx │ │ ├── FancyButton │ │ │ ├── FancyButton.module.scss │ │ │ ├── FancyButton.tsx │ │ │ └── FancyButton.xmlui │ │ ├── Hello │ │ │ ├── Hello.tsx │ │ │ ├── Hello.xmlui │ │ │ └── Hello.xmlui.xs │ │ ├── HeroSection │ │ │ ├── HeroSection.module.scss │ │ │ ├── HeroSection.tsx │ │ │ └── HeroSectionNative.tsx │ │ ├── index.tsx │ │ ├── ScrollToTop │ │ │ ├── ScrollToTop.module.scss │ │ │ ├── ScrollToTop.tsx │ │ │ └── ScrollToTopNative.tsx │ │ └── vite-env.d.ts │ └── tsconfig.json ├── README.md ├── tools │ ├── codefence │ │ └── xmlui-code-fence-docs.md │ ├── create-app │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── create-app.ts │ │ ├── helpers │ │ │ ├── copy.ts │ │ │ ├── get-pkg-manager.ts │ │ │ ├── git.ts │ │ │ ├── install.ts │ │ │ ├── is-folder-empty.ts │ │ │ ├── is-writeable.ts │ │ │ ├── make-dir.ts │ │ │ └── validate-pkg.ts │ │ ├── index.ts │ │ ├── package.json │ │ ├── templates │ │ │ ├── default │ │ │ │ └── ts │ │ │ │ ├── gitignore │ │ │ │ ├── index.html │ │ │ │ ├── index.ts │ │ │ │ ├── public │ │ │ │ │ ├── mockServiceWorker.js │ │ │ │ │ ├── resources │ │ │ │ │ │ ├── favicon.ico │ │ │ │ │ │ └── xmlui-logo.svg │ │ │ │ │ └── serve.json │ │ │ │ └── src │ │ │ │ ├── components │ │ │ │ │ ├── ApiAware.xmlui │ │ │ │ │ ├── Home.xmlui │ │ │ │ │ ├── IncButton.xmlui │ │ │ │ │ └── PagePanel.xmlui │ │ │ │ ├── config.ts │ │ │ │ └── Main.xmlui │ │ │ ├── index.ts │ │ │ └── types.ts │ │ └── tsconfig.json │ ├── create-xmlui-hello-world │ │ ├── index.js │ │ └── package.json │ └── vscode │ ├── .gitignore │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ ├── .vscodeignore │ ├── build.sh │ ├── CHANGELOG.md │ ├── esbuild.js │ ├── eslint.config.mjs │ ├── formatter-docs.md │ ├── generate-test-sample.sh │ ├── LICENSE.md │ ├── package-lock.json │ ├── package.json │ ├── README.md │ ├── resources │ │ ├── xmlui-logo.png │ │ └── xmlui-markup-syntax-highlighting.png │ ├── src │ │ ├── extension.ts │ │ └── server.ts │ ├── syntaxes │ │ └── xmlui.tmLanguage.json │ ├── test-samples │ │ └── sample.xmlui │ ├── tsconfig.json │ └── tsconfig.tsbuildinfo ├── turbo.json └── xmlui ├── .gitignore ├── bin │ ├── bootstrap.js │ ├── build-lib.ts │ ├── build.ts │ ├── index.ts │ ├── preview.ts │ ├── start.ts │ ├── vite-xmlui-plugin.ts │ └── viteConfig.ts ├── CHANGELOG.md ├── conventions │ ├── component-qa-checklist.md │ ├── copilot-conventions.md │ ├── create-xmlui-components.md │ ├── mermaid.md │ ├── testing-conventions.md │ └── xmlui-in-a-nutshell.md ├── dev-docs │ ├── accessibility.md │ ├── build-system.md │ ├── build-xmlui.md │ ├── component-behaviors.md │ ├── containers.md │ ├── glossary.md │ ├── index.md │ ├── next │ │ ├── component-dev-guide.md │ │ ├── configuration-management-enhancement-summary.md │ │ ├── documentation-scripts-refactoring-complete-summary.md │ │ ├── documentation-scripts-refactoring-plan.md │ │ ├── duplicate-pattern-extraction-summary.md │ │ ├── error-handling-standardization-summary.md │ │ ├── generating-component-reference.md │ │ ├── index.md │ │ ├── logging-consistency-implementation-summary.md │ │ ├── project-build.md │ │ ├── project-structure.md │ │ ├── theme-context.md │ │ ├── tiptap-design-considerations.md │ │ ├── working-with-code.md │ │ ├── xmlui-runtime-architecture │ │ └── xmlui-wcag-accessibility-report.md │ ├── react-fundamentals.md │ ├── release-method.md │ ├── standalone-app.md │ ├── state-management.md │ ├── ud-components.md │ └── xmlui-repo.md ├── package.json ├── playwright.config.ts ├── scripts │ ├── coverage-only.js │ ├── e2e-test-summary.js │ ├── generate-docs │ │ ├── build-downloads-map.mjs │ │ ├── build-pages-map.mjs │ │ ├── components-config.json │ │ ├── configuration-management.mjs │ │ ├── constants.mjs │ │ ├── create-theme-files.mjs │ │ ├── DocsGenerator.mjs │ │ ├── error-handling.mjs │ │ ├── extensions-config.json │ │ ├── folders.mjs │ │ ├── generate-summary-files.mjs │ │ ├── get-docs.mjs │ │ ├── input-handler.mjs │ │ ├── logger.mjs │ │ ├── logging-standards.mjs │ │ ├── MetadataProcessor.mjs │ │ ├── pattern-utilities.mjs │ │ └── utils.mjs │ ├── get-langserver-metadata.mjs │ ├── inline-links.mjs │ └── README-e2e-summary.md ├── src │ ├── abstractions │ │ ├── _conventions.md │ │ ├── ActionDefs.ts │ │ ├── AppContextDefs.ts │ │ ├── ComponentDefs.ts │ │ ├── ContainerDefs.ts │ │ ├── ExtensionDefs.ts │ │ ├── FunctionDefs.ts │ │ ├── RendererDefs.ts │ │ ├── scripting │ │ │ ├── BlockScope.ts │ │ │ ├── Compilation.ts │ │ │ ├── LogicalThread.ts │ │ │ ├── LoopScope.ts │ │ │ ├── modules.ts │ │ │ ├── ScriptParserError.ts │ │ │ ├── Token.ts │ │ │ ├── TryScope.ts │ │ │ └── TryScopeExp.ts │ │ └── ThemingDefs.ts │ ├── components │ │ ├── _conventions.md │ │ ├── abstractions.ts │ │ ├── Accordion │ │ │ ├── Accordion.md │ │ │ ├── Accordion.module.scss │ │ │ ├── Accordion.spec.ts │ │ │ ├── Accordion.tsx │ │ │ ├── AccordionContext.tsx │ │ │ ├── AccordionItem.tsx │ │ │ ├── AccordionItemNative.tsx │ │ │ └── AccordionNative.tsx │ │ ├── Animation │ │ │ └── AnimationNative.tsx │ │ ├── APICall │ │ │ ├── APICall.md │ │ │ ├── APICall.spec.ts │ │ │ ├── APICall.tsx │ │ │ └── APICallNative.tsx │ │ ├── App │ │ │ ├── App.md │ │ │ ├── App.module.scss │ │ │ ├── App.spec.ts │ │ │ ├── App.tsx │ │ │ ├── AppLayoutContext.ts │ │ │ ├── AppNative.tsx │ │ │ ├── AppStateContext.ts │ │ │ ├── doc-resources │ │ │ │ ├── condensed-sticky.xmlui │ │ │ │ ├── condensed.xmlui │ │ │ │ ├── horizontal-sticky.xmlui │ │ │ │ ├── horizontal.xmlui │ │ │ │ ├── vertical-full-header.xmlui │ │ │ │ ├── vertical-sticky.xmlui │ │ │ │ └── vertical.xmlui │ │ │ ├── IndexerContext.ts │ │ │ ├── LinkInfoContext.ts │ │ │ ├── SearchContext.tsx │ │ │ ├── Sheet.module.scss │ │ │ └── Sheet.tsx │ │ ├── AppHeader │ │ │ ├── AppHeader.md │ │ │ ├── AppHeader.module.scss │ │ │ ├── AppHeader.spec.ts │ │ │ ├── AppHeader.tsx │ │ │ └── AppHeaderNative.tsx │ │ ├── AppState │ │ │ ├── AppState.md │ │ │ ├── AppState.spec.ts │ │ │ ├── AppState.tsx │ │ │ └── AppStateNative.tsx │ │ ├── AutoComplete │ │ │ ├── AutoComplete.md │ │ │ ├── AutoComplete.module.scss │ │ │ ├── AutoComplete.spec.ts │ │ │ ├── AutoComplete.tsx │ │ │ ├── AutoCompleteContext.tsx │ │ │ └── AutoCompleteNative.tsx │ │ ├── Avatar │ │ │ ├── Avatar.md │ │ │ ├── Avatar.module.scss │ │ │ ├── Avatar.spec.ts │ │ │ ├── Avatar.tsx │ │ │ └── AvatarNative.tsx │ │ ├── Backdrop │ │ │ ├── Backdrop.md │ │ │ ├── Backdrop.module.scss │ │ │ ├── Backdrop.spec.ts │ │ │ ├── Backdrop.tsx │ │ │ └── BackdropNative.tsx │ │ ├── Badge │ │ │ ├── Badge.md │ │ │ ├── Badge.module.scss │ │ │ ├── Badge.spec.ts │ │ │ ├── Badge.tsx │ │ │ └── BadgeNative.tsx │ │ ├── Bookmark │ │ │ ├── Bookmark.md │ │ │ ├── Bookmark.module.scss │ │ │ ├── Bookmark.spec.ts │ │ │ ├── Bookmark.tsx │ │ │ └── BookmarkNative.tsx │ │ ├── Breakout │ │ │ ├── Breakout.module.scss │ │ │ ├── Breakout.spec.ts │ │ │ ├── Breakout.tsx │ │ │ └── BreakoutNative.tsx │ │ ├── Button │ │ │ ├── Button-style.spec.ts │ │ │ ├── Button.md │ │ │ ├── Button.module.scss │ │ │ ├── Button.spec.ts │ │ │ ├── Button.tsx │ │ │ └── ButtonNative.tsx │ │ ├── Card │ │ │ ├── Card.md │ │ │ ├── Card.module.scss │ │ │ ├── Card.spec.ts │ │ │ ├── Card.tsx │ │ │ └── CardNative.tsx │ │ ├── Carousel │ │ │ ├── Carousel.md │ │ │ ├── Carousel.module.scss │ │ │ ├── Carousel.spec.ts │ │ │ ├── Carousel.tsx │ │ │ ├── CarouselContext.tsx │ │ │ ├── CarouselItem.tsx │ │ │ ├── CarouselItemNative.tsx │ │ │ └── CarouselNative.tsx │ │ ├── ChangeListener │ │ │ ├── ChangeListener.md │ │ │ ├── ChangeListener.spec.ts │ │ │ ├── ChangeListener.tsx │ │ │ └── ChangeListenerNative.tsx │ │ ├── chart-color-schemes.ts │ │ ├── Charts │ │ │ ├── AreaChart │ │ │ │ ├── AreaChart.md │ │ │ │ ├── AreaChart.spec.ts │ │ │ │ ├── AreaChart.tsx │ │ │ │ └── AreaChartNative.tsx │ │ │ ├── BarChart │ │ │ │ ├── BarChart.md │ │ │ │ ├── BarChart.module.scss │ │ │ │ ├── BarChart.spec.ts │ │ │ │ ├── BarChart.tsx │ │ │ │ └── BarChartNative.tsx │ │ │ ├── DonutChart │ │ │ │ ├── DonutChart.spec.ts │ │ │ │ └── DonutChart.tsx │ │ │ ├── LabelList │ │ │ │ ├── LabelList.spec.ts │ │ │ │ ├── LabelList.tsx │ │ │ │ ├── LabelListNative.module.scss │ │ │ │ └── LabelListNative.tsx │ │ │ ├── Legend │ │ │ │ ├── Legend.spec.ts │ │ │ │ ├── Legend.tsx │ │ │ │ └── LegendNative.tsx │ │ │ ├── LineChart │ │ │ │ ├── LineChart.md │ │ │ │ ├── LineChart.module.scss │ │ │ │ ├── LineChart.spec.ts │ │ │ │ ├── LineChart.tsx │ │ │ │ └── LineChartNative.tsx │ │ │ ├── PieChart │ │ │ │ ├── PieChart.md │ │ │ │ ├── PieChart.spec.ts │ │ │ │ ├── PieChart.tsx │ │ │ │ ├── PieChartNative.module.scss │ │ │ │ └── PieChartNative.tsx │ │ │ ├── RadarChart │ │ │ │ ├── RadarChart.md │ │ │ │ ├── RadarChart.spec.ts │ │ │ │ ├── RadarChart.tsx │ │ │ │ └── RadarChartNative.tsx │ │ │ ├── Tooltip │ │ │ │ ├── TooltipContent.module.scss │ │ │ │ ├── TooltipContent.spec.ts │ │ │ │ └── TooltipContent.tsx │ │ │ └── utils │ │ │ ├── abstractions.ts │ │ │ └── ChartProvider.tsx │ │ ├── Checkbox │ │ │ ├── Checkbox.md │ │ │ ├── Checkbox.spec.ts │ │ │ └── Checkbox.tsx │ │ ├── CodeBlock │ │ │ ├── CodeBlock.module.scss │ │ │ ├── CodeBlock.spec.ts │ │ │ ├── CodeBlock.tsx │ │ │ ├── CodeBlockNative.tsx │ │ │ └── highlight-code.ts │ │ ├── collectedComponentMetadata.ts │ │ ├── ColorPicker │ │ │ ├── ColorPicker.md │ │ │ ├── ColorPicker.module.scss │ │ │ ├── ColorPicker.spec.ts │ │ │ ├── ColorPicker.tsx │ │ │ └── ColorPickerNative.tsx │ │ ├── Column │ │ │ ├── Column.md │ │ │ ├── Column.tsx │ │ │ ├── ColumnNative.tsx │ │ │ ├── doc-resources │ │ │ │ └── list-component-data.js │ │ │ └── TableContext.tsx │ │ ├── component-utils.ts │ │ ├── ComponentProvider.tsx │ │ ├── ComponentRegistryContext.tsx │ │ ├── container-helpers.tsx │ │ ├── ContentSeparator │ │ │ ├── ContentSeparator.md │ │ │ ├── ContentSeparator.module.scss │ │ │ ├── ContentSeparator.spec.ts │ │ │ ├── ContentSeparator.tsx │ │ │ └── ContentSeparatorNative.tsx │ │ ├── DataSource │ │ │ ├── DataSource.md │ │ │ └── DataSource.tsx │ │ ├── DateInput │ │ │ ├── DateInput.md │ │ │ ├── DateInput.module.scss │ │ │ ├── DateInput.spec.ts │ │ │ ├── DateInput.tsx │ │ │ └── DateInputNative.tsx │ │ ├── DatePicker │ │ │ ├── DatePicker.md │ │ │ ├── DatePicker.module.scss │ │ │ ├── DatePicker.spec.ts │ │ │ ├── DatePicker.tsx │ │ │ └── DatePickerNative.tsx │ │ ├── DropdownMenu │ │ │ ├── DropdownMenu.md │ │ │ ├── DropdownMenu.module.scss │ │ │ ├── DropdownMenu.spec.ts │ │ │ ├── DropdownMenu.tsx │ │ │ ├── DropdownMenuNative.tsx │ │ │ ├── MenuItem.md │ │ │ └── SubMenuItem.md │ │ ├── EmojiSelector │ │ │ ├── EmojiSelector.md │ │ │ ├── EmojiSelector.spec.ts │ │ │ ├── EmojiSelector.tsx │ │ │ └── EmojiSelectorNative.tsx │ │ ├── ExpandableItem │ │ │ ├── ExpandableItem.module.scss │ │ │ ├── ExpandableItem.spec.ts │ │ │ ├── ExpandableItem.tsx │ │ │ └── ExpandableItemNative.tsx │ │ ├── FileInput │ │ │ ├── FileInput.md │ │ │ ├── FileInput.module.scss │ │ │ ├── FileInput.spec.ts │ │ │ ├── FileInput.tsx │ │ │ └── FileInputNative.tsx │ │ ├── FileUploadDropZone │ │ │ ├── FileUploadDropZone.md │ │ │ ├── FileUploadDropZone.module.scss │ │ │ ├── FileUploadDropZone.spec.ts │ │ │ ├── FileUploadDropZone.tsx │ │ │ └── FileUploadDropZoneNative.tsx │ │ ├── FlowLayout │ │ │ ├── FlowLayout.md │ │ │ ├── FlowLayout.module.scss │ │ │ ├── FlowLayout.spec.ts │ │ │ ├── FlowLayout.spec.ts-snapshots │ │ │ │ └── Edge-cases-boxShadow-is-not-clipped-1-non-smoke-darwin.png │ │ │ ├── FlowLayout.tsx │ │ │ └── FlowLayoutNative.tsx │ │ ├── Footer │ │ │ ├── Footer.md │ │ │ ├── Footer.module.scss │ │ │ ├── Footer.spec.ts │ │ │ ├── Footer.tsx │ │ │ └── FooterNative.tsx │ │ ├── Form │ │ │ ├── Form.md │ │ │ ├── Form.module.scss │ │ │ ├── Form.spec.ts │ │ │ ├── Form.tsx │ │ │ ├── formActions.ts │ │ │ ├── FormContext.ts │ │ │ └── FormNative.tsx │ │ ├── FormItem │ │ │ ├── FormItem.md │ │ │ ├── FormItem.module.scss │ │ │ ├── FormItem.spec.ts │ │ │ ├── FormItem.tsx │ │ │ ├── FormItemNative.tsx │ │ │ ├── HelperText.module.scss │ │ │ ├── HelperText.tsx │ │ │ ├── ItemWithLabel.tsx │ │ │ └── Validations.ts │ │ ├── FormSection │ │ │ ├── FormSection.md │ │ │ ├── FormSection.ts │ │ │ └── FormSection.xmlui │ │ ├── Fragment │ │ │ ├── Fragment.spec.ts │ │ │ └── Fragment.tsx │ │ ├── Heading │ │ │ ├── abstractions.ts │ │ │ ├── H1.md │ │ │ ├── H1.spec.ts │ │ │ ├── H2.md │ │ │ ├── H2.spec.ts │ │ │ ├── H3.md │ │ │ ├── H3.spec.ts │ │ │ ├── H4.md │ │ │ ├── H4.spec.ts │ │ │ ├── H5.md │ │ │ ├── H5.spec.ts │ │ │ ├── H6.md │ │ │ ├── H6.spec.ts │ │ │ ├── Heading.md │ │ │ ├── Heading.module.scss │ │ │ ├── Heading.spec.ts │ │ │ ├── Heading.tsx │ │ │ └── HeadingNative.tsx │ │ ├── HoverCard │ │ │ ├── HoverCard.tsx │ │ │ └── HovercardNative.tsx │ │ ├── HtmlTags │ │ │ ├── HtmlTags.module.scss │ │ │ ├── HtmlTags.spec.ts │ │ │ └── HtmlTags.tsx │ │ ├── Icon │ │ │ ├── AdmonitionDanger.tsx │ │ │ ├── AdmonitionInfo.tsx │ │ │ ├── AdmonitionNote.tsx │ │ │ ├── AdmonitionTip.tsx │ │ │ ├── AdmonitionWarning.tsx │ │ │ ├── ApiIcon.tsx │ │ │ ├── ArrowDropDown.module.scss │ │ │ ├── ArrowDropDown.tsx │ │ │ ├── ArrowDropUp.module.scss │ │ │ ├── ArrowDropUp.tsx │ │ │ ├── ArrowLeft.module.scss │ │ │ ├── ArrowLeft.tsx │ │ │ ├── ArrowRight.module.scss │ │ │ ├── ArrowRight.tsx │ │ │ ├── Attach.tsx │ │ │ ├── Binding.module.scss │ │ │ ├── Binding.tsx │ │ │ ├── BoardIcon.tsx │ │ │ ├── BoxIcon.tsx │ │ │ ├── CheckIcon.tsx │ │ │ ├── ChevronDownIcon.tsx │ │ │ ├── ChevronLeft.tsx │ │ │ ├── ChevronRight.tsx │ │ │ ├── ChevronUpIcon.tsx │ │ │ ├── CodeFileIcon.tsx │ │ │ ├── CodeSandbox.tsx │ │ │ ├── CompactListIcon.tsx │ │ │ ├── ContentCopyIcon.tsx │ │ │ ├── DarkToLightIcon.tsx │ │ │ ├── DatabaseIcon.module.scss │ │ │ ├── DatabaseIcon.tsx │ │ │ ├── DocFileIcon.tsx │ │ │ ├── DocIcon.tsx │ │ │ ├── DotMenuHorizontalIcon.tsx │ │ │ ├── DotMenuIcon.tsx │ │ │ ├── EmailIcon.tsx │ │ │ ├── EmptyFolderIcon.tsx │ │ │ ├── ErrorIcon.tsx │ │ │ ├── ExpressionIcon.tsx │ │ │ ├── FillPlusCricleIcon.tsx │ │ │ ├── FilterIcon.tsx │ │ │ ├── FolderIcon.tsx │ │ │ ├── GlobeIcon.tsx │ │ │ ├── HomeIcon.tsx │ │ │ ├── HyperLinkIcon.tsx │ │ │ ├── Icon.md │ │ │ ├── Icon.module.scss │ │ │ ├── Icon.spec.ts │ │ │ ├── Icon.tsx │ │ │ ├── IconNative.tsx │ │ │ ├── ImageFileIcon.tsx │ │ │ ├── Inspect.tsx │ │ │ ├── LightToDark.tsx │ │ │ ├── LinkIcon.tsx │ │ │ ├── ListIcon.tsx │ │ │ ├── LooseListIcon.tsx │ │ │ ├── MoonIcon.tsx │ │ │ ├── MoreOptionsIcon.tsx │ │ │ ├── NoSortIcon.tsx │ │ │ ├── PDFIcon.tsx │ │ │ ├── PenIcon.tsx │ │ │ ├── PhoneIcon.tsx │ │ │ ├── PhotoIcon.tsx │ │ │ ├── PlusIcon.tsx │ │ │ ├── SearchIcon.tsx │ │ │ ├── ShareIcon.tsx │ │ │ ├── SortAscendingIcon.tsx │ │ │ ├── SortDescendingIcon.tsx │ │ │ ├── StarsIcon.tsx │ │ │ ├── SunIcon.tsx │ │ │ ├── svg │ │ │ │ ├── admonition_danger.svg │ │ │ │ ├── admonition_info.svg │ │ │ │ ├── admonition_note.svg │ │ │ │ ├── admonition_tip.svg │ │ │ │ ├── admonition_warning.svg │ │ │ │ ├── api.svg │ │ │ │ ├── arrow-dropdown.svg │ │ │ │ ├── arrow-left.svg │ │ │ │ ├── arrow-right.svg │ │ │ │ ├── arrow-up.svg │ │ │ │ ├── attach.svg │ │ │ │ ├── binding.svg │ │ │ │ ├── box.svg │ │ │ │ ├── bulb.svg │ │ │ │ ├── code-file.svg │ │ │ │ ├── code-sandbox.svg │ │ │ │ ├── dark_to_light.svg │ │ │ │ ├── database.svg │ │ │ │ ├── doc.svg │ │ │ │ ├── empty-folder.svg │ │ │ │ ├── expression.svg │ │ │ │ ├── eye-closed.svg │ │ │ │ ├── eye-dark.svg │ │ │ │ ├── eye.svg │ │ │ │ ├── file-text.svg │ │ │ │ ├── filter.svg │ │ │ │ ├── folder.svg │ │ │ │ ├── img.svg │ │ │ │ ├── inspect.svg │ │ │ │ ├── light_to_dark.svg │ │ │ │ ├── moon.svg │ │ │ │ ├── pdf.svg │ │ │ │ ├── photo.svg │ │ │ │ ├── share.svg │ │ │ │ ├── stars.svg │ │ │ │ ├── sun.svg │ │ │ │ ├── trending-down.svg │ │ │ │ ├── trending-level.svg │ │ │ │ ├── trending-up.svg │ │ │ │ ├── txt.svg │ │ │ │ ├── unknown-file.svg │ │ │ │ ├── unlink.svg │ │ │ │ └── xls.svg │ │ │ ├── TableDeleteColumnIcon.tsx │ │ │ ├── TableDeleteRowIcon.tsx │ │ │ ├── TableInsertColumnIcon.tsx │ │ │ ├── TableInsertRowIcon.tsx │ │ │ ├── TrashIcon.tsx │ │ │ ├── TrendingDownIcon.tsx │ │ │ ├── TrendingLevelIcon.tsx │ │ │ ├── TrendingUpIcon.tsx │ │ │ ├── TxtIcon.tsx │ │ │ ├── UnknownFileIcon.tsx │ │ │ ├── UnlinkIcon.tsx │ │ │ ├── UserIcon.tsx │ │ │ ├── WarningIcon.tsx │ │ │ └── XlsIcon.tsx │ │ ├── IconProvider.tsx │ │ ├── IconRegistryContext.tsx │ │ ├── IFrame │ │ │ ├── IFrame.md │ │ │ ├── IFrame.module.scss │ │ │ ├── IFrame.spec.ts │ │ │ ├── IFrame.tsx │ │ │ └── IFrameNative.tsx │ │ ├── Image │ │ │ ├── Image.md │ │ │ ├── Image.module.scss │ │ │ ├── Image.spec.ts │ │ │ ├── Image.tsx │ │ │ └── ImageNative.tsx │ │ ├── Input │ │ │ ├── index.ts │ │ │ ├── InputAdornment.module.scss │ │ │ ├── InputAdornment.tsx │ │ │ ├── InputDivider.module.scss │ │ │ ├── InputDivider.tsx │ │ │ ├── InputLabel.module.scss │ │ │ ├── InputLabel.tsx │ │ │ ├── PartialInput.module.scss │ │ │ └── PartialInput.tsx │ │ ├── InspectButton │ │ │ ├── InspectButton.module.scss │ │ │ └── InspectButton.tsx │ │ ├── Items │ │ │ ├── Items.md │ │ │ ├── Items.spec.ts │ │ │ ├── Items.tsx │ │ │ └── ItemsNative.tsx │ │ ├── Link │ │ │ ├── Link.md │ │ │ ├── Link.module.scss │ │ │ ├── Link.spec.ts │ │ │ ├── Link.tsx │ │ │ └── LinkNative.tsx │ │ ├── List │ │ │ ├── doc-resources │ │ │ │ └── list-component-data.js │ │ │ ├── List.md │ │ │ ├── List.module.scss │ │ │ ├── List.spec.ts │ │ │ ├── List.tsx │ │ │ └── ListNative.tsx │ │ ├── Logo │ │ │ ├── doc-resources │ │ │ │ └── xmlui-logo.svg │ │ │ ├── Logo.md │ │ │ ├── Logo.tsx │ │ │ └── LogoNative.tsx │ │ ├── Markdown │ │ │ ├── CodeText.module.scss │ │ │ ├── CodeText.tsx │ │ │ ├── Markdown.md │ │ │ ├── Markdown.module.scss │ │ │ ├── Markdown.spec.ts │ │ │ ├── Markdown.tsx │ │ │ ├── MarkdownNative.tsx │ │ │ ├── parse-binding-expr.ts │ │ │ └── utils.ts │ │ ├── metadata-helpers.ts │ │ ├── ModalDialog │ │ │ ├── ConfirmationModalContextProvider.tsx │ │ │ ├── Dialog.module.scss │ │ │ ├── Dialog.tsx │ │ │ ├── ModalDialog.md │ │ │ ├── ModalDialog.module.scss │ │ │ ├── ModalDialog.spec.ts │ │ │ ├── ModalDialog.tsx │ │ │ ├── ModalDialogNative.tsx │ │ │ └── ModalVisibilityContext.tsx │ │ ├── NavGroup │ │ │ ├── NavGroup.md │ │ │ ├── NavGroup.module.scss │ │ │ ├── NavGroup.spec.ts │ │ │ ├── NavGroup.tsx │ │ │ ├── NavGroupContext.ts │ │ │ └── NavGroupNative.tsx │ │ ├── NavLink │ │ │ ├── NavLink.md │ │ │ ├── NavLink.module.scss │ │ │ ├── NavLink.spec.ts │ │ │ ├── NavLink.tsx │ │ │ └── NavLinkNative.tsx │ │ ├── NavPanel │ │ │ ├── NavPanel.md │ │ │ ├── NavPanel.module.scss │ │ │ ├── NavPanel.spec.ts │ │ │ ├── NavPanel.tsx │ │ │ └── NavPanelNative.tsx │ │ ├── NestedApp │ │ │ ├── AppWithCodeView.module.scss │ │ │ ├── AppWithCodeView.tsx │ │ │ ├── AppWithCodeViewNative.tsx │ │ │ ├── defaultProps.tsx │ │ │ ├── logo.svg │ │ │ ├── NestedApp.module.scss │ │ │ ├── NestedApp.tsx │ │ │ ├── NestedAppNative.tsx │ │ │ ├── Tooltip.module.scss │ │ │ ├── Tooltip.tsx │ │ │ └── utils.ts │ │ ├── NoResult │ │ │ ├── NoResult.md │ │ │ ├── NoResult.module.scss │ │ │ ├── NoResult.spec.ts │ │ │ ├── NoResult.tsx │ │ │ └── NoResultNative.tsx │ │ ├── NumberBox │ │ │ ├── numberbox-abstractions.ts │ │ │ ├── NumberBox.md │ │ │ ├── NumberBox.module.scss │ │ │ ├── NumberBox.spec.ts │ │ │ ├── NumberBox.tsx │ │ │ └── NumberBoxNative.tsx │ │ ├── Option │ │ │ ├── Option.md │ │ │ ├── Option.spec.ts │ │ │ ├── Option.tsx │ │ │ ├── OptionNative.tsx │ │ │ └── OptionTypeProvider.tsx │ │ ├── PageMetaTitle │ │ │ ├── PageMetaTilteNative.tsx │ │ │ ├── PageMetaTitle.md │ │ │ ├── PageMetaTitle.spec.ts │ │ │ └── PageMetaTitle.tsx │ │ ├── Pages │ │ │ ├── Page.md │ │ │ ├── Pages.md │ │ │ ├── Pages.module.scss │ │ │ ├── Pages.tsx │ │ │ └── PagesNative.tsx │ │ ├── Pagination │ │ │ ├── Pagination.md │ │ │ ├── Pagination.module.scss │ │ │ ├── Pagination.spec.ts │ │ │ ├── Pagination.tsx │ │ │ └── PaginationNative.tsx │ │ ├── PositionedContainer │ │ │ ├── PositionedContainer.module.scss │ │ │ ├── PositionedContainer.tsx │ │ │ └── PositionedContainerNative.tsx │ │ ├── ProfileMenu │ │ │ ├── ProfileMenu.module.scss │ │ │ └── ProfileMenu.tsx │ │ ├── ProgressBar │ │ │ ├── ProgressBar.md │ │ │ ├── ProgressBar.module.scss │ │ │ ├── ProgressBar.spec.ts │ │ │ ├── ProgressBar.tsx │ │ │ └── ProgressBarNative.tsx │ │ ├── Queue │ │ │ ├── Queue.md │ │ │ ├── Queue.spec.ts │ │ │ ├── Queue.tsx │ │ │ ├── queueActions.ts │ │ │ └── QueueNative.tsx │ │ ├── RadioGroup │ │ │ ├── RadioGroup.md │ │ │ ├── RadioGroup.module.scss │ │ │ ├── RadioGroup.spec.ts │ │ │ ├── RadioGroup.tsx │ │ │ ├── RadioGroupNative.tsx │ │ │ ├── RadioItem.tsx │ │ │ └── RadioItemNative.tsx │ │ ├── RealTimeAdapter │ │ │ ├── RealTimeAdapter.tsx │ │ │ └── RealTimeAdapterNative.tsx │ │ ├── Redirect │ │ │ ├── Redirect.md │ │ │ ├── Redirect.spec.ts │ │ │ └── Redirect.tsx │ │ ├── ResponsiveBar │ │ │ ├── README.md │ │ │ ├── ResponsiveBar.md │ │ │ ├── ResponsiveBar.module.scss │ │ │ ├── ResponsiveBar.spec.ts │ │ │ ├── ResponsiveBar.tsx │ │ │ └── ResponsiveBarNative.tsx │ │ ├── Select │ │ │ ├── HiddenOption.tsx │ │ │ ├── MultiSelectOption.tsx │ │ │ ├── OptionContext.ts │ │ │ ├── Select.md │ │ │ ├── Select.module.scss │ │ │ ├── Select.spec.ts │ │ │ ├── Select.tsx │ │ │ ├── SelectContext.tsx │ │ │ ├── SelectNative.tsx │ │ │ ├── SelectOption.tsx │ │ │ └── SimpleSelect.tsx │ │ ├── SelectionStore │ │ │ ├── SelectionStore.md │ │ │ ├── SelectionStore.tsx │ │ │ └── SelectionStoreNative.tsx │ │ ├── Slider │ │ │ ├── Slider.md │ │ │ ├── Slider.module.scss │ │ │ ├── Slider.spec.ts │ │ │ ├── Slider.tsx │ │ │ └── SliderNative.tsx │ │ ├── Slot │ │ │ ├── Slot.md │ │ │ ├── Slot.spec.ts │ │ │ └── Slot.ts │ │ ├── SlotItem.tsx │ │ ├── SpaceFiller │ │ │ ├── SpaceFiller.md │ │ │ ├── SpaceFiller.module.scss │ │ │ ├── SpaceFiller.spec.ts │ │ │ ├── SpaceFiller.tsx │ │ │ └── SpaceFillerNative.tsx │ │ ├── Spinner │ │ │ ├── Spinner.md │ │ │ ├── Spinner.module.scss │ │ │ ├── Spinner.spec.ts │ │ │ ├── Spinner.tsx │ │ │ └── SpinnerNative.tsx │ │ ├── Splitter │ │ │ ├── HSplitter.md │ │ │ ├── HSplitter.spec.ts │ │ │ ├── Splitter.md │ │ │ ├── Splitter.module.scss │ │ │ ├── Splitter.spec.ts │ │ │ ├── Splitter.tsx │ │ │ ├── SplitterNative.tsx │ │ │ ├── utils.ts │ │ │ ├── VSplitter.md │ │ │ └── VSplitter.spec.ts │ │ ├── Stack │ │ │ ├── CHStack.md │ │ │ ├── CHStack.spec.ts │ │ │ ├── CVStack.md │ │ │ ├── CVStack.spec.ts │ │ │ ├── HStack.md │ │ │ ├── HStack.spec.ts │ │ │ ├── Stack.md │ │ │ ├── Stack.module.scss │ │ │ ├── Stack.spec.ts │ │ │ ├── Stack.tsx │ │ │ ├── StackNative.tsx │ │ │ ├── VStack.md │ │ │ └── VStack.spec.ts │ │ ├── StickyBox │ │ │ ├── StickyBox.md │ │ │ ├── StickyBox.module.scss │ │ │ ├── StickyBox.tsx │ │ │ └── StickyBoxNative.tsx │ │ ├── Switch │ │ │ ├── Switch.md │ │ │ ├── Switch.spec.ts │ │ │ └── Switch.tsx │ │ ├── Table │ │ │ ├── doc-resources │ │ │ │ └── list-component-data.js │ │ │ ├── react-table-config.d.ts │ │ │ ├── Table.md │ │ │ ├── Table.module.scss │ │ │ ├── Table.spec.ts │ │ │ ├── Table.tsx │ │ │ ├── TableNative.tsx │ │ │ └── useRowSelection.tsx │ │ ├── TableOfContents │ │ │ ├── TableOfContents.module.scss │ │ │ ├── TableOfContents.spec.ts │ │ │ ├── TableOfContents.tsx │ │ │ └── TableOfContentsNative.tsx │ │ ├── Tabs │ │ │ ├── TabContext.tsx │ │ │ ├── TabItem.md │ │ │ ├── TabItem.tsx │ │ │ ├── TabItemNative.tsx │ │ │ ├── Tabs.md │ │ │ ├── Tabs.module.scss │ │ │ ├── Tabs.spec.ts │ │ │ ├── Tabs.tsx │ │ │ └── TabsNative.tsx │ │ ├── Text │ │ │ ├── Text.md │ │ │ ├── Text.module.scss │ │ │ ├── Text.spec.ts │ │ │ ├── Text.tsx │ │ │ └── TextNative.tsx │ │ ├── TextArea │ │ │ ├── TextArea.md │ │ │ ├── TextArea.module.scss │ │ │ ├── TextArea.spec.ts │ │ │ ├── TextArea.tsx │ │ │ ├── TextAreaNative.tsx │ │ │ ├── TextAreaResizable.tsx │ │ │ └── useComposedRef.ts │ │ ├── TextBox │ │ │ ├── TextBox.md │ │ │ ├── TextBox.module.scss │ │ │ ├── TextBox.spec.ts │ │ │ ├── TextBox.tsx │ │ │ └── TextBoxNative.tsx │ │ ├── Theme │ │ │ ├── NotificationToast.tsx │ │ │ ├── Theme.md │ │ │ ├── Theme.module.scss │ │ │ ├── Theme.spec.ts │ │ │ ├── Theme.tsx │ │ │ └── ThemeNative.tsx │ │ ├── TimeInput │ │ │ ├── TimeInput.md │ │ │ ├── TimeInput.module.scss │ │ │ ├── TimeInput.spec.ts │ │ │ ├── TimeInput.tsx │ │ │ ├── TimeInputNative.tsx │ │ │ └── utils.ts │ │ ├── Timer │ │ │ ├── Timer.md │ │ │ ├── Timer.spec.ts │ │ │ ├── Timer.tsx │ │ │ └── TimerNative.tsx │ │ ├── Toggle │ │ │ ├── Toggle.module.scss │ │ │ └── Toggle.tsx │ │ ├── ToneChangerButton │ │ │ ├── ToneChangerButton.md │ │ │ ├── ToneChangerButton.spec.ts │ │ │ └── ToneChangerButton.tsx │ │ ├── ToneSwitch │ │ │ ├── ToneSwitch.md │ │ │ ├── ToneSwitch.module.scss │ │ │ ├── ToneSwitch.spec.ts │ │ │ ├── ToneSwitch.tsx │ │ │ └── ToneSwitchNative.tsx │ │ ├── Tooltip │ │ │ ├── Tooltip.md │ │ │ ├── Tooltip.module.scss │ │ │ ├── Tooltip.spec.ts │ │ │ ├── Tooltip.tsx │ │ │ └── TooltipNative.tsx │ │ ├── Tree │ │ │ ├── testData.ts │ │ │ ├── Tree-dynamic.spec.ts │ │ │ ├── Tree-icons.spec.ts │ │ │ ├── Tree.md │ │ │ ├── Tree.spec.ts │ │ │ ├── TreeComponent.module.scss │ │ │ ├── TreeComponent.tsx │ │ │ └── TreeNative.tsx │ │ ├── TreeDisplay │ │ │ ├── TreeDisplay.md │ │ │ ├── TreeDisplay.module.scss │ │ │ ├── TreeDisplay.tsx │ │ │ └── TreeDisplayNative.tsx │ │ ├── ValidationSummary │ │ │ ├── ValidationSummary.module.scss │ │ │ └── ValidationSummary.tsx │ │ └── VisuallyHidden.tsx │ ├── components-core │ │ ├── abstractions │ │ │ ├── ComponentRenderer.ts │ │ │ ├── LoaderRenderer.ts │ │ │ ├── standalone.ts │ │ │ └── treeAbstractions.ts │ │ ├── action │ │ │ ├── actions.ts │ │ │ ├── APICall.tsx │ │ │ ├── FileDownloadAction.tsx │ │ │ ├── FileUploadAction.tsx │ │ │ ├── NavigateAction.tsx │ │ │ └── TimedAction.tsx │ │ ├── ApiBoundComponent.tsx │ │ ├── appContext │ │ │ ├── date-functions.ts │ │ │ ├── math-function.ts │ │ │ └── misc-utils.ts │ │ ├── AppContext.tsx │ │ ├── behaviors │ │ │ ├── Behavior.tsx │ │ │ └── CoreBehaviors.tsx │ │ ├── component-hooks.ts │ │ ├── ComponentDecorator.tsx │ │ ├── ComponentViewer.tsx │ │ ├── CompoundComponent.tsx │ │ ├── constants.ts │ │ ├── DebugViewProvider.tsx │ │ ├── descriptorHelper.ts │ │ ├── devtools │ │ │ ├── InspectorDialog.module.scss │ │ │ ├── InspectorDialog.tsx │ │ │ └── InspectorDialogVisibilityContext.tsx │ │ ├── EngineError.ts │ │ ├── event-handlers.ts │ │ ├── InspectorButton.module.scss │ │ ├── InspectorContext.tsx │ │ ├── interception │ │ │ ├── abstractions.ts │ │ │ ├── ApiInterceptor.ts │ │ │ ├── ApiInterceptorProvider.tsx │ │ │ ├── apiInterceptorWorker.ts │ │ │ ├── Backend.ts │ │ │ ├── Errors.ts │ │ │ ├── IndexedDb.ts │ │ │ ├── initMock.ts │ │ │ ├── InMemoryDb.ts │ │ │ ├── ReadonlyCollection.ts │ │ │ └── useApiInterceptorContext.tsx │ │ ├── loader │ │ │ ├── ApiLoader.tsx │ │ │ ├── DataLoader.tsx │ │ │ ├── ExternalDataLoader.tsx │ │ │ ├── Loader.tsx │ │ │ ├── MockLoaderRenderer.tsx │ │ │ └── PageableLoader.tsx │ │ ├── LoaderComponent.tsx │ │ ├── markup-check.ts │ │ ├── parts.ts │ │ ├── renderers.ts │ │ ├── rendering │ │ │ ├── AppContent.tsx │ │ │ ├── AppRoot.tsx │ │ │ ├── AppWrapper.tsx │ │ │ ├── buildProxy.ts │ │ │ ├── collectFnVarDeps.ts │ │ │ ├── ComponentAdapter.tsx │ │ │ ├── ComponentWrapper.tsx │ │ │ ├── Container.tsx │ │ │ ├── containers.ts │ │ │ ├── ContainerWrapper.tsx │ │ │ ├── ErrorBoundary.module.scss │ │ │ ├── ErrorBoundary.tsx │ │ │ ├── InvalidComponent.module.scss │ │ │ ├── InvalidComponent.tsx │ │ │ ├── nodeUtils.ts │ │ │ ├── reducer.ts │ │ │ ├── renderChild.tsx │ │ │ ├── StandaloneComponent.tsx │ │ │ ├── StateContainer.tsx │ │ │ ├── UnknownComponent.module.scss │ │ │ ├── UnknownComponent.tsx │ │ │ └── valueExtractor.ts │ │ ├── reportEngineError.ts │ │ ├── RestApiProxy.ts │ │ ├── script-runner │ │ │ ├── asyncProxy.ts │ │ │ ├── AttributeValueParser.ts │ │ │ ├── bannedFunctions.ts │ │ │ ├── BindingTreeEvaluationContext.ts │ │ │ ├── eval-tree-async.ts │ │ │ ├── eval-tree-common.ts │ │ │ ├── eval-tree-sync.ts │ │ │ ├── ParameterParser.ts │ │ │ ├── process-statement-async.ts │ │ │ ├── process-statement-common.ts │ │ │ ├── process-statement-sync.ts │ │ │ ├── ScriptingSourceTree.ts │ │ │ ├── simplify-expression.ts │ │ │ ├── statement-queue.ts │ │ │ └── visitors.ts │ │ ├── StandaloneApp.tsx │ │ ├── StandaloneExtensionManager.ts │ │ ├── TableOfContentsContext.tsx │ │ ├── theming │ │ │ ├── _themes.scss │ │ │ ├── component-layout-resolver.ts │ │ │ ├── extendThemeUtils.ts │ │ │ ├── hvar.ts │ │ │ ├── layout-resolver.ts │ │ │ ├── parse-layout-props.ts │ │ │ ├── StyleContext.tsx │ │ │ ├── StyleRegistry.ts │ │ │ ├── ThemeContext.tsx │ │ │ ├── ThemeProvider.tsx │ │ │ ├── themes │ │ │ │ ├── base-utils.ts │ │ │ │ ├── palette.ts │ │ │ │ ├── root.ts │ │ │ │ ├── solid.ts │ │ │ │ ├── theme-colors.ts │ │ │ │ └── xmlui.ts │ │ │ ├── themeVars.module.scss │ │ │ ├── themeVars.ts │ │ │ ├── transformThemeVars.ts │ │ │ └── utils.ts │ │ ├── utils │ │ │ ├── actionUtils.ts │ │ │ ├── audio-utils.ts │ │ │ ├── compound-utils.ts │ │ │ ├── css-utils.ts │ │ │ ├── DataLoaderQueryKeyGenerator.ts │ │ │ ├── date-utils.ts │ │ │ ├── extractParam.ts │ │ │ ├── hooks.tsx │ │ │ ├── LruCache.ts │ │ │ ├── mergeProps.ts │ │ │ ├── misc.ts │ │ │ ├── request-params.ts │ │ │ ├── statementUtils.ts │ │ │ └── treeUtils.ts │ │ └── xmlui-parser.ts │ ├── index-standalone.ts │ ├── index.scss │ ├── index.ts │ ├── language-server │ │ ├── server-common.ts │ │ ├── server-web-worker.ts │ │ ├── server.ts │ │ ├── services │ │ │ ├── common │ │ │ │ ├── docs-generation.ts │ │ │ │ ├── lsp-utils.ts │ │ │ │ ├── metadata-utils.ts │ │ │ │ └── syntax-node-utilities.ts │ │ │ ├── completion.ts │ │ │ ├── diagnostic.ts │ │ │ ├── format.ts │ │ │ └── hover.ts │ │ └── xmlui-metadata-generated.mjs │ ├── logging │ │ ├── LoggerContext.tsx │ │ ├── LoggerInitializer.tsx │ │ ├── LoggerService.ts │ │ └── xmlui.ts │ ├── logo.svg │ ├── parsers │ │ ├── common │ │ │ ├── GenericToken.ts │ │ │ ├── InputStream.ts │ │ │ └── utils.ts │ │ ├── scripting │ │ │ ├── code-behind-collect.ts │ │ │ ├── Lexer.ts │ │ │ ├── modules.ts │ │ │ ├── Parser.ts │ │ │ ├── ParserError.ts │ │ │ ├── ScriptingNodeTypes.ts │ │ │ ├── TokenTrait.ts │ │ │ ├── TokenType.ts │ │ │ └── tree-visitor.ts │ │ ├── style-parser │ │ │ ├── errors.ts │ │ │ ├── source-tree.ts │ │ │ ├── StyleInputStream.ts │ │ │ ├── StyleLexer.ts │ │ │ ├── StyleParser.ts │ │ │ └── tokens.ts │ │ └── xmlui-parser │ │ ├── CharacterCodes.ts │ │ ├── diagnostics.ts │ │ ├── fileExtensions.ts │ │ ├── index.ts │ │ ├── lint.ts │ │ ├── parser.ts │ │ ├── ParserError.ts │ │ ├── scanner.ts │ │ ├── syntax-kind.ts │ │ ├── syntax-node.ts │ │ ├── transform.ts │ │ ├── utils.ts │ │ ├── xmlui-serializer.ts │ │ └── xmlui-tree.ts │ ├── react-app-env.d.ts │ ├── syntax │ │ ├── monaco │ │ │ ├── grammar.monacoLanguage.ts │ │ │ ├── index.ts │ │ │ ├── xmlui-dark.ts │ │ │ ├── xmlui-light.ts │ │ │ └── xmluiscript.monacoLanguage.ts │ │ └── textMate │ │ ├── index.ts │ │ ├── xmlui-dark.json │ │ ├── xmlui-light.json │ │ ├── xmlui.json │ │ └── xmlui.tmLanguage.json │ ├── testing │ │ ├── assertions.ts │ │ ├── component-test-helpers.ts │ │ ├── ComponentDrivers.ts │ │ ├── drivers │ │ │ ├── DateInputDriver.ts │ │ │ ├── ModalDialogDriver.ts │ │ │ ├── NumberBoxDriver.ts │ │ │ ├── TextBoxDriver.ts │ │ │ ├── TimeInputDriver.ts │ │ │ ├── TimerDriver.ts │ │ │ └── TreeDriver.ts │ │ ├── fixtures.ts │ │ ├── infrastructure │ │ │ ├── index.html │ │ │ ├── main.tsx │ │ │ ├── public │ │ │ │ ├── mockServiceWorker.js │ │ │ │ ├── resources │ │ │ │ │ ├── bell.svg │ │ │ │ │ ├── box.svg │ │ │ │ │ ├── doc.svg │ │ │ │ │ ├── eye.svg │ │ │ │ │ ├── flower-640x480.jpg │ │ │ │ │ ├── sun.svg │ │ │ │ │ ├── test-image-100x100.jpg │ │ │ │ │ └── txt.svg │ │ │ │ └── serve.json │ │ │ └── TestBed.tsx │ │ └── themed-app-test-helpers.ts │ └── vite-env.d.ts ├── tests │ ├── components │ │ ├── CodeBlock │ │ │ └── hightlight-code.test.ts │ │ ├── playground-pattern.test.ts │ │ └── Tree │ │ └── Tree-states.test.ts │ ├── components-core │ │ ├── abstractions │ │ │ └── treeAbstractions.test.ts │ │ ├── container │ │ │ └── buildProxy.test.ts │ │ ├── interception │ │ │ ├── orderBy.test.ts │ │ │ ├── ReadOnlyCollection.test.ts │ │ │ └── request-param-converter.test.ts │ │ ├── scripts-runner │ │ │ ├── AttributeValueParser.test.ts │ │ │ ├── eval-tree-arrow-async.test.ts │ │ │ ├── eval-tree-arrow.test.ts │ │ │ ├── eval-tree-func-decl-async.test.ts │ │ │ ├── eval-tree-func-decl.test.ts │ │ │ ├── eval-tree-pre-post.test.ts │ │ │ ├── eval-tree-regression.test.ts │ │ │ ├── eval-tree.test.ts │ │ │ ├── function-proxy.test.ts │ │ │ ├── parser-regression.test.ts │ │ │ ├── process-event.test.ts │ │ │ ├── process-function.test.ts │ │ │ ├── process-implicit-context.test.ts │ │ │ ├── process-statement-asgn.test.ts │ │ │ ├── process-statement-destruct.test.ts │ │ │ ├── process-statement-regs.test.ts │ │ │ ├── process-statement-sync.test.ts │ │ │ ├── process-statement.test.ts │ │ │ ├── process-switch-sync.test.ts │ │ │ ├── process-switch.test.ts │ │ │ ├── process-try-sync.test.ts │ │ │ ├── process-try.test.ts │ │ │ └── test-helpers.ts │ │ ├── test-metadata-handler.ts │ │ ├── theming │ │ │ ├── border-segments.test.ts │ │ │ ├── component-layout.resolver.test.ts │ │ │ ├── layout-property-parser.test.ts │ │ │ ├── layout-resolver.test.ts │ │ │ ├── layout-resolver2.test.ts │ │ │ ├── layout-vp-override.test.ts │ │ │ └── padding-segments.test.ts │ │ └── utils │ │ ├── date-utils.test.ts │ │ ├── format-human-elapsed-time.test.ts │ │ └── LruCache.test.ts │ ├── language-server │ │ ├── completion.test.ts │ │ ├── format.test.ts │ │ ├── hover.test.ts │ │ └── mockData.ts │ └── parsers │ ├── common │ │ └── input-stream.test.ts │ ├── markdown │ │ └── parse-binding-expression.test.ts │ ├── parameter-parser.test.ts │ ├── paremeter-parser.test.ts │ ├── scripting │ │ ├── eval-tree-arrow.test.ts │ │ ├── eval-tree-pre-post.test.ts │ │ ├── eval-tree.test.ts │ │ ├── function-proxy.test.ts │ │ ├── lexer-literals.test.ts │ │ ├── lexer-misc.test.ts │ │ ├── module-parse.test.ts │ │ ├── parser-arrow.test.ts │ │ ├── parser-assignments.test.ts │ │ ├── parser-binary.test.ts │ │ ├── parser-destructuring.test.ts │ │ ├── parser-errors.test.ts │ │ ├── parser-expressions.test.ts │ │ ├── parser-function.test.ts │ │ ├── parser-literals.test.ts │ │ ├── parser-primary.test.ts │ │ ├── parser-regex.test.ts │ │ ├── parser-statements.test.ts │ │ ├── parser-unary.test.ts │ │ ├── process-event.test.ts │ │ ├── process-implicit-context.test.ts │ │ ├── process-statement-asgn.test.ts │ │ ├── process-statement-destruct.test.ts │ │ ├── process-statement-regs.test.ts │ │ ├── process-statement-sync.test.ts │ │ ├── process-statement.test.ts │ │ ├── process-switch-sync.test.ts │ │ ├── process-switch.test.ts │ │ ├── process-try-sync.test.ts │ │ ├── process-try.test.ts │ │ ├── simplify-expression.test.ts │ │ ├── statement-hooks.test.ts │ │ └── test-helpers.ts │ ├── style-parser │ │ ├── generateHvarChain.test.ts │ │ ├── parseHVar.test.ts │ │ ├── parser.test.ts │ │ └── tokens.test.ts │ └── xmlui │ ├── lint.test.ts │ ├── parser.test.ts │ ├── scanner.test.ts │ ├── transform.attr.test.ts │ ├── transform.circular.test.ts │ ├── transform.element.test.ts │ ├── transform.errors.test.ts │ ├── transform.escape.test.ts │ ├── transform.regression.test.ts │ ├── transform.script.test.ts │ ├── transform.test.ts │ └── xmlui.ts ├── tests-e2e │ ├── api-bound-component-regression.spec.ts │ ├── api-call-as-extracted-component.spec.ts │ ├── assign-to-object-or-array-regression.spec.ts │ ├── binding-regression.spec.ts │ ├── children-as-template-context-vars.spec.ts │ ├── compound-component.spec.ts │ ├── context-vars-regression.spec.ts │ ├── data-bindings.spec.ts │ ├── datasource-and-api-usage-in-var.spec.ts │ ├── datasource-direct-binding.spec.ts │ ├── datasource-onLoaded-regression.spec.ts │ ├── modify-array-item-regression.spec.ts │ ├── namespaces.spec.ts │ ├── push-to-array-regression.spec.ts │ ├── screen-breakpoints.spec.ts │ ├── scripting.spec.ts │ ├── state-scope-in-pages.spec.ts │ └── state-var-scopes.spec.ts ├── tsconfig.bin.json ├── tsconfig.json ├── tsconfig.node.json ├── vite.config.ts └── vitest.config.ts ``` # Files -------------------------------------------------------------------------------- /xmlui/tests/parsers/scripting/process-statement-sync.test.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { describe, expect, it, assert } from "vitest"; 2 | 3 | import { 4 | ArrowExpressionStatement, 5 | ExpressionStatement, 6 | T_ARROW_EXPRESSION_STATEMENT, 7 | } from "../../../src/components-core/script-runner/ScriptingSourceTree"; 8 | import { processStatementQueue } from "../../../src/components-core/script-runner/process-statement-sync"; 9 | import { createEvalContext, parseStatements } from "./test-helpers"; 10 | import { buildProxy } from "../../../src/components-core/rendering/buildProxy"; 11 | 12 | describe("Process statements (sync)", () => { 13 | it("expression statement #1", () => { 14 | // --- Arrange 15 | const source = "x = 3 * x;"; 16 | const evalContext = createEvalContext({ 17 | localContext: { 18 | x: 1, 19 | }, 20 | }); 21 | const statements = parseStatements(source); 22 | 23 | // --- Act 24 | const diag = processStatementQueue(statements, evalContext); 25 | 26 | // --- Assertí 27 | expect(evalContext.mainThread!.blocks!.length).equal(1); 28 | expect(evalContext.localContext.x).equal(3); 29 | 30 | expect(diag.processedStatements).equal(1); 31 | expect(diag.maxLoops).equal(0); 32 | expect(diag.maxBlocks).equal(1); 33 | expect(diag.maxQueueLength).equal(1); 34 | expect(diag.clearToLabels).equal(0); 35 | expect(diag.unshiftedItems).equal(0); 36 | }); 37 | 38 | it("Let statement #1", () => { 39 | // --- Arrange 40 | const source = "let y"; 41 | const evalContext = createEvalContext({ 42 | localContext: { 43 | x: 0, 44 | }, 45 | }); 46 | const statements = parseStatements(source); 47 | 48 | // --- Act 49 | const diag = processStatementQueue(statements, evalContext); 50 | 51 | // --- Assert 52 | const thread = evalContext.mainThread!; 53 | expect(thread.blocks!.length).equal(1); 54 | expect("y" in thread.blocks![0].vars).equal(true); 55 | expect(thread.blocks![0].constVars).equal(undefined); 56 | 57 | expect(diag.processedStatements).equal(1); 58 | expect(diag.maxLoops).equal(0); 59 | expect(diag.maxBlocks).equal(1); 60 | expect(diag.maxQueueLength).equal(1); 61 | expect(diag.clearToLabels).equal(0); 62 | expect(diag.unshiftedItems).equal(0); 63 | }); 64 | 65 | it("Let statement #2", () => { 66 | // --- Arrange 67 | const source = "let y = 3"; 68 | const evalContext = createEvalContext({ 69 | localContext: { 70 | x: 0, 71 | }, 72 | }); 73 | const statements = parseStatements(source); 74 | 75 | // --- Act 76 | const diag = processStatementQueue(statements, evalContext); 77 | 78 | // --- Assert 79 | const thread = evalContext.mainThread!; 80 | expect(thread.blocks!.length).equal(1); 81 | expect(thread.blocks![0].vars.y).equal(3); 82 | expect(thread.blocks![0].constVars).equal(undefined); 83 | 84 | expect(diag.processedStatements).equal(1); 85 | expect(diag.maxLoops).equal(0); 86 | expect(diag.maxBlocks).equal(1); 87 | expect(diag.maxQueueLength).equal(1); 88 | expect(diag.clearToLabels).equal(0); 89 | expect(diag.unshiftedItems).equal(0); 90 | }); 91 | 92 | it("Let statement #3", () => { 93 | // --- Arrange 94 | const source = "let y = 3, z = 2"; 95 | const evalContext = createEvalContext({ 96 | localContext: {}, 97 | }); 98 | const statements = parseStatements(source); 99 | 100 | // --- Act 101 | const diag = processStatementQueue(statements, evalContext); 102 | 103 | // --- Assert 104 | const thread = evalContext.mainThread!; 105 | expect(thread.blocks!.length).equal(1); 106 | expect(thread.blocks![0].vars.y).equal(3); 107 | expect(thread.blocks![0].vars.z).equal(2); 108 | expect(thread.blocks![0].constVars).equal(undefined); 109 | 110 | expect(diag.processedStatements).equal(1); 111 | expect(diag.maxLoops).equal(0); 112 | expect(diag.maxBlocks).equal(1); 113 | expect(diag.maxQueueLength).equal(1); 114 | expect(diag.clearToLabels).equal(0); 115 | expect(diag.unshiftedItems).equal(0); 116 | }); 117 | 118 | it("Const statement #2", () => { 119 | // --- Arrange 120 | const source = "const y = 3"; 121 | const evalContext = createEvalContext({ 122 | localContext: { 123 | x: 0, 124 | }, 125 | }); 126 | const statements = parseStatements(source); 127 | 128 | // --- Act 129 | const diag = processStatementQueue(statements, evalContext); 130 | 131 | // --- Assert 132 | const thread = evalContext.mainThread!; 133 | expect(thread.blocks!.length).equal(1); 134 | expect(thread.blocks![0].vars.y).equal(3); 135 | expect(thread.blocks![0].constVars!.has("y")).equal(true); 136 | 137 | expect(diag.processedStatements).equal(1); 138 | expect(diag.maxLoops).equal(0); 139 | expect(diag.maxBlocks).equal(1); 140 | expect(diag.maxQueueLength).equal(1); 141 | expect(diag.clearToLabels).equal(0); 142 | expect(diag.unshiftedItems).equal(0); 143 | }); 144 | 145 | it("Const write #1", () => { 146 | // --- Arrange 147 | const source = "const y = 3; y++"; 148 | const evalContext = createEvalContext({ 149 | localContext: { 150 | x: 0, 151 | }, 152 | }); 153 | const statements = parseStatements(source); 154 | 155 | // --- Act 156 | try { 157 | processStatementQueue(statements, evalContext); 158 | } catch (err) { 159 | return; 160 | } 161 | assert.fail("Exception expected"); 162 | }); 163 | 164 | it("Const write #2", () => { 165 | // --- Arrange 166 | const source = "const y = 3; y = 12"; 167 | const evalContext = createEvalContext({ 168 | localContext: { 169 | x: 0, 170 | }, 171 | }); 172 | const statements = parseStatements(source); 173 | 174 | // --- Act 175 | try { 176 | processStatementQueue(statements, evalContext); 177 | } catch (err) { 178 | return; 179 | } 180 | assert.fail("Exception expected"); 181 | }); 182 | 183 | it("Implicit block #1", () => { 184 | // --- Arrange 185 | const source = "let y = 3; x = 3 * y;"; 186 | const evalContext = createEvalContext({ 187 | localContext: { 188 | x: 0, 189 | }, 190 | }); 191 | const statements = parseStatements(source); 192 | 193 | // --- Act 194 | const diag = processStatementQueue(statements, evalContext); 195 | 196 | // --- Assert 197 | const thread = evalContext.mainThread!; 198 | expect(thread.blocks!.length).equal(1); 199 | expect(thread.blocks![0].vars.y).equal(3); 200 | expect(evalContext.localContext.x).equal(9); 201 | 202 | expect(diag.processedStatements).equal(2); 203 | expect(diag.maxLoops).equal(0); 204 | expect(diag.maxBlocks).equal(1); 205 | expect(diag.maxQueueLength).equal(2); 206 | expect(diag.clearToLabels).equal(0); 207 | expect(diag.unshiftedItems).equal(0); 208 | }); 209 | 210 | it("Implicit block #2", () => { 211 | // --- Arrange 212 | const source = "let y = 3; { let z = 2 ; x = 3 * y + z; }"; 213 | const evalContext = createEvalContext({ 214 | localContext: { 215 | x: 0, 216 | }, 217 | }); 218 | const statements = parseStatements(source); 219 | 220 | // --- Act 221 | const diag = processStatementQueue(statements, evalContext); 222 | 223 | // --- Assert 224 | const thread = evalContext.mainThread!; 225 | expect(thread.blocks!.length).equal(1); 226 | expect(thread.blocks![0].vars.y).equal(3); 227 | expect(evalContext.localContext.x).equal(11); 228 | 229 | expect(diag.processedStatements).equal(5); 230 | expect(diag.maxLoops).equal(0); 231 | expect(diag.maxBlocks).equal(2); 232 | expect(diag.maxQueueLength).equal(3); 233 | expect(diag.clearToLabels).equal(0); 234 | expect(diag.unshiftedItems).equal(3); 235 | }); 236 | 237 | it("Block statement #1", () => { 238 | // --- Arrange 239 | const source = "{ let y = 3; x = 3 * y; }"; 240 | const evalContext = createEvalContext({ 241 | localContext: { 242 | x: 0, 243 | }, 244 | }); 245 | const statements = parseStatements(source); 246 | 247 | // --- Act 248 | const diag = processStatementQueue(statements, evalContext); 249 | 250 | // --- Assert 251 | expect(evalContext.mainThread!.blocks!.length).equal(1); 252 | expect(evalContext.localContext.x).equal(9); 253 | 254 | expect(diag.processedStatements).equal(4); 255 | expect(diag.maxLoops).equal(0); 256 | expect(diag.maxBlocks).equal(2); 257 | expect(diag.maxQueueLength).equal(3); 258 | expect(diag.clearToLabels).equal(0); 259 | expect(diag.unshiftedItems).equal(3); 260 | }); 261 | 262 | it("Block statement #2", () => { 263 | // --- Arrange 264 | const source = "{ let y = 3; { let z = 2 ; x = 3 * y + z; } }"; 265 | const evalContext = createEvalContext({ 266 | localContext: { 267 | x: 0, 268 | }, 269 | }); 270 | const statements = parseStatements(source); 271 | 272 | // --- Act 273 | const diag = processStatementQueue(statements, evalContext); 274 | 275 | // --- Assert 276 | expect(evalContext.mainThread!.blocks!.length).equal(1); 277 | expect(evalContext.localContext.x).equal(11); 278 | 279 | expect(diag.processedStatements).equal(7); 280 | expect(diag.maxLoops).equal(0); 281 | expect(diag.maxBlocks).equal(3); 282 | expect(diag.maxQueueLength).equal(4); 283 | expect(diag.clearToLabels).equal(0); 284 | expect(diag.unshiftedItems).equal(6); 285 | }); 286 | 287 | it("Block statement #3", () => { 288 | // --- Arrange 289 | const source = "{ let y = 3; { let z = 2 ; { x = 3 * y + z; } } }"; 290 | const evalContext = createEvalContext({ 291 | localContext: { 292 | x: 0, 293 | }, 294 | }); 295 | const statements = parseStatements(source); 296 | 297 | // --- Act 298 | const diag = processStatementQueue(statements, evalContext); 299 | 300 | // --- Assert 301 | expect(evalContext.mainThread!.blocks!.length).equal(1); 302 | expect(evalContext.localContext.x).equal(11); 303 | 304 | expect(diag.processedStatements).equal(9); 305 | expect(diag.maxLoops).equal(0); 306 | expect(diag.maxBlocks).equal(4); 307 | expect(diag.maxQueueLength).equal(4); 308 | expect(diag.clearToLabels).equal(0); 309 | expect(diag.unshiftedItems).equal(8); 310 | }); 311 | 312 | it("Block statement #4", () => { 313 | // --- Arrange 314 | const source = "{ let y = 3; { let z = 2 ; { let z = 3; x = 3 * y + z; } } }"; 315 | const evalContext = createEvalContext({ 316 | localContext: { 317 | x: 0, 318 | }, 319 | }); 320 | const statements = parseStatements(source); 321 | 322 | // --- Act 323 | const diag = processStatementQueue(statements, evalContext); 324 | 325 | // --- Assert 326 | expect(evalContext.mainThread!.blocks!.length).equal(1); 327 | expect(evalContext.localContext.x).equal(12); 328 | 329 | expect(diag.processedStatements).equal(10); 330 | expect(diag.maxLoops).equal(0); 331 | expect(diag.maxBlocks).equal(4); 332 | expect(diag.maxQueueLength).equal(5); 333 | expect(diag.clearToLabels).equal(0); 334 | expect(diag.unshiftedItems).equal(9); 335 | }); 336 | 337 | it("If statement #1", () => { 338 | // --- Arrange 339 | const source = "if (x === 0) x = 3"; 340 | const evalContext = createEvalContext({ 341 | localContext: { 342 | x: 0, 343 | }, 344 | }); 345 | const statements = parseStatements(source); 346 | 347 | // --- Act 348 | const diag = processStatementQueue(statements, evalContext); 349 | 350 | // --- Assert 351 | expect(evalContext.mainThread!.blocks!.length).equal(1); 352 | expect(evalContext.localContext.x).equal(3); 353 | 354 | expect(diag.processedStatements).equal(2); 355 | expect(diag.maxLoops).equal(0); 356 | expect(diag.maxBlocks).equal(1); 357 | expect(diag.maxQueueLength).equal(1); 358 | expect(diag.clearToLabels).equal(0); 359 | expect(diag.unshiftedItems).equal(1); 360 | }); 361 | 362 | it("If statement #2", () => { 363 | // --- Arrange 364 | const source = "if (x === 0) {x = 3}"; 365 | const evalContext = createEvalContext({ 366 | localContext: { 367 | x: 0, 368 | }, 369 | }); 370 | const statements = parseStatements(source); 371 | 372 | // --- Act 373 | const diag = processStatementQueue(statements, evalContext); 374 | 375 | // --- Assert 376 | expect(evalContext.mainThread!.blocks!.length).equal(1); 377 | expect(evalContext.localContext.x).equal(3); 378 | 379 | expect(diag.processedStatements).equal(4); 380 | expect(diag.maxLoops).equal(0); 381 | expect(diag.maxBlocks).equal(2); 382 | expect(diag.maxQueueLength).equal(2); 383 | expect(diag.clearToLabels).equal(0); 384 | expect(diag.unshiftedItems).equal(3); 385 | }); 386 | 387 | it("If statement #3", () => { 388 | // --- Arrange 389 | const source = "if (x === 0) x = 3; else x = 2"; 390 | const evalContext = createEvalContext({ 391 | localContext: { 392 | x: 1, 393 | }, 394 | }); 395 | const statements = parseStatements(source); 396 | 397 | // --- Act 398 | const diag = processStatementQueue(statements, evalContext); 399 | 400 | // --- Assert 401 | expect(evalContext.mainThread!.blocks!.length).equal(1); 402 | expect(evalContext.localContext.x).equal(2); 403 | 404 | expect(diag.processedStatements).equal(2); 405 | expect(diag.maxLoops).equal(0); 406 | expect(diag.maxBlocks).equal(1); 407 | expect(diag.maxQueueLength).equal(1); 408 | expect(diag.clearToLabels).equal(0); 409 | expect(diag.unshiftedItems).equal(1); 410 | }); 411 | 412 | it("If statement #4", () => { 413 | // --- Arrange 414 | const source = "if (x === 0) x = 3; else { x = 2 }"; 415 | const evalContext = createEvalContext({ 416 | localContext: { 417 | x: 1, 418 | }, 419 | }); 420 | const statements = parseStatements(source); 421 | 422 | // --- Act 423 | const diag = processStatementQueue(statements, evalContext); 424 | 425 | // --- Assert 426 | expect(evalContext.mainThread!.blocks!.length).equal(1); 427 | expect(evalContext.localContext.x).equal(2); 428 | 429 | expect(diag.processedStatements).equal(4); 430 | expect(diag.maxLoops).equal(0); 431 | expect(diag.maxBlocks).equal(2); 432 | expect(diag.maxQueueLength).equal(2); 433 | expect(diag.clearToLabels).equal(0); 434 | expect(diag.unshiftedItems).equal(3); 435 | }); 436 | 437 | it("If statement #5", () => { 438 | // --- Arrange 439 | const source = "if (x === 0) {x = 3;} else { x = 2 }"; 440 | const evalContext = createEvalContext({ 441 | localContext: { 442 | x: 0, 443 | }, 444 | }); 445 | const statements = parseStatements(source); 446 | 447 | // --- Act 448 | const diag = processStatementQueue(statements, evalContext); 449 | 450 | // --- Assert 451 | expect(evalContext.mainThread!.blocks!.length).equal(1); 452 | expect(evalContext.localContext.x).equal(3); 453 | 454 | expect(diag.processedStatements).equal(4); 455 | expect(diag.maxLoops).equal(0); 456 | expect(diag.maxBlocks).equal(2); 457 | expect(diag.maxQueueLength).equal(2); 458 | expect(diag.clearToLabels).equal(0); 459 | expect(diag.unshiftedItems).equal(3); 460 | }); 461 | 462 | it("If statement #6", () => { 463 | // --- Arrange 464 | const source = "if (x === 0) {x = 3;} else { x = 2 }"; 465 | const evalContext = createEvalContext({ 466 | localContext: { 467 | x: 1, 468 | }, 469 | }); 470 | const statements = parseStatements(source); 471 | 472 | // --- Act 473 | const diag = processStatementQueue(statements, evalContext); 474 | 475 | // --- Assert 476 | expect(evalContext.mainThread!.blocks!.length).equal(1); 477 | expect(evalContext.localContext.x).equal(2); 478 | 479 | expect(diag.processedStatements).equal(4); 480 | expect(diag.maxLoops).equal(0); 481 | expect(diag.maxBlocks).equal(2); 482 | expect(diag.maxQueueLength).equal(2); 483 | expect(diag.clearToLabels).equal(0); 484 | expect(diag.unshiftedItems).equal(3); 485 | }); 486 | 487 | it("while statement #1", () => { 488 | // --- Arrange 489 | const source = "while (x < 3) x++;"; 490 | const evalContext = createEvalContext({ 491 | localContext: { 492 | x: 0, 493 | }, 494 | }); 495 | const statements = parseStatements(source); 496 | 497 | // --- Act 498 | const diag = processStatementQueue(statements, evalContext); 499 | 500 | // --- Assert 501 | expect(evalContext.mainThread!.blocks!.length).equal(1); 502 | expect(evalContext.localContext.x).equal(3); 503 | 504 | expect(diag.processedStatements).equal(7); 505 | expect(diag.maxLoops).equal(1); 506 | expect(diag.maxBlocks).equal(1); 507 | expect(diag.maxQueueLength).equal(2); 508 | expect(diag.clearToLabels).equal(0); 509 | expect(diag.unshiftedItems).equal(6); 510 | }); 511 | 512 | it("while statement #2", () => { 513 | // --- Arrange 514 | const source = "let x = 0; while (x < 3) x++;"; 515 | const evalContext = createEvalContext({ 516 | localContext: {}, 517 | }); 518 | const statements = parseStatements(source); 519 | 520 | // --- Act 521 | const diag = processStatementQueue(statements, evalContext); 522 | 523 | // --- Assert 524 | const thread = evalContext.mainThread!; 525 | expect(thread.blocks!.length).equal(1); 526 | expect(thread.blocks![0].vars.x).equal(3); 527 | 528 | expect(diag.processedStatements).equal(8); 529 | expect(diag.maxLoops).equal(1); 530 | expect(diag.maxBlocks).equal(1); 531 | expect(diag.maxQueueLength).equal(2); 532 | expect(diag.clearToLabels).equal(0); 533 | expect(diag.unshiftedItems).equal(6); 534 | }); 535 | 536 | it("while statement #3", () => { 537 | // --- Arrange 538 | const source = "let x = 0; while (x < 8) {let y = 2; x += y;}"; 539 | const evalContext = createEvalContext({ 540 | localContext: {}, 541 | }); 542 | const statements = parseStatements(source); 543 | 544 | // --- Act 545 | const diag = processStatementQueue(statements, evalContext); 546 | 547 | // --- Assert 548 | const thread = evalContext.mainThread!; 549 | expect(thread.blocks!.length).equal(1); 550 | expect(thread.blocks![0].vars.x).equal(8); 551 | 552 | expect(diag.processedStatements).equal(22); 553 | expect(diag.maxLoops).equal(1); 554 | expect(diag.maxBlocks).equal(2); 555 | expect(diag.maxQueueLength).equal(4); 556 | expect(diag.clearToLabels).equal(0); 557 | expect(diag.unshiftedItems).equal(20); 558 | }); 559 | 560 | it("while statement #4", () => { 561 | // --- Arrange 562 | const source = "let x = 0; while (x < 18) {let y = 0; while (y < 3) {x += y; y++;} }"; 563 | const evalContext = createEvalContext({ 564 | localContext: {}, 565 | }); 566 | const statements = parseStatements(source); 567 | 568 | // --- Act 569 | const diag = processStatementQueue(statements, evalContext); 570 | 571 | // --- Assert 572 | const thread = evalContext.mainThread!; 573 | expect(thread.blocks!.length).equal(1); 574 | expect(thread.blocks![0].vars.x).equal(18); 575 | 576 | expect(diag.processedStatements).equal(122); 577 | expect(diag.maxLoops).equal(2); 578 | expect(diag.maxBlocks).equal(3); 579 | expect(diag.maxQueueLength).equal(6); 580 | expect(diag.clearToLabels).equal(0); 581 | expect(diag.unshiftedItems).equal(120); 582 | }); 583 | 584 | it("while with break #1", () => { 585 | // --- Arrange 586 | const source = "let x = 0; while (true) {x++ ; if (x > 3) break;}"; 587 | const evalContext = createEvalContext({ 588 | localContext: {}, 589 | }); 590 | const statements = parseStatements(source); 591 | 592 | // --- Act 593 | const diag = processStatementQueue(statements, evalContext); 594 | 595 | // --- Assert 596 | const thread = evalContext.mainThread!; 597 | expect(thread.blocks!.length).equal(1); 598 | expect(thread.blocks![0].vars.x).equal(4); 599 | 600 | expect(diag.processedStatements).equal(21); 601 | expect(diag.maxLoops).equal(1); 602 | expect(diag.maxBlocks).equal(2); 603 | expect(diag.maxQueueLength).equal(4); 604 | expect(diag.clearToLabels).equal(1); 605 | expect(diag.unshiftedItems).equal(21); 606 | }); 607 | 608 | it("while with break #2", () => { 609 | // --- Arrange 610 | const source = "let x = 0; while (true) {x++ ; if (x > 3) break;}; x++"; 611 | const evalContext = createEvalContext({ 612 | localContext: {}, 613 | }); 614 | const statements = parseStatements(source); 615 | 616 | // --- Act 617 | const diag = processStatementQueue(statements, evalContext); 618 | 619 | // --- Assert 620 | const thread = evalContext.mainThread!; 621 | expect(thread.blocks!.length).equal(1); 622 | expect(thread.blocks![0].vars.x).equal(5); 623 | 624 | expect(diag.processedStatements).equal(22); 625 | expect(diag.maxLoops).equal(1); 626 | expect(diag.maxBlocks).equal(2); 627 | expect(diag.maxQueueLength).equal(5); 628 | expect(diag.clearToLabels).equal(1); 629 | expect(diag.unshiftedItems).equal(21); 630 | }); 631 | 632 | it("while with continue #1", () => { 633 | // --- Arrange 634 | const source = "let y = 0; let x = 0; while (x < 6) {x++; if (x == 3) continue; y += x; }"; 635 | const evalContext = createEvalContext({ 636 | localContext: {}, 637 | }); 638 | const statements = parseStatements(source); 639 | 640 | // --- Act 641 | const diag = processStatementQueue(statements, evalContext); 642 | 643 | // --- Assert 644 | const thread = evalContext.mainThread!; 645 | expect(thread.blocks!.length).equal(1); 646 | expect(thread.blocks![0].vars.y).equal(18); 647 | 648 | expect(diag.processedStatements).equal(38); 649 | expect(diag.maxLoops).equal(1); 650 | expect(diag.maxBlocks).equal(2); 651 | expect(diag.maxQueueLength).equal(5); 652 | expect(diag.clearToLabels).equal(1); 653 | expect(diag.unshiftedItems).equal(37); 654 | }); 655 | 656 | it("do-while statement #1", () => { 657 | // --- Arrange 658 | const source = "do x++; while (x < 3)"; 659 | const evalContext = createEvalContext({ 660 | localContext: { 661 | x: 0, 662 | }, 663 | }); 664 | const statements = parseStatements(source); 665 | 666 | // --- Act 667 | const diag = processStatementQueue(statements, evalContext); 668 | 669 | // --- Assert 670 | expect(evalContext.mainThread!.blocks!.length).equal(1); 671 | expect(evalContext.localContext.x).equal(3); 672 | 673 | expect(diag.processedStatements).equal(7); 674 | expect(diag.maxLoops).equal(1); 675 | expect(diag.maxBlocks).equal(1); 676 | expect(diag.maxQueueLength).equal(2); 677 | expect(diag.clearToLabels).equal(0); 678 | expect(diag.unshiftedItems).equal(6); 679 | }); 680 | 681 | it("do-while statement #2", () => { 682 | // --- Arrange 683 | const source = "do x++; while (x < 0)"; 684 | const evalContext = createEvalContext({ 685 | localContext: { 686 | x: 0, 687 | }, 688 | }); 689 | const statements = parseStatements(source); 690 | 691 | // --- Act 692 | const diag = processStatementQueue(statements, evalContext); 693 | 694 | // --- Assert 695 | expect(evalContext.mainThread!.blocks!.length).equal(1); 696 | expect(evalContext.localContext.x).equal(1); 697 | 698 | expect(diag.processedStatements).equal(3); 699 | expect(diag.maxLoops).equal(1); 700 | expect(diag.maxBlocks).equal(1); 701 | expect(diag.maxQueueLength).equal(2); 702 | expect(diag.clearToLabels).equal(0); 703 | expect(diag.unshiftedItems).equal(2); 704 | }); 705 | 706 | it("do-while statement #3", () => { 707 | // --- Arrange 708 | const source = "do { x++;} while (x < 3)"; 709 | const evalContext = createEvalContext({ 710 | localContext: { 711 | x: 0, 712 | }, 713 | }); 714 | const statements = parseStatements(source); 715 | 716 | // --- Act 717 | const diag = processStatementQueue(statements, evalContext); 718 | 719 | // --- Assert 720 | expect(evalContext.mainThread!.blocks!.length).equal(1); 721 | expect(evalContext.localContext.x).equal(3); 722 | 723 | expect(diag.processedStatements).equal(13); 724 | expect(diag.maxLoops).equal(1); 725 | expect(diag.maxBlocks).equal(2); 726 | expect(diag.maxQueueLength).equal(3); 727 | expect(diag.clearToLabels).equal(0); 728 | expect(diag.unshiftedItems).equal(12); 729 | }); 730 | 731 | it("do-while statement #4", () => { 732 | // --- Arrange 733 | const source = "let x = 0; do {let y = 2; x += y;} while (x < 8) "; 734 | const evalContext = createEvalContext({ 735 | localContext: {}, 736 | }); 737 | const statements = parseStatements(source); 738 | 739 | // --- Act 740 | const diag = processStatementQueue(statements, evalContext); 741 | 742 | // --- Assert 743 | const thread = evalContext.mainThread!; 744 | expect(thread.blocks!.length).equal(1); 745 | expect(thread.blocks![0].vars.x).equal(8); 746 | 747 | expect(diag.processedStatements).equal(22); 748 | expect(diag.maxLoops).equal(1); 749 | expect(diag.maxBlocks).equal(2); 750 | expect(diag.maxQueueLength).equal(4); 751 | expect(diag.clearToLabels).equal(0); 752 | expect(diag.unshiftedItems).equal(20); 753 | }); 754 | 755 | it("do-while statement #5", () => { 756 | // --- Arrange 757 | const source = "let x = 0; do {let y = 0; while (y < 3) {x += y; y++;} } while (x < 18)"; 758 | const evalContext = createEvalContext({ 759 | localContext: {}, 760 | }); 761 | const statements = parseStatements(source); 762 | 763 | // --- Act 764 | const diag = processStatementQueue(statements, evalContext); 765 | 766 | // --- Assert 767 | const thread = evalContext.mainThread!; 768 | expect(thread.blocks!.length).equal(1); 769 | expect(thread.blocks![0].vars.x).equal(18); 770 | 771 | expect(diag.processedStatements).equal(122); 772 | expect(diag.maxLoops).equal(2); 773 | expect(diag.maxBlocks).equal(3); 774 | expect(diag.maxQueueLength).equal(6); 775 | expect(diag.clearToLabels).equal(0); 776 | expect(diag.unshiftedItems).equal(120); 777 | }); 778 | 779 | it("do-while with break #1", () => { 780 | // --- Arrange 781 | const source = "let x = 0; do {x++ ; if (x > 3) break;} while (true)"; 782 | const evalContext = createEvalContext({ 783 | localContext: {}, 784 | }); 785 | const statements = parseStatements(source); 786 | 787 | // --- Act 788 | const diag = processStatementQueue(statements, evalContext); 789 | 790 | // --- Assert 791 | const thread = evalContext.mainThread!; 792 | expect(thread.blocks!.length).equal(1); 793 | expect(thread.blocks![0].vars.x).equal(4); 794 | 795 | expect(diag.processedStatements).equal(21); 796 | expect(diag.maxLoops).equal(1); 797 | expect(diag.maxBlocks).equal(2); 798 | expect(diag.maxQueueLength).equal(4); 799 | expect(diag.clearToLabels).equal(1); 800 | expect(diag.unshiftedItems).equal(21); 801 | }); 802 | 803 | it("do-while with continue #1", () => { 804 | // --- Arrange 805 | const source = "let y = 0; let x = 0; do {x++; if (x == 3) continue; y += x; } while (x < 6)"; 806 | const evalContext = createEvalContext({ 807 | localContext: {}, 808 | }); 809 | const statements = parseStatements(source); 810 | 811 | // --- Act 812 | const diag = processStatementQueue(statements, evalContext); 813 | 814 | // --- Assert 815 | const thread = evalContext.mainThread!; 816 | expect(thread.blocks!.length).equal(1); 817 | expect(thread.blocks![0].vars.y).equal(18); 818 | 819 | expect(diag.processedStatements).equal(38); 820 | expect(diag.maxLoops).equal(1); 821 | expect(diag.maxBlocks).equal(2); 822 | expect(diag.maxQueueLength).equal(5); 823 | expect(diag.clearToLabels).equal(1); 824 | expect(diag.unshiftedItems).equal(37); 825 | }); 826 | 827 | it("for-loop #1", () => { 828 | // --- Arrange 829 | const source = "let y = 0; for (let i = 0; i < 4; i++) y += i;"; 830 | const evalContext = createEvalContext({ 831 | localContext: {}, 832 | }); 833 | const statements = parseStatements(source); 834 | 835 | // --- Act 836 | const diag = processStatementQueue(statements, evalContext); 837 | 838 | // --- Assert 839 | const thread = evalContext.mainThread!; 840 | expect(thread.blocks!.length).equal(1); 841 | expect(thread.blocks![0].vars.y).equal(6); 842 | 843 | expect(diag.processedStatements).equal(16); 844 | expect(diag.maxLoops).equal(1); 845 | expect(diag.maxBlocks).equal(2); 846 | expect(diag.maxQueueLength).equal(3); 847 | expect(diag.clearToLabels).equal(0); 848 | expect(diag.unshiftedItems).equal(14); 849 | }); 850 | 851 | it("for-loop #2", () => { 852 | // --- Arrange 853 | const source = "let y = 0; for (let i = 0; i < 4; i++) {y += i;}"; 854 | const evalContext = createEvalContext({ 855 | localContext: {}, 856 | }); 857 | const statements = parseStatements(source); 858 | 859 | // --- Act 860 | const diag = processStatementQueue(statements, evalContext); 861 | 862 | // --- Assert 863 | const thread = evalContext.mainThread!; 864 | expect(thread.blocks!.length).equal(1); 865 | expect(thread.blocks![0].vars.y).equal(6); 866 | 867 | expect(diag.processedStatements).equal(24); 868 | expect(diag.maxLoops).equal(1); 869 | expect(diag.maxBlocks).equal(3); 870 | expect(diag.maxQueueLength).equal(4); 871 | expect(diag.clearToLabels).equal(0); 872 | expect(diag.unshiftedItems).equal(22); 873 | }); 874 | 875 | it("for-loop #3", () => { 876 | // --- Arrange 877 | const source = "let y = 0; for (let i = 0; i < 4; i++) { break; }; y++"; 878 | const evalContext = createEvalContext({ 879 | localContext: {}, 880 | }); 881 | const statements = parseStatements(source); 882 | 883 | // --- Act 884 | const diag = processStatementQueue(statements, evalContext); 885 | 886 | // --- Assert 887 | const thread = evalContext.mainThread!; 888 | expect(thread.blocks!.length).equal(1); 889 | expect(thread.blocks![0].vars.y).equal(1); 890 | 891 | expect(diag.processedStatements).equal(7); 892 | expect(diag.maxLoops).equal(1); 893 | expect(diag.maxBlocks).equal(3); 894 | expect(diag.maxQueueLength).equal(5); 895 | expect(diag.clearToLabels).equal(1); 896 | expect(diag.unshiftedItems).equal(7); 897 | }); 898 | 899 | it("for-loop #4", () => { 900 | // --- Arrange 901 | const source = "let y = 0; for (let i = 0, j = 0; i < 4; i++, j+=2) {y += i + j}"; 902 | const evalContext = createEvalContext({ 903 | localContext: {}, 904 | }); 905 | const statements = parseStatements(source); 906 | 907 | // --- Act 908 | const diag = processStatementQueue(statements, evalContext); 909 | 910 | // --- Assert 911 | const thread = evalContext.mainThread!; 912 | expect(thread.blocks!.length).equal(1); 913 | expect(thread.blocks![0].vars.y).equal(18); 914 | 915 | expect(diag.processedStatements).equal(24); 916 | expect(diag.maxLoops).equal(1); 917 | expect(diag.maxBlocks).equal(3); 918 | expect(diag.maxQueueLength).equal(4); 919 | expect(diag.clearToLabels).equal(0); 920 | expect(diag.unshiftedItems).equal(22); 921 | }); 922 | 923 | it("for-loop #5", () => { 924 | // --- Arrange 925 | const source = "let y = 0; let i = 0; for (; i < 4; i++) {y += i}"; 926 | const evalContext = createEvalContext({ 927 | localContext: {}, 928 | }); 929 | const statements = parseStatements(source); 930 | 931 | // --- Act 932 | const diag = processStatementQueue(statements, evalContext); 933 | 934 | // --- Assert 935 | const thread = evalContext.mainThread!; 936 | expect(thread.blocks!.length).equal(1); 937 | expect(thread.blocks![0].vars.y).equal(6); 938 | 939 | expect(diag.processedStatements).equal(24); 940 | expect(diag.maxLoops).equal(1); 941 | expect(diag.maxBlocks).equal(3); 942 | expect(diag.maxQueueLength).equal(4); 943 | expect(diag.clearToLabels).equal(0); 944 | expect(diag.unshiftedItems).equal(21); 945 | }); 946 | 947 | it("for-loop with continue", () => { 948 | // --- Arrange 949 | const source = "let y = 0; for (let i = 0; i < 10; i++) {if (i % 3 === 0) continue; y += i; }"; 950 | const evalContext = createEvalContext({ 951 | localContext: {}, 952 | }); 953 | const statements = parseStatements(source); 954 | 955 | // --- Act 956 | const diag = processStatementQueue(statements, evalContext); 957 | 958 | // --- Assert 959 | const thread = evalContext.mainThread!; 960 | expect(thread.blocks!.length).equal(1); 961 | expect(thread.blocks![0].vars.y).equal(27); 962 | 963 | expect(diag.processedStatements).equal(60); 964 | expect(diag.maxLoops).equal(1); 965 | expect(diag.maxBlocks).equal(3); 966 | expect(diag.maxQueueLength).equal(5); 967 | expect(diag.clearToLabels).equal(4); 968 | expect(diag.unshiftedItems).equal(66); 969 | }); 970 | 971 | it("Arrow function body #1", () => { 972 | // --- Arrange 973 | const source = "(() => {return 2})()"; 974 | const evalContext = createEvalContext({ 975 | localContext: {}, 976 | }); 977 | const statements = parseStatements(source); 978 | 979 | // --- Act 980 | const diag = processStatementQueue(statements, evalContext); 981 | 982 | // --- Assert 983 | const thread = evalContext.mainThread!; 984 | expect(thread.blocks!.length).equal(1); 985 | expect(thread.blocks![0].returnValue).equal(2); 986 | 987 | expect(diag.processedStatements).equal(1); 988 | expect(diag.maxLoops).equal(0); 989 | expect(diag.maxBlocks).equal(1); 990 | expect(diag.maxQueueLength).equal(1); 991 | expect(diag.clearToLabels).equal(0); 992 | expect(diag.unshiftedItems).equal(0); 993 | }); 994 | 995 | it("Arrow function body #2", () => { 996 | // --- Arrange 997 | const source = "let arr = () => {return 2}; let x = arr();"; 998 | const evalContext = createEvalContext({ 999 | localContext: {}, 1000 | }); 1001 | const statements = parseStatements(source); 1002 | 1003 | // --- Act 1004 | const diag = processStatementQueue(statements, evalContext); 1005 | 1006 | // --- Assert 1007 | const thread = evalContext.mainThread!; 1008 | expect(thread.blocks!.length).equal(1); 1009 | expect(thread.blocks![0].vars.x).equal(2); 1010 | 1011 | expect(diag.processedStatements).equal(2); 1012 | expect(diag.maxLoops).equal(0); 1013 | expect(diag.maxBlocks).equal(1); 1014 | expect(diag.maxQueueLength).equal(2); 1015 | expect(diag.clearToLabels).equal(0); 1016 | expect(diag.unshiftedItems).equal(0); 1017 | }); 1018 | 1019 | it("Arrow function body #3", () => { 1020 | // --- Arrange 1021 | const source = 1022 | "let arr = (x, y) => { let sum = 0; for (let i = x; i <= y; i++) sum+= i; return sum }; arr(1, 5);"; 1023 | const evalContext = createEvalContext({ 1024 | localContext: {}, 1025 | }); 1026 | const statements = parseStatements(source); 1027 | 1028 | // --- Act 1029 | const diag = processStatementQueue(statements, evalContext); 1030 | 1031 | // --- Assert 1032 | const thread = evalContext.mainThread!; 1033 | expect(thread.blocks!.length).equal(1); 1034 | expect(thread.blocks![0].returnValue).equal(15); 1035 | 1036 | expect(diag.processedStatements).equal(2); 1037 | expect(diag.maxLoops).equal(0); 1038 | expect(diag.maxBlocks).equal(1); 1039 | expect(diag.maxQueueLength).equal(2); 1040 | expect(diag.clearToLabels).equal(0); 1041 | expect(diag.unshiftedItems).equal(0); 1042 | }); 1043 | 1044 | it("Arrow function body #4", () => { 1045 | // --- Arrange 1046 | const source = 1047 | "let arr = (x, y) => { let sum = 0; for (let i = x; i <= y; i++) sum+= i; return sum }; z = arr(1, 5);"; 1048 | const evalContext = createEvalContext({ 1049 | localContext: { 1050 | z: 0, 1051 | }, 1052 | }); 1053 | const statements = parseStatements(source); 1054 | 1055 | // --- Act 1056 | const diag = processStatementQueue(statements, evalContext); 1057 | 1058 | // --- Assert 1059 | const thread = evalContext.mainThread!; 1060 | expect(thread.blocks!.length).equal(1); 1061 | expect(evalContext.localContext.z).equal(15); 1062 | expect(thread.blocks![0].returnValue).equal(15); 1063 | 1064 | expect(diag.processedStatements).equal(2); 1065 | expect(diag.maxLoops).equal(0); 1066 | expect(diag.maxBlocks).equal(1); 1067 | expect(diag.maxQueueLength).equal(2); 1068 | expect(diag.clearToLabels).equal(0); 1069 | expect(diag.unshiftedItems).equal(0); 1070 | }); 1071 | 1072 | it("return #1", () => { 1073 | // --- Arrange 1074 | const source = "return 123"; 1075 | const evalContext = createEvalContext({}); 1076 | const statements = parseStatements(source); 1077 | 1078 | // --- Act 1079 | const diag = processStatementQueue(statements, evalContext); 1080 | 1081 | // --- Assert 1082 | const thread = evalContext.mainThread!; 1083 | expect(thread.blocks!.length).equal(1); 1084 | expect(thread.returnValue).equal(123); 1085 | 1086 | expect(diag.processedStatements).equal(1); 1087 | expect(diag.maxLoops).equal(0); 1088 | expect(diag.maxBlocks).equal(1); 1089 | expect(diag.maxQueueLength).equal(1); 1090 | expect(diag.clearToLabels).equal(1); 1091 | expect(diag.unshiftedItems).equal(0); 1092 | }); 1093 | 1094 | it("return #2", () => { 1095 | // --- Arrange 1096 | const source = "x = 1; return 123; x = 2"; 1097 | const evalContext = createEvalContext({ 1098 | localContext: { 1099 | x: 0, 1100 | }, 1101 | }); 1102 | const statements = parseStatements(source); 1103 | 1104 | // --- Act 1105 | const diag = processStatementQueue(statements, evalContext); 1106 | 1107 | // --- Assert 1108 | const thread = evalContext.mainThread!; 1109 | expect(thread.blocks!.length).equal(1); 1110 | expect(evalContext.localContext.x).equal(1); 1111 | expect(thread.returnValue).equal(123); 1112 | 1113 | expect(diag.processedStatements).equal(2); 1114 | expect(diag.maxLoops).equal(0); 1115 | expect(diag.maxBlocks).equal(1); 1116 | expect(diag.maxQueueLength).equal(3); 1117 | expect(diag.clearToLabels).equal(1); 1118 | expect(diag.unshiftedItems).equal(0); 1119 | }); 1120 | 1121 | it("return #3", () => { 1122 | // --- Arrange 1123 | const source = "return"; 1124 | const evalContext = createEvalContext({}); 1125 | const statements = parseStatements(source); 1126 | 1127 | // --- Act 1128 | const diag = processStatementQueue(statements, evalContext); 1129 | 1130 | // --- Assert 1131 | const thread = evalContext.mainThread!; 1132 | expect(thread.blocks!.length).equal(1); 1133 | expect(thread.returnValue).equal(undefined); 1134 | 1135 | expect(diag.processedStatements).equal(1); 1136 | expect(diag.maxLoops).equal(0); 1137 | expect(diag.maxBlocks).equal(1); 1138 | expect(diag.maxQueueLength).equal(1); 1139 | expect(diag.clearToLabels).equal(1); 1140 | expect(diag.unshiftedItems).equal(0); 1141 | }); 1142 | 1143 | it("Body with timeout", () => { 1144 | // --- Arrange 1145 | const source = "while (true);"; 1146 | const evalContext = createEvalContext({ 1147 | localContext: {}, 1148 | }); 1149 | const statements = parseStatements(source); 1150 | 1151 | // --- Act 1152 | try { 1153 | processStatementQueue(statements, evalContext); 1154 | } catch (err: any) { 1155 | // eslint-disable-next-line jest/no-conditional-expect 1156 | expect(err.toString()).contains("timeout"); 1157 | return; 1158 | } 1159 | assert.fail("Exception expected"); 1160 | }); 1161 | 1162 | it("ArrowS", () => { 1163 | // --- Arrange 1164 | const source = "(arg)=> { return arg + 2 }"; 1165 | const evalContext = createEvalContext({ 1166 | localContext: {}, 1167 | eventArgs: [4], 1168 | }); 1169 | 1170 | const statements = parseStatements(source); 1171 | const arrowStmt = { 1172 | type: T_ARROW_EXPRESSION_STATEMENT, 1173 | expr: (statements[0] as ExpressionStatement).expr, 1174 | } as ArrowExpressionStatement; 1175 | 1176 | // --- Act 1177 | processStatementQueue([arrowStmt], evalContext); 1178 | const thread = evalContext.mainThread!; 1179 | 1180 | expect(thread.blocks![0].returnValue).equal(6); 1181 | }); 1182 | 1183 | it("Read-only write #1", () => { 1184 | // --- Arrange 1185 | const source = "$x = 3"; 1186 | const evalContext = createEvalContext({ 1187 | localContext: getComponentStateClone({ 1188 | $x: 0, 1189 | }), 1190 | // syncUpdateWithExternalStore: checkReadOnlyOnUpdate, 1191 | // isReadOnlyVar: isReadOnlyField 1192 | }); 1193 | const statements = parseStatements(source); 1194 | 1195 | // --- Act 1196 | try { 1197 | processStatementQueue(statements, evalContext); 1198 | } catch (err: any) { 1199 | expect(err.toString().includes("read-only")).equal(true); 1200 | return; 1201 | } 1202 | assert.fail("Exception expected"); 1203 | }); 1204 | 1205 | it("Read-only write #2", () => { 1206 | // --- Arrange 1207 | const source = "$x.a[0].y = 3"; 1208 | const evalContext = createEvalContext({ 1209 | localContext: getComponentStateClone({ 1210 | $x: { 1211 | a: [ 1212 | { 1213 | y: 0, 1214 | }, 1215 | ], 1216 | }, 1217 | }), 1218 | }); 1219 | const statements = parseStatements(source); 1220 | 1221 | // --- Act 1222 | try { 1223 | processStatementQueue(statements, evalContext); 1224 | } catch (err: any) { 1225 | expect(err.toString().includes("read-only")).equal(true); 1226 | return; 1227 | } 1228 | assert.fail("Exception expected"); 1229 | }); 1230 | 1231 | it("Read-only write #3", () => { 1232 | // --- Arrange 1233 | const source = "$x++"; 1234 | const evalContext = createEvalContext({ 1235 | localContext: getComponentStateClone({ 1236 | $x: 0, 1237 | }), 1238 | }); 1239 | const statements = parseStatements(source); 1240 | 1241 | // --- Act 1242 | try { 1243 | processStatementQueue(statements, evalContext); 1244 | } catch (err: any) { 1245 | expect(err.toString().includes("read-only")).equal(true); 1246 | return; 1247 | } 1248 | assert.fail("Exception expected"); 1249 | }); 1250 | 1251 | it("Read-only write #4", () => { 1252 | // --- Arrange 1253 | const source = "$x.a[0].y--"; 1254 | const evalContext = createEvalContext({ 1255 | localContext: getComponentStateClone({ 1256 | $x: { 1257 | a: [ 1258 | { 1259 | y: 0, 1260 | }, 1261 | ], 1262 | }, 1263 | }), 1264 | }); 1265 | const statements = parseStatements(source); 1266 | 1267 | // --- Act 1268 | try { 1269 | processStatementQueue(statements, evalContext); 1270 | } catch (err: any) { 1271 | expect(err.toString().includes("read-only")).equal(true); 1272 | return; 1273 | } 1274 | assert.fail("Exception expected"); 1275 | }); 1276 | 1277 | it("Read-only detects change through reference #1", () => { 1278 | // --- Arrange 1279 | const source = "let n = $x; n.a[0].y++;"; 1280 | const evalContext = createEvalContext({ 1281 | localContext: getComponentStateClone({ 1282 | $x: { 1283 | a: [ 1284 | { 1285 | y: 0, 1286 | }, 1287 | ], 1288 | }, 1289 | }), 1290 | }); 1291 | const statements = parseStatements(source); 1292 | 1293 | // --- Act 1294 | try { 1295 | processStatementQueue(statements, evalContext); 1296 | } catch (err: any) { 1297 | expect(err.toString().includes("read-only")).equal(true); 1298 | return; 1299 | } 1300 | assert.fail("Exception expected"); 1301 | }); 1302 | 1303 | it("Read-only detects change through reference #2", () => { 1304 | // --- Arrange 1305 | const source = "let n = $x; n.a[0].y += 3;"; 1306 | const evalContext = createEvalContext({ 1307 | localContext: getComponentStateClone({ 1308 | $x: { 1309 | a: [ 1310 | { 1311 | y: 0, 1312 | }, 1313 | ], 1314 | }, 1315 | }), 1316 | }); 1317 | const statements = parseStatements(source); 1318 | 1319 | // --- Act 1320 | try { 1321 | processStatementQueue(statements, evalContext); 1322 | } catch (err: any) { 1323 | expect(err.toString().includes("read-only")).equal(true); 1324 | return; 1325 | } 1326 | assert.fail("Exception expected"); 1327 | }); 1328 | 1329 | it("for..in loop with 'none' var binding - null", () => { 1330 | // --- Arrange 1331 | const source = "let y; let res =''; for (y in obj) res += obj[y]; return res"; 1332 | const evalContext = createEvalContext({ 1333 | localContext: { 1334 | obj: null, 1335 | }, 1336 | }); 1337 | const statements = parseStatements(source); 1338 | 1339 | // --- Act 1340 | processStatementQueue(statements, evalContext); 1341 | 1342 | // --- Assert 1343 | const thread = evalContext.mainThread!; 1344 | expect(thread.blocks!.length).equal(1); 1345 | expect(thread.returnValue).equal(""); 1346 | }); 1347 | 1348 | it("for..in loop with 'none' var binding - undefined", () => { 1349 | // --- Arrange 1350 | const source = "let y; let res =''; for (y in obj) res += obj[y]; return res"; 1351 | const evalContext = createEvalContext({ 1352 | localContext: { 1353 | obj: null, 1354 | }, 1355 | }); 1356 | const statements = parseStatements(source); 1357 | 1358 | // --- Act 1359 | processStatementQueue(statements, evalContext); 1360 | 1361 | // --- Assert 1362 | const thread = evalContext.mainThread!; 1363 | expect(thread.blocks!.length).equal(1); 1364 | expect(thread.returnValue).equal(""); 1365 | }); 1366 | 1367 | it("for..in loop with 'none' var binding", () => { 1368 | // --- Arrange 1369 | const source = "let y; let res =''; for (y in obj) res += obj[y]; return res"; 1370 | const evalContext = createEvalContext({ 1371 | localContext: { 1372 | obj: { one: "1", two: 2, three: 3 }, 1373 | }, 1374 | }); 1375 | const statements = parseStatements(source); 1376 | 1377 | // --- Act 1378 | processStatementQueue(statements, evalContext); 1379 | 1380 | // --- Assert 1381 | const thread = evalContext.mainThread!; 1382 | expect(thread.blocks!.length).equal(1); 1383 | expect(thread.returnValue).equal("123"); 1384 | }); 1385 | 1386 | it("for..in loop with 'none' var binding - break", () => { 1387 | // --- Arrange 1388 | const source = ` 1389 | let y; 1390 | let res =''; 1391 | for (y in obj) { 1392 | if (y === 'two') break; 1393 | res += obj[y]; 1394 | } 1395 | return res;`; 1396 | const evalContext = createEvalContext({ 1397 | localContext: { 1398 | obj: { one: "1", two: 2, three: 3 }, 1399 | }, 1400 | }); 1401 | const statements = parseStatements(source); 1402 | 1403 | // --- Act 1404 | processStatementQueue(statements, evalContext); 1405 | 1406 | // --- Assert 1407 | const thread = evalContext.mainThread!; 1408 | expect(thread.blocks!.length).equal(1); 1409 | expect(thread.returnValue).equal("1"); 1410 | }); 1411 | 1412 | it("for..in loop with 'none' var binding - continue", () => { 1413 | // --- Arrange 1414 | const source = ` 1415 | let y; 1416 | let res =''; 1417 | for (y in obj) { 1418 | if (y === 'two') continue; 1419 | res += obj[y]; 1420 | } 1421 | return res;`; 1422 | const evalContext = createEvalContext({ 1423 | localContext: { 1424 | obj: { one: "1", two: 2, three: 3 }, 1425 | }, 1426 | }); 1427 | const statements = parseStatements(source); 1428 | 1429 | // --- Act 1430 | processStatementQueue(statements, evalContext); 1431 | 1432 | // --- Assert 1433 | const thread = evalContext.mainThread!; 1434 | expect(thread.blocks!.length).equal(1); 1435 | expect(thread.returnValue).equal("13"); 1436 | }); 1437 | 1438 | it("for..in loop with 'let' var binding - null", () => { 1439 | // --- Arrange 1440 | const source = "let res =''; for (let y in obj) res += obj[y]; return res"; 1441 | const evalContext = createEvalContext({ 1442 | localContext: { 1443 | obj: null, 1444 | }, 1445 | }); 1446 | const statements = parseStatements(source); 1447 | 1448 | // --- Act 1449 | processStatementQueue(statements, evalContext); 1450 | 1451 | // --- Assert 1452 | const thread = evalContext.mainThread!; 1453 | expect(thread.blocks!.length).equal(1); 1454 | expect(thread.returnValue).equal(""); 1455 | }); 1456 | 1457 | it("for..in loop with 'let' var binding - undefined", () => { 1458 | // --- Arrange 1459 | const source = "let res =''; for (let y in obj) res += obj[y]; return res"; 1460 | const evalContext = createEvalContext({ 1461 | localContext: { 1462 | obj: null, 1463 | }, 1464 | }); 1465 | const statements = parseStatements(source); 1466 | 1467 | // --- Act 1468 | processStatementQueue(statements, evalContext); 1469 | 1470 | // --- Assert 1471 | const thread = evalContext.mainThread!; 1472 | expect(thread.blocks!.length).equal(1); 1473 | expect(thread.returnValue).equal(""); 1474 | }); 1475 | 1476 | it("for..in loop with 'let' var binding", () => { 1477 | // --- Arrange 1478 | const source = "let res =''; for (let y in obj) res += obj[y]; return res"; 1479 | const evalContext = createEvalContext({ 1480 | localContext: { 1481 | obj: { one: "1", two: 2, three: 3 }, 1482 | }, 1483 | }); 1484 | const statements = parseStatements(source); 1485 | 1486 | // --- Act 1487 | processStatementQueue(statements, evalContext); 1488 | 1489 | // --- Assert 1490 | const thread = evalContext.mainThread!; 1491 | expect(thread.blocks!.length).equal(1); 1492 | expect(thread.returnValue).equal("123"); 1493 | }); 1494 | 1495 | it("for..in loop with 'let' var binding - break", () => { 1496 | // --- Arrange 1497 | const source = ` 1498 | let res =''; 1499 | for (let y in obj) { 1500 | if (y === 'two') break; 1501 | res += obj[y]; 1502 | } 1503 | return res;`; 1504 | const evalContext = createEvalContext({ 1505 | localContext: { 1506 | obj: { one: "1", two: 2, three: 3 }, 1507 | }, 1508 | }); 1509 | const statements = parseStatements(source); 1510 | 1511 | // --- Act 1512 | processStatementQueue(statements, evalContext); 1513 | 1514 | // --- Assert 1515 | const thread = evalContext.mainThread!; 1516 | expect(thread.blocks!.length).equal(1); 1517 | expect(thread.returnValue).equal("1"); 1518 | }); 1519 | 1520 | it("for..in loop with 'let' var binding - continue", () => { 1521 | // --- Arrange 1522 | const source = ` 1523 | let res =''; 1524 | for (let y in obj) { 1525 | if (y === 'two') continue; 1526 | res += obj[y]; 1527 | } 1528 | return res;`; 1529 | const evalContext = createEvalContext({ 1530 | localContext: { 1531 | obj: { one: "1", two: 2, three: 3 }, 1532 | }, 1533 | }); 1534 | const statements = parseStatements(source); 1535 | 1536 | // --- Act 1537 | processStatementQueue(statements, evalContext); 1538 | 1539 | // --- Assert 1540 | const thread = evalContext.mainThread!; 1541 | expect(thread.blocks!.length).equal(1); 1542 | expect(thread.returnValue).equal("13"); 1543 | }); 1544 | 1545 | it("for..in loop with 'let' can write binding ", () => { 1546 | // --- Arrange 1547 | const source = ` 1548 | let res =''; 1549 | for (let y in obj) { 1550 | res += obj[y]; 1551 | y = 345; 1552 | } 1553 | return res`; 1554 | const evalContext = createEvalContext({ 1555 | localContext: { 1556 | obj: { one: "1", two: 2, three: 3 }, 1557 | }, 1558 | }); 1559 | const statements = parseStatements(source); 1560 | 1561 | // --- Act 1562 | processStatementQueue(statements, evalContext); 1563 | 1564 | // --- Assert 1565 | const thread = evalContext.mainThread!; 1566 | expect(thread.blocks!.length).equal(1); 1567 | expect(thread.returnValue).equal("123"); 1568 | }); 1569 | 1570 | it("for..in loop with 'const' var binding - null", () => { 1571 | // --- Arrange 1572 | const source = "let res =''; for (const y in obj) res += obj[y]; return res"; 1573 | const evalContext = createEvalContext({ 1574 | localContext: { 1575 | obj: null, 1576 | }, 1577 | }); 1578 | const statements = parseStatements(source); 1579 | 1580 | // --- Act 1581 | processStatementQueue(statements, evalContext); 1582 | 1583 | // --- Assert 1584 | const thread = evalContext.mainThread!; 1585 | expect(thread.blocks!.length).equal(1); 1586 | expect(thread.returnValue).equal(""); 1587 | }); 1588 | 1589 | it("for..in loop with 'const' var binding - undefined", () => { 1590 | // --- Arrange 1591 | const source = "let res =''; for (const y in obj) res += obj[y]; return res"; 1592 | const evalContext = createEvalContext({ 1593 | localContext: { 1594 | obj: null, 1595 | }, 1596 | }); 1597 | const statements = parseStatements(source); 1598 | 1599 | // --- Act 1600 | processStatementQueue(statements, evalContext); 1601 | 1602 | // --- Assert 1603 | const thread = evalContext.mainThread!; 1604 | expect(thread.blocks!.length).equal(1); 1605 | expect(thread.returnValue).equal(""); 1606 | }); 1607 | 1608 | it("for..in loop with 'const' var binding", () => { 1609 | // --- Arrange 1610 | const source = "let res =''; for (const y in obj) res += obj[y]; return res"; 1611 | const evalContext = createEvalContext({ 1612 | localContext: { 1613 | obj: { one: "1", two: 2, three: 3 }, 1614 | }, 1615 | }); 1616 | const statements = parseStatements(source); 1617 | 1618 | // --- Act 1619 | processStatementQueue(statements, evalContext); 1620 | 1621 | // --- Assert 1622 | const thread = evalContext.mainThread!; 1623 | expect(thread.blocks!.length).equal(1); 1624 | expect(thread.returnValue).equal("123"); 1625 | }); 1626 | 1627 | it("for..in loop with 'const' var binding - break", () => { 1628 | // --- Arrange 1629 | const source = ` 1630 | let res =''; 1631 | for (const y in obj) { 1632 | if (y === 'two') break; 1633 | res += obj[y]; 1634 | } 1635 | return res;`; 1636 | const evalContext = createEvalContext({ 1637 | localContext: { 1638 | obj: { one: "1", two: 2, three: 3 }, 1639 | }, 1640 | }); 1641 | const statements = parseStatements(source); 1642 | 1643 | // --- Act 1644 | processStatementQueue(statements, evalContext); 1645 | 1646 | // --- Assert 1647 | const thread = evalContext.mainThread!; 1648 | expect(thread.blocks!.length).equal(1); 1649 | expect(thread.returnValue).equal("1"); 1650 | }); 1651 | 1652 | it("for..in loop with 'const' var binding - continue", () => { 1653 | // --- Arrange 1654 | const source = ` 1655 | let res =''; 1656 | for (const y in obj) { 1657 | if (y === 'two') continue; 1658 | res += obj[y]; 1659 | } 1660 | return res;`; 1661 | const evalContext = createEvalContext({ 1662 | localContext: { 1663 | obj: { one: "1", two: 2, three: 3 }, 1664 | }, 1665 | }); 1666 | const statements = parseStatements(source); 1667 | 1668 | // --- Act 1669 | processStatementQueue(statements, evalContext); 1670 | 1671 | // --- Assert 1672 | const thread = evalContext.mainThread!; 1673 | expect(thread.blocks!.length).equal(1); 1674 | expect(thread.returnValue).equal("13"); 1675 | }); 1676 | 1677 | it("for..in loop with 'const' disallows write binding ", () => { 1678 | // --- Arrange 1679 | const source = ` 1680 | let res =''; 1681 | for (const y in obj) { 1682 | res += obj[y]; 1683 | y = 345; 1684 | } 1685 | return res`; 1686 | const evalContext = createEvalContext({ 1687 | localContext: { 1688 | obj: { one: "1", two: 2, three: 3 }, 1689 | }, 1690 | }); 1691 | const statements = parseStatements(source); 1692 | 1693 | // --- Act/Assert 1694 | try { 1695 | processStatementQueue(statements, evalContext); 1696 | } catch (err: any) { 1697 | expect(err.toString().includes("const")).equal(true); 1698 | return; 1699 | } 1700 | assert.fail("Exception expected"); 1701 | }); 1702 | 1703 | it("for..of loop with not iterable #1", () => { 1704 | // --- Arrange 1705 | const source = "for (y of obj) res += obj[y]; return res"; 1706 | const evalContext = createEvalContext({ 1707 | localContext: { 1708 | obj: null, 1709 | }, 1710 | }); 1711 | const statements = parseStatements(source); 1712 | 1713 | // --- Act/Assert 1714 | try { 1715 | processStatementQueue(statements, evalContext); 1716 | } catch (err: any) { 1717 | expect(err.toString().includes("Iterator expected")); 1718 | return; 1719 | } 1720 | assert.fail("Exception expected"); 1721 | }); 1722 | 1723 | it("for..of loop with not iterable #2", () => { 1724 | // --- Arrange 1725 | const source = "for (y of obj) res += obj[y]; return res"; 1726 | const evalContext = createEvalContext({ 1727 | localContext: { 1728 | obj: 123, 1729 | }, 1730 | }); 1731 | const statements = parseStatements(source); 1732 | 1733 | // --- Act/Assert 1734 | try { 1735 | processStatementQueue(statements, evalContext); 1736 | } catch (err: any) { 1737 | expect(err.toString().includes("Iterator expected")); 1738 | return; 1739 | } 1740 | assert.fail("Exception expected"); 1741 | }); 1742 | 1743 | it("for..of loop with 'none' var binding", () => { 1744 | // --- Arrange 1745 | const source = "let y; let res =''; for (y of obj) res += y; return res"; 1746 | const evalContext = createEvalContext({ 1747 | localContext: { 1748 | obj: [1, 2, 3], 1749 | }, 1750 | }); 1751 | const statements = parseStatements(source); 1752 | 1753 | // --- Act 1754 | processStatementQueue(statements, evalContext); 1755 | 1756 | // --- Assert 1757 | const thread = evalContext.mainThread!; 1758 | expect(thread.blocks!.length).equal(1); 1759 | expect(thread.returnValue).equal("123"); 1760 | }); 1761 | 1762 | it("for..of loop with 'none' var binding - break", () => { 1763 | // --- Arrange 1764 | const source = ` 1765 | let y; 1766 | let res =''; 1767 | for (y of obj) { 1768 | if (y === 2) break; 1769 | res += y; 1770 | } 1771 | return res;`; 1772 | const evalContext = createEvalContext({ 1773 | localContext: { 1774 | obj: [1, 2, 3], 1775 | }, 1776 | }); 1777 | const statements = parseStatements(source); 1778 | 1779 | // --- Act 1780 | processStatementQueue(statements, evalContext); 1781 | 1782 | // --- Assert 1783 | const thread = evalContext.mainThread!; 1784 | expect(thread.blocks!.length).equal(1); 1785 | expect(thread.returnValue).equal("1"); 1786 | }); 1787 | 1788 | it("for..of loop with 'none' var binding - continue", () => { 1789 | // --- Arrange 1790 | const source = ` 1791 | let y; 1792 | let res =''; 1793 | for (y of obj) { 1794 | if (y === 2) continue; 1795 | res += y; 1796 | } 1797 | return res;`; 1798 | const evalContext = createEvalContext({ 1799 | localContext: { 1800 | obj: [1, 2, 3], 1801 | }, 1802 | }); 1803 | const statements = parseStatements(source); 1804 | 1805 | // --- Act 1806 | processStatementQueue(statements, evalContext); 1807 | 1808 | // --- Assert 1809 | const thread = evalContext.mainThread!; 1810 | expect(thread.blocks!.length).equal(1); 1811 | expect(thread.returnValue).equal("13"); 1812 | }); 1813 | 1814 | it("for..of loop with 'let' var binding", () => { 1815 | // --- Arrange 1816 | const source = "let res =''; for (let y of obj) res += y; return res"; 1817 | const evalContext = createEvalContext({ 1818 | localContext: { 1819 | obj: [1, 2, 3], 1820 | }, 1821 | }); 1822 | const statements = parseStatements(source); 1823 | 1824 | // --- Act 1825 | processStatementQueue(statements, evalContext); 1826 | 1827 | // --- Assert 1828 | const thread = evalContext.mainThread!; 1829 | expect(thread.blocks!.length).equal(1); 1830 | expect(thread.returnValue).equal("123"); 1831 | }); 1832 | 1833 | it("for..of loop with 'let' var binding - break", () => { 1834 | // --- Arrange 1835 | const source = ` 1836 | let res =''; 1837 | for (let y of obj) { 1838 | if (y === 2) break; 1839 | res += y; 1840 | } 1841 | return res;`; 1842 | const evalContext = createEvalContext({ 1843 | localContext: { 1844 | obj: [1, 2, 3], 1845 | }, 1846 | }); 1847 | const statements = parseStatements(source); 1848 | 1849 | // --- Act 1850 | processStatementQueue(statements, evalContext); 1851 | 1852 | // --- Assert 1853 | const thread = evalContext.mainThread!; 1854 | expect(thread.blocks!.length).equal(1); 1855 | expect(thread.returnValue).equal("1"); 1856 | }); 1857 | 1858 | it("for..of loop with 'let' var binding - continue", () => { 1859 | // --- Arrange 1860 | const source = ` 1861 | let res =''; 1862 | for (let y of obj) { 1863 | if (y === 2) continue; 1864 | res += y; 1865 | } 1866 | return res;`; 1867 | const evalContext = createEvalContext({ 1868 | localContext: { 1869 | obj: [1, 2, 3], 1870 | }, 1871 | }); 1872 | const statements = parseStatements(source); 1873 | 1874 | // --- Act 1875 | processStatementQueue(statements, evalContext); 1876 | 1877 | // --- Assert 1878 | const thread = evalContext.mainThread!; 1879 | expect(thread.blocks!.length).equal(1); 1880 | expect(thread.returnValue).equal("13"); 1881 | }); 1882 | 1883 | it("for..of loop with 'let' can write binding ", () => { 1884 | // --- Arrange 1885 | const source = ` 1886 | let res =''; 1887 | for (let y of obj) { 1888 | res += y; 1889 | y = 345; 1890 | } 1891 | return res`; 1892 | const evalContext = createEvalContext({ 1893 | localContext: { 1894 | obj: [1, 2, 3], 1895 | }, 1896 | }); 1897 | const statements = parseStatements(source); 1898 | 1899 | // --- Act 1900 | processStatementQueue(statements, evalContext); 1901 | 1902 | // --- Assert 1903 | const thread = evalContext.mainThread!; 1904 | expect(thread.blocks!.length).equal(1); 1905 | expect(thread.returnValue).equal("123"); 1906 | }); 1907 | 1908 | it("for..of loop with 'const' var binding", () => { 1909 | // --- Arrange 1910 | const source = "let res =''; for (const y of obj) res += y; return res"; 1911 | const evalContext = createEvalContext({ 1912 | localContext: { 1913 | obj: [1, 2, 3], 1914 | }, 1915 | }); 1916 | const statements = parseStatements(source); 1917 | 1918 | // --- Act 1919 | processStatementQueue(statements, evalContext); 1920 | 1921 | // --- Assert 1922 | const thread = evalContext.mainThread!; 1923 | expect(thread.blocks!.length).equal(1); 1924 | expect(thread.returnValue).equal("123"); 1925 | }); 1926 | 1927 | it("for..of loop with 'const' var binding - break", () => { 1928 | // --- Arrange 1929 | const source = ` 1930 | let res =''; 1931 | for (const y of obj) { 1932 | if (y === 2) break; 1933 | res += y; 1934 | } 1935 | return res;`; 1936 | const evalContext = createEvalContext({ 1937 | localContext: { 1938 | obj: [1, 2, 3], 1939 | }, 1940 | }); 1941 | const statements = parseStatements(source); 1942 | 1943 | // --- Act 1944 | processStatementQueue(statements, evalContext); 1945 | 1946 | // --- Assert 1947 | const thread = evalContext.mainThread!; 1948 | expect(thread.blocks!.length).equal(1); 1949 | expect(thread.returnValue).equal("1"); 1950 | }); 1951 | 1952 | it("for..of loop with 'const' var binding - continue", () => { 1953 | // --- Arrange 1954 | const source = ` 1955 | let res =''; 1956 | for (const y of obj) { 1957 | if (y === 2) continue; 1958 | res += y; 1959 | } 1960 | return res;`; 1961 | const evalContext = createEvalContext({ 1962 | localContext: { 1963 | obj: [1, 2, 3], 1964 | }, 1965 | }); 1966 | const statements = parseStatements(source); 1967 | 1968 | // --- Act 1969 | processStatementQueue(statements, evalContext); 1970 | 1971 | // --- Assert 1972 | const thread = evalContext.mainThread!; 1973 | expect(thread.blocks!.length).equal(1); 1974 | expect(thread.returnValue).equal("13"); 1975 | }); 1976 | 1977 | it("for..of loop with 'const' disallows write binding ", () => { 1978 | // --- Arrange 1979 | const source = ` 1980 | let res =''; 1981 | for (const y of obj) { 1982 | res += y; 1983 | y = 345; 1984 | } 1985 | return res`; 1986 | const evalContext = createEvalContext({ 1987 | localContext: { 1988 | obj: [1, 2, 3], 1989 | }, 1990 | }); 1991 | const statements = parseStatements(source); 1992 | 1993 | // --- Act/Assert 1994 | try { 1995 | processStatementQueue(statements, evalContext); 1996 | } catch (err: any) { 1997 | expect(err.toString().includes("const")).equal(true); 1998 | return; 1999 | } 2000 | assert.fail("Exception expected"); 2001 | }); 2002 | }); 2003 | 2004 | function getComponentStateClone(orig: any): any { 2005 | const poj = structuredClone(orig); 2006 | return buildProxy(poj, (changeInfo) => { 2007 | const idRoot = changeInfo.pathArray?.[0]; 2008 | if (idRoot?.toString()?.startsWith("$")) { 2009 | throw new Error("Cannot update a read-only variable"); 2010 | } 2011 | }); 2012 | } 2013 | ```