buninu-browser 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -0
- package/Architecture.md +601 -0
- package/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/LICENSES/BSD-3-Clause-Skia.txt +29 -0
- package/LICENSES/Bitstream-Vera.txt +44 -0
- package/LICENSES/CC-BY-4.0.txt +396 -0
- package/LICENSES/OFL-1.1.txt +91 -0
- package/LICENSES/README.md +9 -0
- package/LICENSES/acorn.txt +21 -0
- package/LICENSES/chromium.txt +27 -0
- package/LICENSES/dropflow.txt +19 -0
- package/LICENSES/emscripten.txt +102 -0
- package/LICENSES/freetype.txt +169 -0
- package/LICENSES/happy-dom.txt +22 -0
- package/LICENSES/harfbuzz.txt +42 -0
- package/LICENSES/icu.txt +512 -0
- package/LICENSES/libjpeg-ijg.txt +260 -0
- package/LICENSES/libjpeg-turbo.txt +147 -0
- package/LICENSES/libpng.txt +134 -0
- package/LICENSES/libwebp.txt +30 -0
- package/LICENSES/ses-aura.txt +16 -0
- package/LICENSES/ses-caja.txt +13 -0
- package/LICENSES/ses-corejs.txt +19 -0
- package/LICENSES/ses-v8.txt +9 -0
- package/LICENSES/ses.txt +201 -0
- package/LICENSES/termdom.txt +21 -0
- package/LICENSES/wasmpeg.txt +501 -0
- package/LICENSES/woff2.txt +19 -0
- package/LICENSES/wuffs.txt +211 -0
- package/LICENSES/zlib.txt +22 -0
- package/Linux +0 -0
- package/PORTING.md +825 -0
- package/README.md +283 -0
- package/THIRD_PARTY_NOTICES.md +224 -0
- package/bunfig.toml +2 -0
- package/buninu-browser.js +65 -0
- package/index.js +149 -0
- package/lib/cdp-server.js +1424 -0
- package/lib/cdp.js +203 -0
- package/lib/happy-dom/entities-adapter.js +51 -0
- package/lib/happy-dom/image-size-adapter.js +8 -0
- package/lib/happy-dom/mime-type-adapter.js +27 -0
- package/lib/happy-dom/parser.js +53 -0
- package/lib/happy-dom/websocket-adapter.js +62 -0
- package/lib/headless-shell.js +362 -0
- package/lib/input/hit-test.js +78 -0
- package/lib/layout/scroll-viewport.js +53 -0
- package/lib/layout/text-layout.js +2236 -0
- package/lib/log.js +85 -0
- package/lib/network/cookie-jar.js +178 -0
- package/lib/network/network-service.js +268 -0
- package/lib/network/resolver.js +97 -0
- package/lib/paint/display-list.js +359 -0
- package/lib/paint/frame.js +88 -0
- package/lib/paint/gradient.js +207 -0
- package/lib/render-tree/index.js +263 -0
- package/lib/render-tree/svg.js +210 -0
- package/lib/renderer/bindings.js +1291 -0
- package/lib/renderer/compositor.js +123 -0
- package/lib/renderer/flags.js +20 -0
- package/lib/renderer/host.js +503 -0
- package/lib/renderer/main.js +234 -0
- package/lib/renderer/module-transform.js +399 -0
- package/lib/renderer/page-realm.js +1471 -0
- package/lib/renderer/page-renderer.js +1691 -0
- package/lib/renderer/script-rewrite.js +232 -0
- package/lib/renderer/seccomp.js +215 -0
- package/lib/renderer/syscall-numbers.js +139 -0
- package/lib/style/computed-style.js +2053 -0
- package/package.json +39 -0
- package/patches/happy-dom/0001-use-bun-entity-adapter.patch +15 -0
- package/patches/happy-dom/0002-use-bun-platform-adapters.patch +69 -0
- package/patches/happy-dom/README.md +38 -0
- package/test/chromium-headless-shell +5 -0
- package/test/compositor.test.js +154 -0
- package/test/computed-style.test.js +434 -0
- package/test/display-list.test.js +128 -0
- package/test/entities-adapter.test.js +43 -0
- package/test/fixtures/fake-renderer.js +26 -0
- package/test/fixtures/seccomp-child.js +32 -0
- package/test/fixtures/video.mp4 +0 -0
- package/test/flex.test.js +150 -0
- package/test/gradient.test.js +56 -0
- package/test/grid.test.js +253 -0
- package/test/happy-dom-platform-adapters.test.js +18 -0
- package/test/headless-shell.test.js +318 -0
- package/test/hit-test.test.js +49 -0
- package/test/html-parser.test.js +40 -0
- package/test/index.test.js +29 -0
- package/test/log.test.js +40 -0
- package/test/mobile.test.js +85 -0
- package/test/network-service.test.js +214 -0
- package/test/page-scripts.test.js +552 -0
- package/test/poc-backend.js +189 -0
- package/test/poc-backend.test.js +154 -0
- package/test/positioning.test.js +112 -0
- package/test/render-tree.test.js +103 -0
- package/test/renderer-host.test.js +69 -0
- package/test/resolver.test.js +51 -0
- package/test/script-rewrite.test.js +31 -0
- package/test/scroll-viewport.test.js +25 -0
- package/test/seccomp.test.js +71 -0
- package/test/site-isolation.test.js +74 -0
- package/test/svg.test.js +61 -0
- package/test/text-layout.test.js +419 -0
- package/usr/README.md +20 -0
- package/usr/lib/canvaskit/LICENSE +29 -0
- package/usr/lib/canvaskit/canvaskit.js +264 -0
- package/usr/lib/canvaskit/canvaskit.wasm +0 -0
- package/usr/share/fonts/DejaVuSansMono-Bold.ttf +0 -0
- package/usr/share/fonts/DejaVuSansMono.ttf +0 -0
- package/usr/share/fonts/LICENSE-Apache-2.0.txt +202 -0
- package/usr/share/fonts/LICENSE-DejaVu.txt +44 -0
- package/usr/share/fonts/LICENSE-OFL-1.1.txt +91 -0
- package/usr/share/fonts/NotoColorEmoji.ttf +0 -0
- package/usr/share/fonts/NotoColorEmojiFlags.ttf +0 -0
- package/usr/share/fonts/NotoSansCJK-Regular.ttc +0 -0
- package/usr/share/fonts/NotoSansSymbols-Regular-Subsetted.ttf +0 -0
- package/usr/share/fonts/NotoSansSymbols-Regular-Subsetted2.ttf +0 -0
- package/usr/share/fonts/Roboto-Regular.ttf +0 -0
- package/usr/share/fonts/fonts.json +28 -0
- package/vendor/acorn/LICENSE +21 -0
- package/vendor/acorn/README.md +309 -0
- package/vendor/acorn/dist/acorn.mjs +6313 -0
- package/vendor/acorn/package.json +50 -0
- package/vendor/happy-dom/.editorconfig +8 -0
- package/vendor/happy-dom/.eslintignore +6 -0
- package/vendor/happy-dom/.eslintrc.cjs +188 -0
- package/vendor/happy-dom/.github/CODEOWNERS +2 -0
- package/vendor/happy-dom/.github/FUNDING.yml +1 -0
- package/vendor/happy-dom/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- package/vendor/happy-dom/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/vendor/happy-dom/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- package/vendor/happy-dom/.github/PULL_REQUEST_TEMPLATE.md +27 -0
- package/vendor/happy-dom/.github/workflows/auto-assign.yml +23 -0
- package/vendor/happy-dom/.github/workflows/pull_request.yml +53 -0
- package/vendor/happy-dom/.github/workflows/release.yml +143 -0
- package/vendor/happy-dom/.husky/pre-commit +1 -0
- package/vendor/happy-dom/.prettierignore +1 -0
- package/vendor/happy-dom/.prettierrc.cjs +6 -0
- package/vendor/happy-dom/.vscode/extensions.json +3 -0
- package/vendor/happy-dom/CODE_OF_CONDUCT.md +128 -0
- package/vendor/happy-dom/CONTRIBUTING.md +147 -0
- package/vendor/happy-dom/LICENSE +21 -0
- package/vendor/happy-dom/README.md +62 -0
- package/vendor/happy-dom/SECURITY.md +12 -0
- package/vendor/happy-dom/cspell.json +34 -0
- package/vendor/happy-dom/docs/happy-dom-logo.jpg +0 -0
- package/vendor/happy-dom/integration-test/.editorconfig +8 -0
- package/vendor/happy-dom/integration-test/LICENSE +21 -0
- package/vendor/happy-dom/integration-test/README.md +1 -0
- package/vendor/happy-dom/integration-test/package.json +24 -0
- package/vendor/happy-dom/package-lock.json +15520 -0
- package/vendor/happy-dom/package.json +55 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/LICENSE +21 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/README.md +60 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/package.json +52 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/register.js +2 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/src/GlobalRegistrator.ts +121 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/src/index.ts +3 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/tsconfig.json +30 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/LICENSE +21 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/README.md +71 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/package.json +93 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/src/index.ts +192 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/tsconfig.json +30 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/README.md +48 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/package.json +41 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/src/CanvasAdapter.ts +275 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/src/index.ts +1 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/LICENSE +21 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/README.md +100 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/bin/src/happy-dom-sr.ts +30 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/package.json +62 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRenderer.ts +368 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererBrowser.ts +142 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererBrowserWorker.ts +29 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererPage.ts +305 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererPageWorker.ts +55 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererServer.ts +332 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/config/DefaultServerRendererConfiguration.ts +47 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/enums/ServerRendererLogLevelEnum.ts +9 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/enums/ServerRendererModeEnum.ts +8 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/index.ts +19 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IOptionalServerRendererConfiguration.ts +127 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererConfiguration.ts +126 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererItem.ts +6 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererResult.ts +11 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/BrowserWindowPolyfill.ts +138 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/HelpPrinter.ts +36 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/HelpPrinterRows.ts +288 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/PackageVersion.ts +12 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/ProcessArgumentsParser.ts +387 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/ServerRendererConfigurationFactory.ts +91 -0
- package/vendor/happy-dom/packages/happy-dom/LICENSE +21 -0
- package/vendor/happy-dom/packages/happy-dom/README.md +42 -0
- package/vendor/happy-dom/packages/happy-dom/package.json +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/PropertySymbol.ts +431 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/Animation.ts +273 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/AnimationTimeline.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/DocumentTimeline.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/KeyframeEffect.ts +295 -0
- package/vendor/happy-dom/packages/happy-dom/src/async-task-manager/AsyncTaskManager.ts +340 -0
- package/vendor/happy-dom/packages/happy-dom/src/async-task-manager/AsyncTaskManagerDebugError.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/base64/Base64.ts +97 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/Browser.ts +123 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserContext.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserFrame.ts +232 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserPage.ts +205 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserSettingsFactory.ts +96 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/DefaultBrowserSettings.ts +67 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowser.ts +129 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserContext.ts +103 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserFrame.ts +250 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserPage.ts +218 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/enums/BrowserErrorCaptureEnum.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/enums/BrowserNavigationCrossOriginPolicyEnum.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowser.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserContext.ts +44 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserFrame.ts +112 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserPage.ts +110 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserPageViewport.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserSettings.ts +194 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IGoToOptions.ts +17 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IOptionalBrowserPageViewport.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IOptionalBrowserSettings.ts +190 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IReloadOptions.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserExceptionObserver.ts +123 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameFactory.ts +106 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameNavigator.ts +574 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameScriptEvaluator.ts +71 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameURL.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameValidator.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserPageUtility.ts +56 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasAdapter.ts +63 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasAdapterCaller.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasGradient.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasPattern.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasRenderingContext2D.ts +162 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasShape.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/IImageBitmapOptions.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ITextMetrics.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ImageBitmap.ts +162 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ImageData.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/OffscreenCanvas.ts +162 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/TCanvasImage.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/TImageBitmapSource.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/clipboard/Clipboard.ts +108 -0
- package/vendor/happy-dom/packages/happy-dom/src/clipboard/ClipboardItem.ts +57 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/HTMLElementConfig.ts +536 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/HTMLElementConfigContentModelEnum.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/IHTMLElementTagNameMap.ts +181 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/ISVGElementTagNameMap.ts +127 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/NamespaceURI.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/SVGElementConfig.ts +70 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IConsole.ts +161 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsoleLogEntry.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsoleLogGroup.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsolePrinter.ts +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/VirtualConsole.ts +363 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/VirtualConsolePrinter.ts +148 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/enums/VirtualConsoleLogLevelEnum.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/enums/VirtualConsoleLogTypeEnum.ts +29 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/utilities/VirtualConsoleLogEntryStringifier.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/CookieContainer.ts +91 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/DefaultCookie.ts +17 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/ICookie.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/ICookieContainer.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/IOptionalCookie.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/enums/CookieSameSiteEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieExpireUtility.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieStringUtility.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieURLUtility.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/CookieStore.ts +226 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreDeleteOptions.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreGetOptions.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreItem.ts +13 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreSetOptions.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSS.ts +63 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSRule.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSRuleTypeEnum.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSStyleSheet.ts +141 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSUnitValue.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSUnits.ts +31 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/MediaList.ts +177 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/CSSPropertyList.ts +1273 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/CSSStyleDeclaration.ts +355 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/ICSSStyleDeclaration.ts +1178 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/CSSComputedStyle.ts +502 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleElementDefault.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleInheritedProperties.ts +39 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleMeasurementProperties.ts +41 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/CSSPropertyManager.ts +641 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/parsers/CSSPropertyGetParser.ts +741 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/parsers/CSSPropertySetParser.ts +2955 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/types/ICSSPropertyMap.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/types/ICSSPropertyValue.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSStringUtility.ts +90 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSValueFormatter.ts +447 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSVariableFormatter.ts +76 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/utilities/CSSMeasurementConverter.ts +79 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/utilities/CSSTextParser.ts +44 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSConditionRule.ts +20 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSContainerRule.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSFontFaceRule.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSGroupingRule.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSKeyframeRule.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSKeyframesRule.ts +147 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSMediaRule.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSScopeRule.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSStyleRule.ts +73 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSSupportsRule.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/CSSKeywordValue.ts +35 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/CSSStyleValue.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/StylePropertyMap.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/StylePropertyMapReadOnly.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/utilities/CSSEscaper.ts +87 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/utilities/CSSRuleParser.ts +315 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementReactionStack.ts +91 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementRegistry.ts +186 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementUtility.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/ICustomElementDefinition.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMPoint.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMPointReadOnly.ts +117 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRect.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRectList.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRectReadOnly.ts +129 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMStringMap.ts +93 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMStringMapUtility.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMTokenList.ts +363 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/IDOMPointInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/IDOMRectInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/DOMMatrix.ts +526 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/DOMMatrixReadOnly.ts +1608 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/IDOMMatrixCompatibleObject.ts +24 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/IDOMMatrixJSON.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrix2DArray.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrix3DArray.ts +20 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrixInit.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom-implementation/DOMImplementation.ts +81 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom-parser/DOMParser.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/DataTransfer.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/DataTransferItem.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/DataTransferItemList.ts +44 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/Event.ts +222 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/EventPhaseEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/EventTarget.ts +396 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/IEventInit.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/IEventListenerOptions.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/ITouchInit.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/IUIEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/MessagePort.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/TEventListener.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/TEventListenerFunction.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/TEventListenerObject.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/Touch.ts +40 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/UIEvent.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/AnimationEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ClipboardEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/CloseEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/CookieChangeEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/CustomEvent.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ErrorEvent.ts +29 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/FocusEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/HashChangeEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IAnimationEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IClipboardEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ICloseEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ICookieChangeEventInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ICustomEventInit.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IErrorEventInit.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IFocusEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IHashChangeEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IInputEventInit.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IKeyboardEventInit.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMediaQueryListEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMediaQueryListInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMessageEventInit.ts +11 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMouseEventInit.ts +21 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IPointerEventInit.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IPopStateEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IProgressEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IStorageEventInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ISubmitEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ITouchEventInit.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IWheelEventInit.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/InputEvent.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/KeyboardEvent.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MediaQueryListEvent.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MediaStreamTrackEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MessageEvent.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MouseEvent.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/PointerEvent.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/PopStateEvent.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ProgressEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/StorageEvent.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/SubmitEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/TouchEvent.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/WheelEvent.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/exception/DOMException.ts +21 -0
- package/vendor/happy-dom/packages/happy-dom/src/exception/DOMExceptionNameEnum.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/AbortController.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/AbortSignal.ts +182 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Fetch.ts +1072 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Headers.ts +177 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/ReadableStreamWrapper.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Request.ts +492 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/ResourceFetch.ts +190 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Response.ts +439 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/SyncFetch.ts +717 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICacheablePreflightRequest.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICacheablePreflightResponse.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICachedPreflightResponse.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/IPreflightResponseCache.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/PreflightResponseCache.ts +94 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/CachedResponseStateEnum.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICacheableRequest.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICacheableResponse.ts +11 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICachedResponse.ts +40 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/IResponseCache.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/IResponseCacheFileSystem.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ResponseCache.ts +248 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ResponseCacheFileSystem.ts +175 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/certificate/FetchHTTPSCertificate.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/data-uri/DataURIParser.ts +66 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/multipart/MultipartFormDataParser.ts +174 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/multipart/MultipartReader.ts +216 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/preload/PreloadEntry.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/preload/PreloadUtility.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IFetchInterceptor.ts +60 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IFetchRequestHeaders.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IRequestInit.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IResourceFetchResponse.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IResponseInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/ISyncResponse.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IVirtualServer.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/THeadersInit.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestBody.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestCredentials.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestInfo.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestMode.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestRedirect.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestReferrerPolicy.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TResponseBody.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchBodyUtility.ts +284 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchCORSUtility.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestHeaderUtility.ts +141 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestReferrerUtility.ts +259 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestValidationUtility.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchResponseHeaderUtility.ts +48 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchResponseRedirectUtility.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/SyncFetchScriptBuilder.ts +77 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/VirtualServerUtility.ts +114 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/Blob.ts +163 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/File.ts +43 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReader.ts +211 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderEventTypeEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderFormatEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderReadyStateEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/form-data/FormData.ts +291 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/History.ts +220 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/HistoryItemList.ts +72 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/HistoryScrollRestorationEnum.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/IHistoryItem.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/html-parser/HTMLParser.ts +920 -0
- package/vendor/happy-dom/packages/happy-dom/src/html-serializer/HTMLSerializer.ts +172 -0
- package/vendor/happy-dom/packages/happy-dom/src/index.ts +495 -0
- package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IIntersectionObserverInit.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IntersectionObserver.ts +64 -0
- package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IntersectionObserverEntry.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/javascript/IJavaScriptCompiledResult.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/javascript/JavaScriptCompiler.ts +381 -0
- package/vendor/happy-dom/packages/happy-dom/src/location/Location.ts +319 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/IMediaQueryRange.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/IMediaQueryRule.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryItem.ts +354 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryList.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryParser.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryTypeEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/CSSModule.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ECMAScriptModule.ts +194 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts +961 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/JSONModule.ts +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ModuleFactory.ts +148 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ModuleURLUtility.ts +199 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/UnresolvedModule.ts +81 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/enums/ECMAScriptModuleEvaluateStateEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleCachedResult.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleCompiledResult.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleImport.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModule.ts +20 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMap.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMapRule.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMapScope.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleInit.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IResolveNodeModules.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/IMutationListener.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/IMutationObserverInit.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationObserver.ts +175 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationObserverListener.ts +115 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationRecord.ts +55 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationTypeEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/MimeType.ts +35 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/MimeTypeArray.ts +48 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/Navigator.ts +247 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/Plugin.ts +61 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/PluginArray.ts +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/NodeFactory.ts +38 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/attr/Attr.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/character-data/CharacterData.ts +218 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/character-data/CharacterDataUtility.ts +68 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/ChildNodeUtility.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/IChildNode.ts +29 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/INonDocumentTypeChildNode.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/NonDocumentChildNodeUtility.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/comment/Comment.ts +36 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/Document.ts +2310 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/DocumentReadyStateEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/DocumentReadyStateManager.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/VisibilityStateEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document-fragment/DocumentFragment.ts +208 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document-type/DocumentType.ts +70 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/Element.ts +1842 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/ElementEventAttributeUtility.ts +96 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/HTMLCollection.ts +228 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/NamedNodeMap.ts +274 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/NamedNodeMapProxyFactory.ts +127 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/THTMLCollectionListener.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/TNamedNodeMapListener.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-anchor-element/HTMLAnchorElement.ts +439 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-area-element/HTMLAreaElement.ts +426 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-audio-element/Audio.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-audio-element/HTMLAudioElement.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-base-element/HTMLBaseElement.ts +64 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-body-element/HTMLBodyElement.ts +161 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-br-element/HTMLBRElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts +406 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-canvas-element/CanvasCaptureMediaStreamTrack.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-canvas-element/HTMLCanvasElement.ts +304 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-d-list-element/HTMLDListElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-data-element/HTMLDataElement.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-data-list-element/HTMLDataListElement.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-details-element/HTMLDetailsElement.ts +112 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-dialog-element/HTMLDialogElement.ts +104 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-div-element/HTMLDivElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-document/HTMLDocument.ts +82 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-element/HTMLElement.ts +1149 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-element/HTMLElementUtility.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-embed-element/HTMLEmbedElement.ts +90 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-field-set-element/HTMLFieldSetElement.ts +165 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/HTMLFormControlsCollection.ts +35 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/HTMLFormElement.ts +675 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/RadioNodeList.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/THTMLFormControlElement.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-head-element/HTMLHeadElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-heading-element/HTMLHeadingElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hr-element/HTMLHRElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-html-element/HTMLHtmlElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hyperlink-element/HTMLHyperlinkElementUtility.ts +329 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hyperlink-element/IHTMLHyperlinkElement.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-iframe-element/HTMLIFrameElement.ts +460 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-image-element/HTMLImageElement.ts +500 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-image-element/Image.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/FileList.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts +1550 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementDateUtility.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementSelectionDirectionEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementSelectionModeEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementValueSanitizer.ts +211 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementValueStepping.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-label-element/HTMLLabelElement.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-label-element/HTMLLabelElementUtility.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-legend-element/HTMLLegendElement.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-li-element/HTMLLIElement.ts +31 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-link-element/HTMLLinkElement.ts +501 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-map-element/HTMLMapElement.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/HTMLMediaElement.ts +906 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/IMediaTrackCapabilities.ts +21 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/IMediaTrackSettings.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/MediaStream.ts +114 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/MediaStreamTrack.ts +182 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/RemotePlayback.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrack.ts +156 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackCue.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackCueList.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackKindEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackList.ts +182 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TimeRanges.ts +73 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/VTTCue.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/VTTRegion.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-menu-element/HTMLMenuElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-meta-element/HTMLMetaElement.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-meter-element/HTMLMeterElement.ts +216 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-mod-element/HTMLModElement.ts +54 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-o-list-element/HTMLOListElement.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-object-element/HTMLObjectElement.ts +223 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-opt-group-element/HTMLOptGroupElement.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-option-element/HTMLOptionElement.ts +192 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-output-element/HTMLOutputElement.ts +179 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-paragraph-element/HTMLParagraphElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-param-element/HTMLParamElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-picture-element/HTMLPictureElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-pre-element/HTMLPreElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-progress-element/HTMLProgressElement.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-quote-element/HTMLQuoteElement.ts +36 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts +735 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-select-element/HTMLOptionsCollection.ts +69 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-select-element/HTMLSelectElement.ts +779 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-slot-element/HTMLSlotElement.ts +249 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-source-element/HTMLSourceElement.ts +148 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-span-element/HTMLSpanElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-style-element/HTMLStyleElement.ts +125 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-caption-element/HTMLTableCaptionElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-cell-element/HTMLTableCellElement.ts +125 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-col-element/HTMLTableColElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-element/HTMLTableElement.ts +343 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-row-element/HTMLTableRowElement.ts +149 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-section-element/HTMLTableSectionElement.ts +88 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-template-element/HTMLTemplateElement.ts +154 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +649 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-time-element/HTMLTimeElement.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-title-element/HTMLTitleElement.ts +48 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-track-element/HTMLTrackElement.ts +164 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-u-list-element/HTMLUListElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-unknown-element/HTMLUnknownElement.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-video-element/HTMLVideoElement.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedComputedStyleResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementByIdResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementByTagNameResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementsByTagNameResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedMatchesResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedQuerySelectorAllResult.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedQuerySelectorResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedResult.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedStyleResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/Node.ts +1373 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeDocumentPositionEnum.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeList.ts +224 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeTypeEnum.ts +13 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeUtility.ts +330 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/TNodeListListener.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/parent-node/IParentNode.ts +109 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/parent-node/ParentNodeUtility.ts +334 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/processing-instruction/ProcessingInstruction.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/shadow-root/ShadowRoot.ts +290 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-element/SVGAnimateElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-motion-element/SVGAnimateMotionElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-transform-element/SVGAnimateTransformElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animation-element/SVGAnimationElement.ts +94 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-circle-element/SVGCircleElement.ts +72 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-clip-path-element/SVGClipPathElement.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-component-transfer-function-element/SVGComponentTransferFunctionElement.ts +167 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-defs-element/SVGDefsElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-desc-element/SVGDescElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-element/SVGElement.ts +828 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-ellipse-element/SVGEllipseElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-blend-element/SVGFEBlendElement.ts +192 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-color-matrix-element/SVGFEColorMatrixElement.ts +204 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-component-transfer-element/SVGFEComponentTransferElement.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-composite-element/SVGFECompositeElement.ts +186 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-convolve-matrix-element/SVGFEConvolveMatrixElement.ts +366 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-diffuse-lighting-element/SVGFEDiffuseLightingElement.ts +214 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-displacement-map-element/SVGFEDisplacementMapElement.ts +226 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-distant-light-element/SVGFEDistantLightElement.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-drop-shadow-element/SVGFEDropShadowElement.ts +227 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-flood-element/SVGFEFloodElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-a-element/SVGFEFuncAElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-b-element/SVGFEFuncBElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-g-element/SVGFEFuncGElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-r-element/SVGFEFuncRElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-gaussian-blur-element/SVGFEGaussianBlurElement.ts +214 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-image-element/SVGFEImageElement.ts +173 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-merge-element/SVGFEMergeElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-merge-node-element/SVGFEMergeNodeElement.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-morphology-element/SVGFEMorphologyElement.ts +202 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-offset-element/SVGFEOffsetElement.ts +174 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-point-light-element/SVGFEPointLightElement.ts +72 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-specular-lighting-element/SVGFESpecularLightingElement.ts +237 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-spot-light-element/SVGFESpotLightElement.ts +173 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-tile-element/SVGFETileElement.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-turbulence-element/SVGFETurbulenceElement.ts +249 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-filter-element/SVGFilterElement.ts +158 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-foreign-object-element/SVGForeignObjectElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-g-element/SVGGElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-geometry-element/SVGGeometryElement.ts +94 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-gradient-element/SVGGradientElement.ts +104 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-graphics-element/SVGGraphicsElement.ts +134 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-image-element/SVGImageElement.ts +188 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-line-element/SVGLineElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-linear-gradient-element/SVGLinearGradientElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-m-path-element/SVGMPathElement.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-marker-element/SVGMarkerElement.ts +230 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-mask-element/SVGMaskElement.ts +137 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-metadata-element/SVGMetadataElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-path-element/SVGPathElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-pattern-element/SVGPatternElement.ts +179 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-polygon-element/SVGPolygonElement.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-polyline-element/SVGPolylineElement.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-radial-gradient-element/SVGRadialGradientElement.ts +112 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-rect-element/SVGRectElement.ts +132 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-script-element/SVGScriptElement.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-set-element/SVGSetElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-stop-element/SVGStopElement.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-style-element/SVGStyleElement.ts +143 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-svg-element/SVGSVGElement.ts +601 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-switch-element/SVGSwitchElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-symbol-element/SVGSymbolElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-t-span-element/SVGTSpanElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-content-element/SVGTextContentElement.ts +143 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-element/SVGTextElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-path-element/SVGTextPathElement.ts +106 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-positioning-element/SVGTextPositioningElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-title-element/SVGTitleElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-use-element/SVGUseElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-view-element/SVGViewElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/text/Text.ts +154 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/xml-document/XMLDocument.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/permissions/PermissionNameEnum.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/permissions/PermissionStatus.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/permissions/Permissions.ts +59 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorAttribute.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorMatch.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorPseudo.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/QuerySelector.ts +849 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorCombinatorEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorItem.ts +575 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorParser.ts +699 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/TGlobalMatchFunction.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/IRangeBoundaryPoint.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/Range.ts +1161 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/RangeHowEnum.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/RangeUtility.ts +118 -0
- package/vendor/happy-dom/packages/happy-dom/src/resize-observer/ResizeObserver.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/screen/Screen.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/screen/ScreenDetailed.ts +17 -0
- package/vendor/happy-dom/packages/happy-dom/src/screen/ScreenDetails.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/selection/Selection.ts +556 -0
- package/vendor/happy-dom/packages/happy-dom/src/selection/SelectionDirectionEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/storage/Storage.ts +149 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAngle.ts +310 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAngleTypeEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedAngle.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedBoolean.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedEnumeration.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedInteger.ts +97 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedLength.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedLengthList.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedNumber.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedNumberList.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedPreserveAspectRatio.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedRect.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedString.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedTransformList.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLength.ts +375 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLengthList.ts +489 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLengthTypeEnum.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGMatrix.ts +429 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGNumber.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGNumberList.ts +522 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPoint.ts +114 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPointList.ts +526 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatio.ts +176 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatioAlignEnum.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatioMeetOrSliceEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGRect.ts +200 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGStringList.ts +422 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransform.ts +369 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransformList.ts +531 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransformTypeEnum.ts +11 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGUnitTypes.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeFilter.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeFilterMask.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeIterator.ts +85 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/TNodeFilter.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/TreeWalker.ts +339 -0
- package/vendor/happy-dom/packages/happy-dom/src/url/URL.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/AttributeUtility.ts +43 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/ClassMethodBinder.ts +71 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/StringUtility.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/XMLEncodeUtility.ts +166 -0
- package/vendor/happy-dom/packages/happy-dom/src/validity-state/ValidityState.ts +234 -0
- package/vendor/happy-dom/packages/happy-dom/src/version.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/web-socket/WebSocket.ts +408 -0
- package/vendor/happy-dom/packages/happy-dom/src/web-socket/WebSocketReadyStateEnum.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/BrowserWindow.ts +3074 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/CrossOriginBrowserWindow.ts +152 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/DetachedWindowAPI.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/GlobalWindow.ts +90 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/INodeJSGlobal.ts +76 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/IOptionalTimerLoopsLimit.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/IScrollToOptions.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/ITimerLoopsLimit.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/VMGlobalPropertyScript.ts +59 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/Window.ts +67 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/WindowBrowserContext.ts +117 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/WindowContextClassExtender.ts +288 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/WindowPageOpenUtility.ts +200 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequest.ts +577 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestEventTarget.ts +88 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestReadyStateEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestResponseDataParser.ts +70 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestUpload.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpResponseTypeEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-parser/XMLParser.ts +744 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-serializer/XMLSerializer.ts +280 -0
- package/vendor/happy-dom/turbo.json +52 -0
- package/vendor/ses/LICENSE +201 -0
- package/vendor/ses/LICENSE-aura +16 -0
- package/vendor/ses/LICENSE-caja +13 -0
- package/vendor/ses/LICENSE-corejs +19 -0
- package/vendor/ses/LICENSE-v8 +9 -0
- package/vendor/ses/README.md +968 -0
- package/vendor/ses/dist/ses.mjs +15219 -0
- package/vendor/ses/package.json +142 -0
- package/vendor/wasmpeg/LICENSE +501 -0
- package/vendor/wasmpeg/NOTICE +30 -0
- package/vendor/wasmpeg/VENDORING.md +35 -0
- package/vendor/wasmpeg/dist/cpu.js +2 -0
- package/vendor/wasmpeg/dist/cpu.wasm +0 -0
- package/vendor/wasmpeg/package.json +45 -0
- package/vendor/wasmpeg/source-v1.0.1.tar.gz +0 -0
- package/vendor/wasmpeg/src/js/exec.mjs +478 -0
- package/vendor/wasmpeg/src/js/ffmpeg.js +94 -0
- package/vendor/wasmpeg/src/js/formats.js +84 -0
- package/vendor/wasmpeg/src/js/gpu.js +480 -0
- package/vendor/wasmpeg/src/js/index.d.ts +154 -0
- package/vendor/wasmpeg/src/js/index.js +7 -0
- package/vendor/wasmpeg/src/js/wasmpeg.mjs +221 -0
|
@@ -0,0 +1,961 @@
|
|
|
1
|
+
import BrowserErrorCaptureEnum from '../browser/enums/BrowserErrorCaptureEnum.js';
|
|
2
|
+
import type BrowserWindow from '../window/BrowserWindow.js';
|
|
3
|
+
import WindowBrowserContext from '../window/WindowBrowserContext.js';
|
|
4
|
+
import type IECMAScriptModuleCompiledResult from './types/IECMAScriptModuleCompiledResult.js';
|
|
5
|
+
import type IECMAScriptModuleImport from './types/IECMAScriptModuleImport.js';
|
|
6
|
+
import ModuleURLUtility from './ModuleURLUtility.js';
|
|
7
|
+
import * as PropertySymbol from '../PropertySymbol.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Statement regexp.
|
|
11
|
+
*
|
|
12
|
+
* Group 1: Import meta.
|
|
13
|
+
* Group 2: Import without exported properties.
|
|
14
|
+
* Group 3: Dynamic import function call.
|
|
15
|
+
* Group 4: Import exported variables.
|
|
16
|
+
* Group 5: Import exported url.
|
|
17
|
+
* Group 6: Import with group.
|
|
18
|
+
* Group 7: Import with type.
|
|
19
|
+
* Group 8: Import spacing.
|
|
20
|
+
* Group 9: Modules in export from module statement.
|
|
21
|
+
* Group 10: Import in export from module statement.
|
|
22
|
+
* Group 11: Export default indicator.
|
|
23
|
+
* Group 12: Export async function indicator.
|
|
24
|
+
* Group 13: Export function or class type.
|
|
25
|
+
* Group 14: Export function or class name.
|
|
26
|
+
* Group 15: Export default statement that is not a function or class.
|
|
27
|
+
* Group 16: Export object.
|
|
28
|
+
* Group 17: Export variable type (var, let or const).
|
|
29
|
+
* Group 18: Export variable name.
|
|
30
|
+
* Group 19: Export variable name end character (= or ;).
|
|
31
|
+
*/
|
|
32
|
+
const STATEMENT_REGEXP =
|
|
33
|
+
/import\.meta\.([a-zA-Z]+)|import\s*["']([^"']+)["'];{0,1}|import\s*\(([^)]+)\)|(import[\s{])|[\s}]from\s*["']([^"']+)["'](\s+with\s*{\s*type\s*:\s*["']([^"']+)["']\s*}){0,1}([;\s]*)|export(\s+[a-zA-Z0-9-_$]+\s+|\s+\*\s+|\s+\*\s+as\s+["'a-zA-Z0-9-_$]+\s+|\s*{[^}]+}\s*)from\s*["']([^"']+)["']|export\s*(default\s+){0,1}(async\s+){0,1}(function\*{0,1}|class)\s*([^({\s]+)|(export\s*default\s*)|export\s*{([^}]+)}|export\s+(var|let|const)\s+([^=;]+)(=|;)/gm;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Syntax regexp.
|
|
37
|
+
*
|
|
38
|
+
* Group 1: Slash (RegExp or comment).
|
|
39
|
+
* Group 2: Parentheses.
|
|
40
|
+
* Group 3: Curly braces.
|
|
41
|
+
* Group 4: Square brackets.
|
|
42
|
+
* Group 5: Escape template string (${).
|
|
43
|
+
* Group 6: Template string apostrophe (`).
|
|
44
|
+
* Group 7: String apostrophe (').
|
|
45
|
+
* Group 8: String apostrophe (").
|
|
46
|
+
* Group 9: Line feed character.
|
|
47
|
+
*/
|
|
48
|
+
const SYNTAX_REGEXP = /(\/)|(\(|\))|({|})|(\[|\])|(\${)|(`)|(')|(")|(\n)/gm;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Import regexp.
|
|
52
|
+
*
|
|
53
|
+
* Group 1: Import braces.
|
|
54
|
+
* Group 2: Import all as.
|
|
55
|
+
* Group 3: Import default.
|
|
56
|
+
*/
|
|
57
|
+
const IMPORT_REGEXP = /{([^}]+)}|\*\s+as\s+([a-zA-Z0-9-_$]+)|([a-zA-Z0-9-_$]+)/gm;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Strip invalid variable name characters regexp.
|
|
61
|
+
*/
|
|
62
|
+
const VALID_VARIABLE_NAME_REGEXP = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Valid preceding token before a statement.
|
|
66
|
+
*/
|
|
67
|
+
const PRECEDING_STATEMENT_TOKEN_REGEXP = /['"`(){}\s;=><\[\]+-,:&]/;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Valid preceding token before a regexp.
|
|
71
|
+
*/
|
|
72
|
+
const PRECEDING_REGEXP_TOKEN_REGEXP = /['"`({};=><\[+-,:&]/;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Multiline comment regexp.
|
|
76
|
+
*/
|
|
77
|
+
const MULTILINE_COMMENT_REGEXP = /\/\*|\*\//gm;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Export regexp.
|
|
81
|
+
*/
|
|
82
|
+
const EXPORT_REGEXP = /export\s*/;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Export default regexp.
|
|
86
|
+
*/
|
|
87
|
+
const EXPORT_DEFAULT_REGEXP = /export\s*default\s*/;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Ends with semicolon regexp.
|
|
91
|
+
*/
|
|
92
|
+
const ENDS_WITH_SEMICOLON_REGEXP = /;\s*$/;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* ECMAScript module compiler.
|
|
96
|
+
*/
|
|
97
|
+
export default class ECMAScriptModuleCompiler {
|
|
98
|
+
public readonly window: BrowserWindow;
|
|
99
|
+
private debug = false;
|
|
100
|
+
private count = {
|
|
101
|
+
comment: 0,
|
|
102
|
+
singleLineComment: 0,
|
|
103
|
+
parentheses: 0,
|
|
104
|
+
curlyBraces: 0,
|
|
105
|
+
squareBrackets: 0,
|
|
106
|
+
regExp: 0,
|
|
107
|
+
regExpSquareBrackets: 0,
|
|
108
|
+
escapeTemplateString: 0,
|
|
109
|
+
simpleString: 0,
|
|
110
|
+
doubleString: 0
|
|
111
|
+
};
|
|
112
|
+
private debugCount: {
|
|
113
|
+
comment: number[];
|
|
114
|
+
singleLineComment: number[];
|
|
115
|
+
parentheses: number[];
|
|
116
|
+
curlyBraces: number[];
|
|
117
|
+
squareBrackets: number[];
|
|
118
|
+
regExp: number[];
|
|
119
|
+
regExpSquareBrackets: number[];
|
|
120
|
+
escapeTemplateString: number[];
|
|
121
|
+
simpleString: number[];
|
|
122
|
+
doubleString: number[];
|
|
123
|
+
} = {
|
|
124
|
+
comment: [],
|
|
125
|
+
singleLineComment: [],
|
|
126
|
+
parentheses: [],
|
|
127
|
+
curlyBraces: [],
|
|
128
|
+
squareBrackets: [],
|
|
129
|
+
regExp: [],
|
|
130
|
+
regExpSquareBrackets: [],
|
|
131
|
+
escapeTemplateString: [],
|
|
132
|
+
simpleString: [],
|
|
133
|
+
doubleString: []
|
|
134
|
+
};
|
|
135
|
+
private templateString: number[] = [];
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Constructor.
|
|
139
|
+
*
|
|
140
|
+
* @param window Window.
|
|
141
|
+
* @param url Module URL.
|
|
142
|
+
*/
|
|
143
|
+
constructor(window: BrowserWindow) {
|
|
144
|
+
this.window = window;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Compiles code and returns imports and compiled code.
|
|
149
|
+
*
|
|
150
|
+
* @param moduleURL Module URL.
|
|
151
|
+
* @param code Code.
|
|
152
|
+
* @param sourceURL Source URL.
|
|
153
|
+
* @returns Result.
|
|
154
|
+
*/
|
|
155
|
+
public compile(
|
|
156
|
+
moduleURL: string,
|
|
157
|
+
code: string,
|
|
158
|
+
sourceURL: string | null = null
|
|
159
|
+
): IECMAScriptModuleCompiledResult {
|
|
160
|
+
const browserContext = new WindowBrowserContext(this.window).getBrowserContext();
|
|
161
|
+
|
|
162
|
+
if (!browserContext) {
|
|
163
|
+
return { imports: [], execute: async () => {} };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const browserSettings = browserContext.browser.settings;
|
|
167
|
+
|
|
168
|
+
// Only files has a "sourceURL" and we don't want to cache modules loaded from script tag strings
|
|
169
|
+
if (!browserSettings.module.disableCache && sourceURL) {
|
|
170
|
+
const cached = browserContext[PropertySymbol.moduleCache].get(moduleURL);
|
|
171
|
+
if (cached) {
|
|
172
|
+
return {
|
|
173
|
+
imports: cached.imports,
|
|
174
|
+
execute: this.window[PropertySymbol.evaluateScript](cached.code, {
|
|
175
|
+
filename: sourceURL
|
|
176
|
+
})
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
this.reset();
|
|
182
|
+
|
|
183
|
+
const regExp = new RegExp(STATEMENT_REGEXP);
|
|
184
|
+
const imports: IECMAScriptModuleImport[] = [];
|
|
185
|
+
const resolvableCircularImports: Array<{
|
|
186
|
+
url: string;
|
|
187
|
+
properties: Array<{ name: string; alias?: string }>;
|
|
188
|
+
}> = [];
|
|
189
|
+
const count = this.count;
|
|
190
|
+
let newCode = '';
|
|
191
|
+
let newCodeStart = '';
|
|
192
|
+
let newCodeEnd = '';
|
|
193
|
+
let match: RegExpExecArray | null = null;
|
|
194
|
+
let precedingToken: string;
|
|
195
|
+
let textBetweenStatements: string;
|
|
196
|
+
let isTopLevel = true;
|
|
197
|
+
let lastIndex = 0;
|
|
198
|
+
let importStartIndex = -1;
|
|
199
|
+
|
|
200
|
+
while ((match = regExp.exec(code))) {
|
|
201
|
+
precedingToken = code[match.index - 1] || ' ';
|
|
202
|
+
textBetweenStatements = code.substring(lastIndex, match.index);
|
|
203
|
+
|
|
204
|
+
this.parseSyntax(textBetweenStatements, lastIndex);
|
|
205
|
+
|
|
206
|
+
if (importStartIndex === -1) {
|
|
207
|
+
newCode += textBetweenStatements;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Imports and exports are only valid outside any statement, string or comment at the top level
|
|
211
|
+
isTopLevel =
|
|
212
|
+
count.comment === 0 &&
|
|
213
|
+
count.singleLineComment === 0 &&
|
|
214
|
+
count.parentheses === 0 &&
|
|
215
|
+
count.curlyBraces === 0 &&
|
|
216
|
+
count.squareBrackets === 0 &&
|
|
217
|
+
count.regExp === 0 &&
|
|
218
|
+
count.simpleString === 0 &&
|
|
219
|
+
count.doubleString === 0 &&
|
|
220
|
+
this.templateString.length === 0;
|
|
221
|
+
|
|
222
|
+
if (
|
|
223
|
+
match[1] &&
|
|
224
|
+
count.simpleString === 0 &&
|
|
225
|
+
count.doubleString === 0 &&
|
|
226
|
+
count.comment === 0 &&
|
|
227
|
+
count.singleLineComment === 0 &&
|
|
228
|
+
count.regExp === 0 &&
|
|
229
|
+
(this.templateString.length === 0 || this.templateString[0] > 0) &&
|
|
230
|
+
PRECEDING_STATEMENT_TOKEN_REGEXP.test(this.getNonSpacePrecedingToken(code, match.index))
|
|
231
|
+
) {
|
|
232
|
+
// Import meta
|
|
233
|
+
newCode += `$happy_dom.importMeta.${match[1]}`;
|
|
234
|
+
} else if (match[2] && isTopLevel && PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)) {
|
|
235
|
+
// Import without exported properties
|
|
236
|
+
|
|
237
|
+
imports.push({
|
|
238
|
+
url: ModuleURLUtility.getURL(this.window, moduleURL, match[2]).href,
|
|
239
|
+
type: 'esm'
|
|
240
|
+
});
|
|
241
|
+
} else if (
|
|
242
|
+
match[3] &&
|
|
243
|
+
count.simpleString === 0 &&
|
|
244
|
+
count.doubleString === 0 &&
|
|
245
|
+
count.comment === 0 &&
|
|
246
|
+
count.singleLineComment === 0 &&
|
|
247
|
+
count.regExp === 0 &&
|
|
248
|
+
(this.templateString.length === 0 || this.templateString[0] > 0) &&
|
|
249
|
+
PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)
|
|
250
|
+
) {
|
|
251
|
+
// Dynamic import function call
|
|
252
|
+
|
|
253
|
+
newCode += `$happy_dom.dynamicImport(${match[3]})`;
|
|
254
|
+
} else if (match[4] && isTopLevel && PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)) {
|
|
255
|
+
// Import statement start
|
|
256
|
+
if (importStartIndex !== -1) {
|
|
257
|
+
throw new this.window.TypeError(
|
|
258
|
+
`Failed to parse module: Unexpected import statement in "${moduleURL}"`
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
importStartIndex = match.index + match[0].length - 1;
|
|
262
|
+
} else if (match[5] && isTopLevel && importStartIndex !== -1) {
|
|
263
|
+
// Import statement end
|
|
264
|
+
|
|
265
|
+
const url = ModuleURLUtility.getURL(this.window, moduleURL, match[5]).href;
|
|
266
|
+
const variables = code.substring(importStartIndex, match.index + 1);
|
|
267
|
+
const importRegExp = new RegExp(IMPORT_REGEXP);
|
|
268
|
+
let importMatch: RegExpExecArray | null = null;
|
|
269
|
+
while ((importMatch = importRegExp.exec(variables))) {
|
|
270
|
+
if (importMatch[1]) {
|
|
271
|
+
// Import braces
|
|
272
|
+
const parts = this.removeMultilineComments(importMatch[1]).split(/\s*,\s*/);
|
|
273
|
+
const properties: Array<{ name: string; alias?: string }> = [];
|
|
274
|
+
for (const part of parts) {
|
|
275
|
+
const nameParts = part.trim().split(/\s+as\s+/);
|
|
276
|
+
const alias = (nameParts[1] || nameParts[0]).replace(/["']/g, '');
|
|
277
|
+
const name = nameParts[0].replace(/["']/g, '');
|
|
278
|
+
if (alias && name) {
|
|
279
|
+
if (name === alias) {
|
|
280
|
+
properties.push({ name });
|
|
281
|
+
} else {
|
|
282
|
+
properties.push({ name, alias });
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (!match[7] || match[7] === 'esm') {
|
|
287
|
+
resolvableCircularImports.push({ url, properties });
|
|
288
|
+
}
|
|
289
|
+
newCodeStart += `let {${properties.map((property) => (property.alias ? `"${property.name}": ${property.alias}` : property.name)).join(', ')}} = $happy_dom.imports.get('${url}')${match[8]}`;
|
|
290
|
+
} else if (importMatch[2]) {
|
|
291
|
+
// Import all as
|
|
292
|
+
newCodeStart += `const ${importMatch[2]} = $happy_dom.imports.get('${url}')${match[8]}`;
|
|
293
|
+
} else if (importMatch[3]) {
|
|
294
|
+
// Import default
|
|
295
|
+
if (!match[7] || match[7] === 'esm') {
|
|
296
|
+
resolvableCircularImports.push({
|
|
297
|
+
url,
|
|
298
|
+
properties: [{ name: 'default', alias: importMatch[3] }]
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
newCodeStart += `let ${importMatch[3]} = $happy_dom.imports.get('${url}').default${match[8]}`;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
importStartIndex = -1;
|
|
305
|
+
imports.push({ url, type: match[7] || 'esm' });
|
|
306
|
+
} else if (
|
|
307
|
+
match[9] &&
|
|
308
|
+
match[10] &&
|
|
309
|
+
isTopLevel &&
|
|
310
|
+
PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)
|
|
311
|
+
) {
|
|
312
|
+
// Export from module statement
|
|
313
|
+
|
|
314
|
+
const url = ModuleURLUtility.getURL(this.window, moduleURL, match[10]).href;
|
|
315
|
+
const imported = match[9].trim();
|
|
316
|
+
|
|
317
|
+
if (imported === '*') {
|
|
318
|
+
newCode += `Object.assign($happy_dom.exports, $happy_dom.imports.get('${url}'))`;
|
|
319
|
+
imports.push({ url, type: 'esm' });
|
|
320
|
+
} else if (imported[0] === '*') {
|
|
321
|
+
const parts = imported.split(/\s+as\s+/);
|
|
322
|
+
if (parts.length === 2) {
|
|
323
|
+
const exportName = parts[1].replace(/["']/g, '');
|
|
324
|
+
newCode += `$happy_dom.exports['${exportName}'] = $happy_dom.imports.get('${url}')`;
|
|
325
|
+
imports.push({ url, type: 'esm' });
|
|
326
|
+
}
|
|
327
|
+
} else if (imported[0] === '{') {
|
|
328
|
+
const parts = this.removeMultilineComments(imported)
|
|
329
|
+
.slice(1, -1)
|
|
330
|
+
.split(/\s*,\s*/);
|
|
331
|
+
const exportCode: string[] = [];
|
|
332
|
+
for (const part of parts) {
|
|
333
|
+
const nameParts = part.trim().split(/\s+as\s+/);
|
|
334
|
+
const exportName = (nameParts[1] || nameParts[0]).replace(/["']/g, '');
|
|
335
|
+
const importName = nameParts[0].replace(/["']/g, '');
|
|
336
|
+
if (exportName && importName) {
|
|
337
|
+
exportCode.push(
|
|
338
|
+
`$happy_dom.exports['${exportName}'] = $happy_dom.imports.get('${url}')['${importName}']`
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
newCode += exportCode.join(';\n');
|
|
343
|
+
imports.push({ url, type: 'esm' });
|
|
344
|
+
}
|
|
345
|
+
} else if (
|
|
346
|
+
match[13] &&
|
|
347
|
+
match[14] &&
|
|
348
|
+
isTopLevel &&
|
|
349
|
+
PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)
|
|
350
|
+
) {
|
|
351
|
+
// Export function or class type
|
|
352
|
+
|
|
353
|
+
const name = match[14].replace('*', '');
|
|
354
|
+
|
|
355
|
+
if (name) {
|
|
356
|
+
if (match[11]) {
|
|
357
|
+
newCode += match[0].replace(EXPORT_DEFAULT_REGEXP, '');
|
|
358
|
+
newCodeEnd += `$happy_dom.exports.default = ${name};\n`;
|
|
359
|
+
} else {
|
|
360
|
+
newCode += match[0].replace(EXPORT_REGEXP, '');
|
|
361
|
+
newCodeEnd += `$happy_dom.exports['${name}'] = ${name};\n`;
|
|
362
|
+
}
|
|
363
|
+
} else {
|
|
364
|
+
if (match[11]) {
|
|
365
|
+
newCode += `$happy_dom.exports.default = ${match[12] || ''}${match[13]}${name ? ' ' : ''}${match[14]}`;
|
|
366
|
+
} else {
|
|
367
|
+
throw new this.window.SyntaxError(
|
|
368
|
+
`Failed to parse module: Missing function or class name in export statement in "${moduleURL}"`
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
} else if (match[15] && isTopLevel && PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)) {
|
|
373
|
+
// Export default statement
|
|
374
|
+
|
|
375
|
+
newCode += '$happy_dom.exports.default = ';
|
|
376
|
+
} else if (match[16] && isTopLevel && PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)) {
|
|
377
|
+
// Export object
|
|
378
|
+
|
|
379
|
+
const parts = this.removeMultilineComments(match[16]).split(/\s*,\s*/);
|
|
380
|
+
const exportCode: string[] = [];
|
|
381
|
+
for (const part of parts) {
|
|
382
|
+
const nameParts = part.trim().split(/\s+as\s+/);
|
|
383
|
+
const exportName = (nameParts[1] || nameParts[0]).replace(/["']/g, '');
|
|
384
|
+
const importName = nameParts[0].replace(/["']/g, '');
|
|
385
|
+
if (exportName && importName && VALID_VARIABLE_NAME_REGEXP.test(importName)) {
|
|
386
|
+
exportCode.push(`$happy_dom.exports['${exportName}'] = ${importName}`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
newCode += exportCode.join(';\n');
|
|
390
|
+
} else if (match[17] && isTopLevel && PRECEDING_STATEMENT_TOKEN_REGEXP.test(precedingToken)) {
|
|
391
|
+
// Export variable
|
|
392
|
+
|
|
393
|
+
if (match[19] === '=') {
|
|
394
|
+
const exportName = this.removeMultilineComments(match[18]).trim();
|
|
395
|
+
if (
|
|
396
|
+
(exportName[0] === '{' && exportName[exportName.length - 1] === '}') ||
|
|
397
|
+
(exportName[0] === '[' && exportName[exportName.length - 1] === ']')
|
|
398
|
+
) {
|
|
399
|
+
const parts = exportName.slice(1, -1).split(/\s*,\s*/);
|
|
400
|
+
|
|
401
|
+
for (const part of parts) {
|
|
402
|
+
const nameParts = part.trim().split(/\s*:\s*/);
|
|
403
|
+
const exportName = (nameParts[1] || nameParts[0]).replace(/["']/g, '');
|
|
404
|
+
if (exportName) {
|
|
405
|
+
newCodeEnd += `$happy_dom.exports['${exportName}'] = ${exportName};\n`;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
newCode += match[0].replace(EXPORT_REGEXP, '');
|
|
410
|
+
} else {
|
|
411
|
+
newCode += match[0].replace(EXPORT_REGEXP, '');
|
|
412
|
+
newCodeEnd += `$happy_dom.exports['${exportName}'] = ${exportName};\n`;
|
|
413
|
+
}
|
|
414
|
+
} else {
|
|
415
|
+
// Example: export let name1, name2, name3;
|
|
416
|
+
newCode += match[0].replace(EXPORT_REGEXP, '');
|
|
417
|
+
const parts = this.removeMultilineComments(match[18]).split(',');
|
|
418
|
+
for (const part of parts) {
|
|
419
|
+
const exportName = part.trim();
|
|
420
|
+
newCodeEnd += `$happy_dom.exports['${exportName}'] = ${exportName};\n`;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
} else if (importStartIndex !== -1) {
|
|
424
|
+
// Invalid import statement
|
|
425
|
+
// E.g. "import defaultExport from invalid;" or just "import defaultExport;"
|
|
426
|
+
|
|
427
|
+
const unparsed = code.substring(importStartIndex, match.index + 1);
|
|
428
|
+
newCode += unparsed;
|
|
429
|
+
this.parseSyntax(unparsed, importStartIndex);
|
|
430
|
+
} else {
|
|
431
|
+
// No valid statement found
|
|
432
|
+
// This happens when there is a statement inside a string or comment
|
|
433
|
+
// E.g. "const str = 'import defaultExport from invalid;';"
|
|
434
|
+
|
|
435
|
+
newCode += match[0];
|
|
436
|
+
this.parseSyntax(match[0], match.index);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
lastIndex = regExp.lastIndex;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// In debug mode we don't want to execute the code, just take information from it
|
|
443
|
+
if (this.debug) {
|
|
444
|
+
return {
|
|
445
|
+
imports,
|
|
446
|
+
execute: async () => {}
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (!!newCodeStart && !ENDS_WITH_SEMICOLON_REGEXP.test(newCodeStart)) {
|
|
451
|
+
newCodeStart = `\n${newCodeStart};`;
|
|
452
|
+
}
|
|
453
|
+
if (
|
|
454
|
+
!browserSettings.disableErrorCapturing &&
|
|
455
|
+
browserSettings.errorCapture === BrowserErrorCaptureEnum.tryAndCatch
|
|
456
|
+
) {
|
|
457
|
+
newCodeStart = '(async function anonymous($happy_dom) { try {' + newCodeStart;
|
|
458
|
+
} else {
|
|
459
|
+
newCodeStart = '(async function anonymous($happy_dom) {' + newCodeStart;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
newCode = newCodeStart + newCode;
|
|
463
|
+
|
|
464
|
+
if (lastIndex === 0) {
|
|
465
|
+
newCode += code;
|
|
466
|
+
} else {
|
|
467
|
+
newCode += code.substring(lastIndex);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
newCode += '\n' + newCodeEnd;
|
|
471
|
+
|
|
472
|
+
if (resolvableCircularImports.length > 0) {
|
|
473
|
+
newCode += '$happy_dom.addCircularImportResolver(() => {\n';
|
|
474
|
+
for (const circularImport of resolvableCircularImports) {
|
|
475
|
+
for (const property of circularImport.properties) {
|
|
476
|
+
if (property.alias) {
|
|
477
|
+
newCode += `${property.alias} = $happy_dom.imports.get('${circularImport.url}')['${property.name}'];\n`;
|
|
478
|
+
} else {
|
|
479
|
+
newCode += `${property.name} = $happy_dom.imports.get('${circularImport.url}')['${property.name}'];\n`;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
newCode += '});';
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
if (
|
|
487
|
+
!browserSettings.disableErrorCapturing &&
|
|
488
|
+
browserSettings.errorCapture === BrowserErrorCaptureEnum.tryAndCatch
|
|
489
|
+
) {
|
|
490
|
+
newCode += `} catch(e) { $happy_dom.dispatchError(e); }`;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
newCode += '})';
|
|
494
|
+
|
|
495
|
+
let execute: () => Promise<void>;
|
|
496
|
+
try {
|
|
497
|
+
execute = this.window[PropertySymbol.evaluateScript](newCode, {
|
|
498
|
+
filename: sourceURL || moduleURL
|
|
499
|
+
});
|
|
500
|
+
} catch (e) {
|
|
501
|
+
const compileError = this.getError(moduleURL, code, sourceURL);
|
|
502
|
+
const error = compileError
|
|
503
|
+
? new this.window.SyntaxError(
|
|
504
|
+
`Failed to parse module in '${moduleURL}'. Execution error: ${(<Error>e).message}. Compile error: ${compileError}`
|
|
505
|
+
)
|
|
506
|
+
: <Error>e;
|
|
507
|
+
|
|
508
|
+
(<Error>e).message = `Failed to parse module in '${sourceURL}': ${(<Error>error).message}`;
|
|
509
|
+
|
|
510
|
+
if (
|
|
511
|
+
browserSettings.disableErrorCapturing ||
|
|
512
|
+
browserSettings.errorCapture !== BrowserErrorCaptureEnum.tryAndCatch
|
|
513
|
+
) {
|
|
514
|
+
throw error;
|
|
515
|
+
} else {
|
|
516
|
+
this.window[PropertySymbol.dispatchError](error);
|
|
517
|
+
return {
|
|
518
|
+
imports,
|
|
519
|
+
execute: async () => {}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (!browserSettings.module.disableCache && sourceURL) {
|
|
525
|
+
browserContext[PropertySymbol.moduleCache].set(moduleURL, {
|
|
526
|
+
imports,
|
|
527
|
+
code: newCode
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
return { imports, execute };
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Parses syntax.
|
|
536
|
+
*
|
|
537
|
+
* @param code Code.
|
|
538
|
+
* @param index Index.
|
|
539
|
+
*/
|
|
540
|
+
private parseSyntax(code: string, index: number): void {
|
|
541
|
+
const regExp = new RegExp(SYNTAX_REGEXP);
|
|
542
|
+
const count = this.count;
|
|
543
|
+
const debug = this.debug;
|
|
544
|
+
const debugCount = this.debugCount;
|
|
545
|
+
let match: RegExpExecArray | null = null;
|
|
546
|
+
let precedingToken: string;
|
|
547
|
+
let isEscaped: boolean;
|
|
548
|
+
|
|
549
|
+
index++;
|
|
550
|
+
|
|
551
|
+
while ((match = regExp.exec(code))) {
|
|
552
|
+
precedingToken = code[match.index - 1] || ' ';
|
|
553
|
+
isEscaped = precedingToken === '\\' && code[match.index - 2] !== '\\';
|
|
554
|
+
|
|
555
|
+
if (match[1]) {
|
|
556
|
+
// Slash (RegExp or Comment)
|
|
557
|
+
if (
|
|
558
|
+
count.simpleString === 0 &&
|
|
559
|
+
count.doubleString === 0 &&
|
|
560
|
+
count.singleLineComment === 0 &&
|
|
561
|
+
count.regExpSquareBrackets === 0 &&
|
|
562
|
+
(this.templateString.length === 0 || this.templateString[0] > 0)
|
|
563
|
+
) {
|
|
564
|
+
if (count.comment === 1) {
|
|
565
|
+
if (precedingToken === '*') {
|
|
566
|
+
count.comment = 0;
|
|
567
|
+
|
|
568
|
+
if (debug) {
|
|
569
|
+
debugCount.comment.length = 0;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
} else {
|
|
573
|
+
if (count.regExp === 0) {
|
|
574
|
+
if (code[match.index + 1] === '*') {
|
|
575
|
+
count.comment = 1;
|
|
576
|
+
|
|
577
|
+
if (debug) {
|
|
578
|
+
debugCount.comment = [index + match.index];
|
|
579
|
+
}
|
|
580
|
+
} else if (code[match.index + 1] === '/') {
|
|
581
|
+
count.singleLineComment = 1;
|
|
582
|
+
|
|
583
|
+
if (debug) {
|
|
584
|
+
debugCount.singleLineComment = [index + match.index];
|
|
585
|
+
}
|
|
586
|
+
} else {
|
|
587
|
+
if (
|
|
588
|
+
PRECEDING_REGEXP_TOKEN_REGEXP.test(
|
|
589
|
+
this.getNonSpacePrecedingToken(code, match.index)
|
|
590
|
+
)
|
|
591
|
+
) {
|
|
592
|
+
count.regExp = 1;
|
|
593
|
+
|
|
594
|
+
if (debug) {
|
|
595
|
+
debugCount.regExp = [index + match.index];
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
} else if (!isEscaped) {
|
|
600
|
+
count.regExp = 0;
|
|
601
|
+
|
|
602
|
+
if (debug) {
|
|
603
|
+
debugCount.regExp.length = 0;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
} else if (match[2]) {
|
|
609
|
+
// Parentheses
|
|
610
|
+
if (
|
|
611
|
+
count.simpleString === 0 &&
|
|
612
|
+
count.doubleString === 0 &&
|
|
613
|
+
count.regExp === 0 &&
|
|
614
|
+
count.comment === 0 &&
|
|
615
|
+
count.singleLineComment === 0 &&
|
|
616
|
+
(this.templateString.length === 0 || this.templateString[0] > 0)
|
|
617
|
+
) {
|
|
618
|
+
if (match[2] === '(') {
|
|
619
|
+
count.parentheses++;
|
|
620
|
+
|
|
621
|
+
if (debug) {
|
|
622
|
+
debugCount.parentheses.push(index + match.index);
|
|
623
|
+
}
|
|
624
|
+
} else if (match[2] === ')' && count.parentheses > 0) {
|
|
625
|
+
count.parentheses--;
|
|
626
|
+
|
|
627
|
+
if (debug) {
|
|
628
|
+
debugCount.parentheses.pop();
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
} else if (match[3]) {
|
|
633
|
+
// Curly braces
|
|
634
|
+
if (
|
|
635
|
+
count.simpleString === 0 &&
|
|
636
|
+
count.doubleString === 0 &&
|
|
637
|
+
count.regExp === 0 &&
|
|
638
|
+
count.comment === 0 &&
|
|
639
|
+
count.singleLineComment === 0 &&
|
|
640
|
+
(this.templateString.length === 0 || this.templateString[0] > 0)
|
|
641
|
+
) {
|
|
642
|
+
if (match[3] === '{') {
|
|
643
|
+
if (this.templateString.length) {
|
|
644
|
+
this.templateString[0]++;
|
|
645
|
+
}
|
|
646
|
+
count.curlyBraces++;
|
|
647
|
+
|
|
648
|
+
if (debug) {
|
|
649
|
+
debugCount.curlyBraces.push(index + match.index);
|
|
650
|
+
}
|
|
651
|
+
} else if (match[3] === '}') {
|
|
652
|
+
if (this.templateString.length && this.templateString[0] > 0) {
|
|
653
|
+
this.templateString[0]--;
|
|
654
|
+
}
|
|
655
|
+
if (count.curlyBraces > 0) {
|
|
656
|
+
count.curlyBraces--;
|
|
657
|
+
|
|
658
|
+
if (debug) {
|
|
659
|
+
debugCount.curlyBraces.pop();
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
} else if (match[4]) {
|
|
665
|
+
// Square brackets
|
|
666
|
+
if (
|
|
667
|
+
count.simpleString === 0 &&
|
|
668
|
+
count.doubleString === 0 &&
|
|
669
|
+
count.comment === 0 &&
|
|
670
|
+
count.singleLineComment === 0 &&
|
|
671
|
+
(this.templateString.length === 0 || this.templateString[0] > 0)
|
|
672
|
+
) {
|
|
673
|
+
// We need to check for square brackets in RegExp as well to know when the RegExp ends
|
|
674
|
+
if (count.regExp === 1) {
|
|
675
|
+
if (!isEscaped) {
|
|
676
|
+
if (match[4] === '[' && count.regExpSquareBrackets === 0) {
|
|
677
|
+
count.regExpSquareBrackets = 1;
|
|
678
|
+
|
|
679
|
+
if (debug) {
|
|
680
|
+
debugCount.regExpSquareBrackets = [index + match.index];
|
|
681
|
+
}
|
|
682
|
+
} else if (match[4] === ']' && count.regExpSquareBrackets === 1) {
|
|
683
|
+
count.regExpSquareBrackets = 0;
|
|
684
|
+
|
|
685
|
+
if (debug) {
|
|
686
|
+
debugCount.regExpSquareBrackets.length = 0;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
} else {
|
|
691
|
+
if (match[4] === '[') {
|
|
692
|
+
count.squareBrackets++;
|
|
693
|
+
|
|
694
|
+
if (debug) {
|
|
695
|
+
debugCount.squareBrackets.push(index + match.index);
|
|
696
|
+
}
|
|
697
|
+
} else if (match[4] === ']' && count.squareBrackets > 0) {
|
|
698
|
+
count.squareBrackets--;
|
|
699
|
+
|
|
700
|
+
if (debug) {
|
|
701
|
+
debugCount.squareBrackets.pop();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
} else if (match[5]) {
|
|
707
|
+
// Escape template string (${)
|
|
708
|
+
if (
|
|
709
|
+
count.simpleString === 0 &&
|
|
710
|
+
count.doubleString === 0 &&
|
|
711
|
+
count.comment === 0 &&
|
|
712
|
+
count.singleLineComment === 0 &&
|
|
713
|
+
count.regExp === 0 &&
|
|
714
|
+
!isEscaped
|
|
715
|
+
) {
|
|
716
|
+
if (this.templateString[0] === 0) {
|
|
717
|
+
this.templateString[0] = 1;
|
|
718
|
+
count.curlyBraces++;
|
|
719
|
+
if (debug) {
|
|
720
|
+
debugCount.curlyBraces.push(index + match.index);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
} else if (match[6]) {
|
|
725
|
+
// Template string
|
|
726
|
+
if (
|
|
727
|
+
count.simpleString === 0 &&
|
|
728
|
+
count.doubleString === 0 &&
|
|
729
|
+
count.comment === 0 &&
|
|
730
|
+
count.singleLineComment === 0 &&
|
|
731
|
+
count.regExp === 0 &&
|
|
732
|
+
!isEscaped
|
|
733
|
+
) {
|
|
734
|
+
if (this.templateString?.[0] === 0) {
|
|
735
|
+
this.templateString.shift();
|
|
736
|
+
} else {
|
|
737
|
+
this.templateString.unshift(0);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
} else if (match[7]) {
|
|
741
|
+
// String apostrophe (')
|
|
742
|
+
if (
|
|
743
|
+
count.doubleString === 0 &&
|
|
744
|
+
count.comment === 0 &&
|
|
745
|
+
count.singleLineComment === 0 &&
|
|
746
|
+
count.regExp === 0 &&
|
|
747
|
+
!isEscaped &&
|
|
748
|
+
(this.templateString.length === 0 || this.templateString[0] > 0)
|
|
749
|
+
) {
|
|
750
|
+
if (count.simpleString === 0) {
|
|
751
|
+
count.simpleString = 1;
|
|
752
|
+
|
|
753
|
+
if (debug) {
|
|
754
|
+
debugCount.simpleString = [index + match.index];
|
|
755
|
+
}
|
|
756
|
+
} else {
|
|
757
|
+
count.simpleString = 0;
|
|
758
|
+
|
|
759
|
+
if (debug) {
|
|
760
|
+
debugCount.simpleString.length = 0;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
} else if (match[8]) {
|
|
765
|
+
// String apostrophe (")
|
|
766
|
+
if (
|
|
767
|
+
count.simpleString === 0 &&
|
|
768
|
+
count.comment === 0 &&
|
|
769
|
+
count.singleLineComment === 0 &&
|
|
770
|
+
count.regExp === 0 &&
|
|
771
|
+
!isEscaped &&
|
|
772
|
+
(this.templateString.length === 0 || this.templateString[0] > 0)
|
|
773
|
+
) {
|
|
774
|
+
if (count.doubleString === 0) {
|
|
775
|
+
count.doubleString = 1;
|
|
776
|
+
|
|
777
|
+
if (debug) {
|
|
778
|
+
debugCount.doubleString = [index + match.index];
|
|
779
|
+
}
|
|
780
|
+
} else {
|
|
781
|
+
count.doubleString = 0;
|
|
782
|
+
|
|
783
|
+
if (debug) {
|
|
784
|
+
debugCount.doubleString.length = 0;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
} else if (match[9]) {
|
|
789
|
+
// Line feed character
|
|
790
|
+
count.singleLineComment = 0;
|
|
791
|
+
|
|
792
|
+
if (debug) {
|
|
793
|
+
debugCount.singleLineComment.length = 0;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Returns error.
|
|
801
|
+
*
|
|
802
|
+
* @param moduleURL Module URL.
|
|
803
|
+
* @param code Code.
|
|
804
|
+
* @param sourceURL Source URL.
|
|
805
|
+
* @returns Error.
|
|
806
|
+
*/
|
|
807
|
+
private getError(moduleURL: string, code: string, sourceURL: string | null): string | null {
|
|
808
|
+
if (
|
|
809
|
+
this.count.comment === 0 &&
|
|
810
|
+
this.count.singleLineComment === 0 &&
|
|
811
|
+
this.count.parentheses === 0 &&
|
|
812
|
+
this.count.curlyBraces === 0 &&
|
|
813
|
+
this.count.squareBrackets === 0 &&
|
|
814
|
+
this.count.regExp === 0 &&
|
|
815
|
+
this.count.regExpSquareBrackets === 0 &&
|
|
816
|
+
this.count.simpleString === 0 &&
|
|
817
|
+
this.count.doubleString === 0
|
|
818
|
+
) {
|
|
819
|
+
return null;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// Enable debug mode to get error information
|
|
823
|
+
if (!this.debug) {
|
|
824
|
+
this.debug = true;
|
|
825
|
+
this.compile(moduleURL, code, sourceURL);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
const debugCount = this.debugCount;
|
|
829
|
+
|
|
830
|
+
if (debugCount.comment.length > 0) {
|
|
831
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.comment[0]);
|
|
832
|
+
return `Missing end of comment on line ${line} and column ${column}`;
|
|
833
|
+
} else if (debugCount.regExp.length > 0) {
|
|
834
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.regExp[0]);
|
|
835
|
+
return `Missing end of regular expression on line ${line} and column ${column}`;
|
|
836
|
+
} else if (debugCount.regExpSquareBrackets.length > 0) {
|
|
837
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.regExpSquareBrackets[0]);
|
|
838
|
+
return `Missing end of regular expression square brackets on line ${line} and column ${column}`;
|
|
839
|
+
} else if (debugCount.simpleString.length > 0) {
|
|
840
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.simpleString[0]);
|
|
841
|
+
return `Missing end of single quote string on line ${line} and column ${column}`;
|
|
842
|
+
} else if (debugCount.doubleString.length > 0) {
|
|
843
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.doubleString[0]);
|
|
844
|
+
return `Missing end of double quote string on line ${line} and column ${column}`;
|
|
845
|
+
} else if (debugCount.parentheses.length > 0) {
|
|
846
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.parentheses[0]);
|
|
847
|
+
return `Missing end of parentheses on line ${line} and column ${column}`;
|
|
848
|
+
} else if (debugCount.curlyBraces.length > 0) {
|
|
849
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.curlyBraces[0]);
|
|
850
|
+
return `Missing end of curly braces on line ${line} and column ${column}`;
|
|
851
|
+
} else if (debugCount.squareBrackets.length > 0) {
|
|
852
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.squareBrackets[0]);
|
|
853
|
+
return `Missing end of square brackets on line ${line} and column ${column}`;
|
|
854
|
+
} else if (debugCount.escapeTemplateString.length > 0) {
|
|
855
|
+
const { line, column } = this.getLineAndColumn(code, debugCount.escapeTemplateString[0]);
|
|
856
|
+
return `Missing end of escaped template string on line ${line} and column ${column}`;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
return null;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Returns line and column for an error.
|
|
864
|
+
*
|
|
865
|
+
* @param code Code.
|
|
866
|
+
* @param index Index.
|
|
867
|
+
* @returns Line and column.
|
|
868
|
+
*/
|
|
869
|
+
private getLineAndColumn(code: string, index: number): { line: number; column: number } {
|
|
870
|
+
const lines = code.substring(0, index).split('\n');
|
|
871
|
+
const line = lines.length;
|
|
872
|
+
const column = lines[lines.length - 1].length;
|
|
873
|
+
return { line, column };
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Get the non-space preceding token.
|
|
878
|
+
*
|
|
879
|
+
* @param code Code.
|
|
880
|
+
* @param index Index.
|
|
881
|
+
* @returns Non-space preceding token.
|
|
882
|
+
*/
|
|
883
|
+
private getNonSpacePrecedingToken(code: string, index: number): string {
|
|
884
|
+
index--;
|
|
885
|
+
let nonSpacePrecedingToken = code[index];
|
|
886
|
+
|
|
887
|
+
while (
|
|
888
|
+
nonSpacePrecedingToken === ' ' ||
|
|
889
|
+
nonSpacePrecedingToken === '\n' ||
|
|
890
|
+
nonSpacePrecedingToken === '\t'
|
|
891
|
+
) {
|
|
892
|
+
index--;
|
|
893
|
+
nonSpacePrecedingToken = code[index];
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
return nonSpacePrecedingToken || ';';
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Remove multiline comments.
|
|
901
|
+
*
|
|
902
|
+
* @param code Code.
|
|
903
|
+
* @returns Code without multiline comments.
|
|
904
|
+
*/
|
|
905
|
+
private removeMultilineComments(code: string): string {
|
|
906
|
+
const regexp = new RegExp(MULTILINE_COMMENT_REGEXP);
|
|
907
|
+
let match: RegExpExecArray | null;
|
|
908
|
+
let count = 0;
|
|
909
|
+
let lastIndex = 0;
|
|
910
|
+
let newCode = '';
|
|
911
|
+
|
|
912
|
+
while ((match = regexp.exec(code))) {
|
|
913
|
+
if (count === 0) {
|
|
914
|
+
newCode += code.substring(lastIndex, match.index);
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
if (match[0] === '/*') {
|
|
918
|
+
count++;
|
|
919
|
+
} else if (match[0] === '*/' && count > 0) {
|
|
920
|
+
count--;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
lastIndex = regexp.lastIndex;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
newCode += code.substring(lastIndex);
|
|
927
|
+
|
|
928
|
+
return newCode;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Resets the compiler state.
|
|
933
|
+
*/
|
|
934
|
+
private reset(): void {
|
|
935
|
+
this.count = {
|
|
936
|
+
comment: 0,
|
|
937
|
+
singleLineComment: 0,
|
|
938
|
+
parentheses: 0,
|
|
939
|
+
curlyBraces: 0,
|
|
940
|
+
squareBrackets: 0,
|
|
941
|
+
regExp: 0,
|
|
942
|
+
regExpSquareBrackets: 0,
|
|
943
|
+
escapeTemplateString: 0,
|
|
944
|
+
simpleString: 0,
|
|
945
|
+
doubleString: 0
|
|
946
|
+
};
|
|
947
|
+
this.debugCount = {
|
|
948
|
+
comment: [],
|
|
949
|
+
singleLineComment: [],
|
|
950
|
+
parentheses: [],
|
|
951
|
+
curlyBraces: [],
|
|
952
|
+
squareBrackets: [],
|
|
953
|
+
regExp: [],
|
|
954
|
+
regExpSquareBrackets: [],
|
|
955
|
+
escapeTemplateString: [],
|
|
956
|
+
simpleString: [],
|
|
957
|
+
doubleString: []
|
|
958
|
+
};
|
|
959
|
+
this.templateString = [];
|
|
960
|
+
}
|
|
961
|
+
}
|