chrome-devtools-frontend 1.0.1626437 → 1.0.1628368
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/front_end/core/common/VersionController.ts +33 -1
- package/front_end/core/host/UserMetrics.ts +11 -8
- package/front_end/core/root/ExperimentNames.ts +1 -3
- package/front_end/core/sdk/CSSContainerQuery.ts +3 -1
- package/front_end/core/sdk/CSSModel.ts +23 -0
- package/front_end/core/sdk/HeapProfilerModel.ts +1 -11
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +2 -1
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +2 -4
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +3 -2
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +13 -0
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -1
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +4 -36
- package/front_end/generated/InspectorBackendCommands.ts +4 -3
- package/front_end/generated/protocol-mapping.d.ts +5 -0
- package/front_end/generated/protocol-proxy-api.d.ts +4 -0
- package/front_end/generated/protocol.ts +22 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +11 -5
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/models/lighthouse/RunTypes.ts +1 -1
- package/front_end/models/workspace/UISourceCode.ts +0 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -3
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +9 -0
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +2 -2
- package/front_end/panels/elements/StylePropertiesSection.ts +6 -2
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +8 -7
- package/front_end/panels/emulation/DeviceModeToolbar.ts +20 -26
- package/front_end/panels/emulation/DeviceModeView.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseController.ts +18 -0
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +9 -4
- package/front_end/panels/profiler/profiler-meta.ts +0 -71
- package/front_end/panels/profiler/profiler.ts +0 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +7 -6
- package/front_end/panels/sources/ProfilePlugin.ts +12 -65
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -2
- package/front_end/panels/timeline/TimelineController.ts +1 -2
- package/front_end/panels/timeline/TimelinePanel.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -10
- package/front_end/panels/timeline/timeline-meta.ts +26 -0
- package/front_end/third_party/acorn/README.chromium +1 -1
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/third_party/acorn/package/CHANGELOG.md +128 -0
- package/front_end/third_party/acorn/package/README.md +42 -19
- package/front_end/third_party/acorn/package/dist/acorn.d.mts +883 -26
- package/front_end/third_party/acorn/package/dist/acorn.d.ts +859 -268
- package/front_end/third_party/acorn/package/dist/acorn.js +420 -115
- package/front_end/third_party/acorn/package/dist/acorn.mjs +420 -115
- package/front_end/third_party/acorn/package/dist/bin.js +1 -1
- package/front_end/third_party/acorn/package/package.json +3 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +4213 -4208
- package/front_end/third_party/lighthouse/locales/en-US.json +26 -8
- package/front_end/third_party/lighthouse/locales/en-XL.json +26 -8
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/JSHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +2 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +9 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +6 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ScreenRecorder.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +23 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +171 -149
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/JSHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +2 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +6 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ScreenRecorder.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +23 -2
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +6 -7
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +4 -3
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +21 -1
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +9 -4
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +2 -1
- package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +9 -5
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/cdp/IsolatedWorld.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +19 -3
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +10 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -1
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +8 -1
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +0 -56
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -35
- package/front_end/ui/legacy/components/perf_ui/perf_ui.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/profiler/LiveHeapProfileView.ts +0 -405
- package/front_end/panels/profiler/liveHeapProfile.css +0 -22
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +0 -113
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
7
|
// This file was generated. Do not modify manually!
|
|
8
|
-
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9,
|
|
8
|
+
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
9
9
|
|
|
10
10
|
// This file was generated. Do not modify manually!
|
|
11
|
-
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1,
|
|
11
|
+
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
|
|
12
12
|
|
|
13
13
|
// This file was generated. Do not modify manually!
|
|
14
|
-
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\
|
|
14
|
+
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1add\u1ae0-\u1aeb\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";
|
|
15
15
|
|
|
16
16
|
// This file was generated. Do not modify manually!
|
|
17
|
-
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\
|
|
17
|
+
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088f\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7dc\ua7f1-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
|
18
18
|
|
|
19
19
|
// These are a run-length and offset encoded representation of the
|
|
20
20
|
// >0xffff code points that are a valid part of identifiers. The
|
|
@@ -279,8 +279,10 @@
|
|
|
279
279
|
toString.call(obj) === "[object Array]"
|
|
280
280
|
); });
|
|
281
281
|
|
|
282
|
+
var regexpCache = Object.create(null);
|
|
283
|
+
|
|
282
284
|
function wordsRegexp(words) {
|
|
283
|
-
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
|
|
285
|
+
return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"))
|
|
284
286
|
}
|
|
285
287
|
|
|
286
288
|
function codePointToString(code) {
|
|
@@ -337,14 +339,14 @@
|
|
|
337
339
|
// for new syntax features.
|
|
338
340
|
ecmaVersion: null,
|
|
339
341
|
// `sourceType` indicates the mode the code should be parsed in.
|
|
340
|
-
// Can be either `"script"` or `"
|
|
342
|
+
// Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
|
|
341
343
|
// strict mode and parsing of `import` and `export` declarations.
|
|
342
344
|
sourceType: "script",
|
|
343
|
-
// `onInsertedSemicolon` can be a callback that will be called
|
|
344
|
-
//
|
|
345
|
-
//
|
|
346
|
-
// enabled, it is given the location as a `{line,
|
|
347
|
-
// as second argument.
|
|
345
|
+
// `onInsertedSemicolon` can be a callback that will be called when
|
|
346
|
+
// a semicolon is automatically inserted. It will be passed the
|
|
347
|
+
// position of the inserted semicolon as an offset, and if
|
|
348
|
+
// `locations` is enabled, it is given the location as a `{line,
|
|
349
|
+
// column}` object as second argument.
|
|
348
350
|
onInsertedSemicolon: null,
|
|
349
351
|
// `onTrailingComma` is similar to `onInsertedSemicolon`, but for
|
|
350
352
|
// trailing commas.
|
|
@@ -397,6 +399,8 @@
|
|
|
397
399
|
// passed, the full `{line, column}` locations of the start and
|
|
398
400
|
// end of the comments. Note that you are not allowed to call the
|
|
399
401
|
// parser from the callback—that will corrupt its internal state.
|
|
402
|
+
// When this option has an array as value, objects representing the
|
|
403
|
+
// comments are pushed to it.
|
|
400
404
|
onComment: null,
|
|
401
405
|
// Nodes have their start and end characters offsets recorded in
|
|
402
406
|
// `start` and `end` properties (directly on the node, rather than
|
|
@@ -459,6 +463,9 @@
|
|
|
459
463
|
if (isArray(options.onComment))
|
|
460
464
|
{ options.onComment = pushComment(options, options.onComment); }
|
|
461
465
|
|
|
466
|
+
if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction)
|
|
467
|
+
{ throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs") }
|
|
468
|
+
|
|
462
469
|
return options
|
|
463
470
|
}
|
|
464
471
|
|
|
@@ -489,6 +496,8 @@
|
|
|
489
496
|
SCOPE_SUPER = 64,
|
|
490
497
|
SCOPE_DIRECT_SUPER = 128,
|
|
491
498
|
SCOPE_CLASS_STATIC_BLOCK = 256,
|
|
499
|
+
SCOPE_CLASS_FIELD_INIT = 512,
|
|
500
|
+
SCOPE_SWITCH = 1024,
|
|
492
501
|
SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
493
502
|
|
|
494
503
|
function functionFlags(async, generator) {
|
|
@@ -578,7 +587,12 @@
|
|
|
578
587
|
|
|
579
588
|
// Scope tracking for duplicate variable names (see scope.js)
|
|
580
589
|
this.scopeStack = [];
|
|
581
|
-
this.enterScope(
|
|
590
|
+
this.enterScope(
|
|
591
|
+
this.options.sourceType === "commonjs"
|
|
592
|
+
// In commonjs, the top-level scope behaves like a function scope
|
|
593
|
+
? SCOPE_FUNCTION
|
|
594
|
+
: SCOPE_TOP
|
|
595
|
+
);
|
|
582
596
|
|
|
583
597
|
// For RegExp validation
|
|
584
598
|
this.regexpState = null;
|
|
@@ -589,7 +603,7 @@
|
|
|
589
603
|
this.privateNameStack = [];
|
|
590
604
|
};
|
|
591
605
|
|
|
592
|
-
var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } };
|
|
606
|
+
var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowReturn: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },allowUsing: { configurable: true },inClassStaticBlock: { configurable: true } };
|
|
593
607
|
|
|
594
608
|
Parser.prototype.parse = function parse () {
|
|
595
609
|
var node = this.options.program || this.startNode();
|
|
@@ -599,24 +613,30 @@
|
|
|
599
613
|
|
|
600
614
|
prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
|
|
601
615
|
|
|
602
|
-
prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0
|
|
616
|
+
prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
|
|
603
617
|
|
|
604
|
-
prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0
|
|
618
|
+
prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
|
|
605
619
|
|
|
606
620
|
prototypeAccessors.canAwait.get = function () {
|
|
607
621
|
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
608
|
-
var
|
|
609
|
-
|
|
610
|
-
if (
|
|
622
|
+
var ref = this.scopeStack[i];
|
|
623
|
+
var flags = ref.flags;
|
|
624
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false }
|
|
625
|
+
if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 }
|
|
611
626
|
}
|
|
612
627
|
return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
|
|
613
628
|
};
|
|
614
629
|
|
|
630
|
+
prototypeAccessors.allowReturn.get = function () {
|
|
631
|
+
if (this.inFunction) { return true }
|
|
632
|
+
if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) { return true }
|
|
633
|
+
return false
|
|
634
|
+
};
|
|
635
|
+
|
|
615
636
|
prototypeAccessors.allowSuper.get = function () {
|
|
616
637
|
var ref = this.currentThisScope();
|
|
617
638
|
var flags = ref.flags;
|
|
618
|
-
|
|
619
|
-
return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod
|
|
639
|
+
return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod
|
|
620
640
|
};
|
|
621
641
|
|
|
622
642
|
prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
|
|
@@ -624,10 +644,21 @@
|
|
|
624
644
|
prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
|
|
625
645
|
|
|
626
646
|
prototypeAccessors.allowNewDotTarget.get = function () {
|
|
627
|
-
var
|
|
647
|
+
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
648
|
+
var ref = this.scopeStack[i];
|
|
649
|
+
var flags = ref.flags;
|
|
650
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||
|
|
651
|
+
((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true }
|
|
652
|
+
}
|
|
653
|
+
return false
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
prototypeAccessors.allowUsing.get = function () {
|
|
657
|
+
var ref = this.currentScope();
|
|
628
658
|
var flags = ref.flags;
|
|
629
|
-
|
|
630
|
-
|
|
659
|
+
if (flags & SCOPE_SWITCH) { return false }
|
|
660
|
+
if (!this.inModule && flags & SCOPE_TOP) { return false }
|
|
661
|
+
return true
|
|
631
662
|
};
|
|
632
663
|
|
|
633
664
|
prototypeAccessors.inClassStaticBlock.get = function () {
|
|
@@ -663,7 +694,7 @@
|
|
|
663
694
|
|
|
664
695
|
// ## Parser utilities
|
|
665
696
|
|
|
666
|
-
var literal = /^(?:'((
|
|
697
|
+
var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
667
698
|
pp$9.strictDirective = function(start) {
|
|
668
699
|
if (this.options.ecmaVersion < 5) { return false }
|
|
669
700
|
for (;;) {
|
|
@@ -834,7 +865,7 @@
|
|
|
834
865
|
} }
|
|
835
866
|
this.adaptDirectivePrologue(node.body);
|
|
836
867
|
this.next();
|
|
837
|
-
node.sourceType = this.options.sourceType;
|
|
868
|
+
node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
|
|
838
869
|
return this.finishNode(node, "Program")
|
|
839
870
|
};
|
|
840
871
|
|
|
@@ -844,20 +875,21 @@
|
|
|
844
875
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
|
|
845
876
|
skipWhiteSpace.lastIndex = this.pos;
|
|
846
877
|
var skip = skipWhiteSpace.exec(this.input);
|
|
847
|
-
var next = this.pos + skip[0].length, nextCh = this.
|
|
878
|
+
var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);
|
|
848
879
|
// For ambiguous cases, determine if a LexicalDeclaration (or only a
|
|
849
880
|
// Statement) is allowed here. If context is not empty then only a Statement
|
|
850
881
|
// is allowed. However, `let [` is an explicit negative lookahead for
|
|
851
882
|
// ExpressionStatement, so special-case it first.
|
|
852
|
-
if (nextCh === 91 || nextCh === 92) { return true } // '[', '
|
|
883
|
+
if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
|
|
853
884
|
if (context) { return false }
|
|
854
885
|
|
|
855
|
-
if (nextCh === 123
|
|
856
|
-
if (isIdentifierStart(nextCh
|
|
857
|
-
var
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
886
|
+
if (nextCh === 123) { return true } // '{'
|
|
887
|
+
if (isIdentifierStart(nextCh)) {
|
|
888
|
+
var start = next;
|
|
889
|
+
do { next += nextCh <= 0xffff ? 1 : 2; }
|
|
890
|
+
while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)))
|
|
891
|
+
if (nextCh === 92) { return true }
|
|
892
|
+
var ident = this.input.slice(start, next);
|
|
861
893
|
if (!keywordRelationalOperator.test(ident)) { return true }
|
|
862
894
|
}
|
|
863
895
|
return false
|
|
@@ -876,7 +908,50 @@
|
|
|
876
908
|
return !lineBreak.test(this.input.slice(this.pos, next)) &&
|
|
877
909
|
this.input.slice(next, next + 8) === "function" &&
|
|
878
910
|
(next + 8 === this.input.length ||
|
|
879
|
-
!(isIdentifierChar(after = this.
|
|
911
|
+
!(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92 /* '\' */))
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
915
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using"))
|
|
916
|
+
{ return false }
|
|
917
|
+
|
|
918
|
+
skipWhiteSpace.lastIndex = this.pos;
|
|
919
|
+
var skip = skipWhiteSpace.exec(this.input);
|
|
920
|
+
var next = this.pos + skip[0].length;
|
|
921
|
+
|
|
922
|
+
if (lineBreak.test(this.input.slice(this.pos, next))) { return false }
|
|
923
|
+
|
|
924
|
+
if (isAwaitUsing) {
|
|
925
|
+
var usingEndPos = next + 5 /* using */, after;
|
|
926
|
+
if (this.input.slice(next, usingEndPos) !== "using" ||
|
|
927
|
+
usingEndPos === this.input.length ||
|
|
928
|
+
isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) ||
|
|
929
|
+
after === 92 /* '\' */
|
|
930
|
+
) { return false }
|
|
931
|
+
|
|
932
|
+
skipWhiteSpace.lastIndex = usingEndPos;
|
|
933
|
+
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
934
|
+
next = usingEndPos + skipAfterUsing[0].length;
|
|
935
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) { return false }
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
var ch = this.fullCharCodeAt(next);
|
|
939
|
+
if (!isIdentifierStart(ch) && ch !== 92 /* '\' */) { return false }
|
|
940
|
+
var idStart = next;
|
|
941
|
+
do { next += ch <= 0xffff ? 1 : 2; }
|
|
942
|
+
while (isIdentifierChar(ch = this.fullCharCodeAt(next)))
|
|
943
|
+
if (ch === 92) { return true }
|
|
944
|
+
var id = this.input.slice(idStart, next);
|
|
945
|
+
if (keywordRelationalOperator.test(id) || isFor && id === "of") { return false }
|
|
946
|
+
return true
|
|
947
|
+
};
|
|
948
|
+
|
|
949
|
+
pp$8.isAwaitUsing = function(isFor) {
|
|
950
|
+
return this.isUsingKeyword(true, isFor)
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
pp$8.isUsing = function(isFor) {
|
|
954
|
+
return this.isUsingKeyword(false, isFor)
|
|
880
955
|
};
|
|
881
956
|
|
|
882
957
|
// Parse a single statement.
|
|
@@ -955,6 +1030,23 @@
|
|
|
955
1030
|
return this.parseFunctionStatement(node, true, !context)
|
|
956
1031
|
}
|
|
957
1032
|
|
|
1033
|
+
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
1034
|
+
if (usingKind) {
|
|
1035
|
+
if (!this.allowUsing) {
|
|
1036
|
+
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
|
|
1037
|
+
}
|
|
1038
|
+
if (usingKind === "await using") {
|
|
1039
|
+
if (!this.canAwait) {
|
|
1040
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
1041
|
+
}
|
|
1042
|
+
this.next();
|
|
1043
|
+
}
|
|
1044
|
+
this.next();
|
|
1045
|
+
this.parseVar(node, false, usingKind);
|
|
1046
|
+
this.semicolon();
|
|
1047
|
+
return this.finishNode(node, "VariableDeclaration")
|
|
1048
|
+
}
|
|
1049
|
+
|
|
958
1050
|
var maybeName = this.value, expr = this.parseExpression();
|
|
959
1051
|
if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
|
|
960
1052
|
{ return this.parseLabeledStatement(node, maybeName, expr, context) }
|
|
@@ -1030,25 +1122,37 @@
|
|
|
1030
1122
|
this.next();
|
|
1031
1123
|
this.parseVar(init$1, true, kind);
|
|
1032
1124
|
this.finishNode(init$1, "VariableDeclaration");
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1125
|
+
return this.parseForAfterInit(node, init$1, awaitAt)
|
|
1126
|
+
}
|
|
1127
|
+
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
1128
|
+
|
|
1129
|
+
var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
|
|
1130
|
+
if (usingKind) {
|
|
1131
|
+
var init$2 = this.startNode();
|
|
1132
|
+
this.next();
|
|
1133
|
+
if (usingKind === "await using") {
|
|
1134
|
+
if (!this.canAwait) {
|
|
1135
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
1038
1136
|
}
|
|
1039
|
-
|
|
1137
|
+
this.next();
|
|
1040
1138
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1139
|
+
this.parseVar(init$2, true, usingKind);
|
|
1140
|
+
this.finishNode(init$2, "VariableDeclaration");
|
|
1141
|
+
return this.parseForAfterInit(node, init$2, awaitAt)
|
|
1043
1142
|
}
|
|
1044
|
-
var
|
|
1143
|
+
var containsEsc = this.containsEsc;
|
|
1045
1144
|
var refDestructuringErrors = new DestructuringErrors;
|
|
1046
|
-
var
|
|
1145
|
+
var initPos = this.start;
|
|
1146
|
+
var init = awaitAt > -1
|
|
1147
|
+
? this.parseExprSubscripts(refDestructuringErrors, "await")
|
|
1148
|
+
: this.parseExpression(true, refDestructuringErrors);
|
|
1047
1149
|
if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
1048
|
-
if (
|
|
1049
|
-
if (this.type === types$1._in) {
|
|
1050
|
-
|
|
1051
|
-
|
|
1150
|
+
if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
|
|
1151
|
+
if (this.type === types$1._in) { this.unexpected(awaitAt); }
|
|
1152
|
+
node.await = true;
|
|
1153
|
+
} else if (isForOf && this.options.ecmaVersion >= 8) {
|
|
1154
|
+
if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
|
|
1155
|
+
else if (this.options.ecmaVersion >= 9) { node.await = false; }
|
|
1052
1156
|
}
|
|
1053
1157
|
if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
|
|
1054
1158
|
this.toAssignable(init, false, refDestructuringErrors);
|
|
@@ -1061,6 +1165,20 @@
|
|
|
1061
1165
|
return this.parseFor(node, init)
|
|
1062
1166
|
};
|
|
1063
1167
|
|
|
1168
|
+
// Helper method to parse for loop after variable initialization
|
|
1169
|
+
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
1170
|
+
if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) {
|
|
1171
|
+
if (this.options.ecmaVersion >= 9) {
|
|
1172
|
+
if (this.type === types$1._in) {
|
|
1173
|
+
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
1174
|
+
} else { node.await = awaitAt > -1; }
|
|
1175
|
+
}
|
|
1176
|
+
return this.parseForIn(node, init)
|
|
1177
|
+
}
|
|
1178
|
+
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
1179
|
+
return this.parseFor(node, init)
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1064
1182
|
pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
|
|
1065
1183
|
this.next();
|
|
1066
1184
|
return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
|
|
@@ -1076,7 +1194,7 @@
|
|
|
1076
1194
|
};
|
|
1077
1195
|
|
|
1078
1196
|
pp$8.parseReturnStatement = function(node) {
|
|
1079
|
-
if (!this.
|
|
1197
|
+
if (!this.allowReturn)
|
|
1080
1198
|
{ this.raise(this.start, "'return' outside of function"); }
|
|
1081
1199
|
this.next();
|
|
1082
1200
|
|
|
@@ -1095,7 +1213,7 @@
|
|
|
1095
1213
|
node.cases = [];
|
|
1096
1214
|
this.expect(types$1.braceL);
|
|
1097
1215
|
this.labels.push(switchLabel);
|
|
1098
|
-
this.enterScope(
|
|
1216
|
+
this.enterScope(SCOPE_SWITCH);
|
|
1099
1217
|
|
|
1100
1218
|
// Statements under must be grouped (by label) in SwitchCase
|
|
1101
1219
|
// nodes. `cur` is used to keep the node that we are currently
|
|
@@ -1317,6 +1435,8 @@
|
|
|
1317
1435
|
decl.init = this.parseMaybeAssign(isFor);
|
|
1318
1436
|
} else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
|
|
1319
1437
|
this.unexpected();
|
|
1438
|
+
} else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) {
|
|
1439
|
+
this.raise(this.lastTokEnd, ("Missing initializer in " + kind + " declaration"));
|
|
1320
1440
|
} else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
|
|
1321
1441
|
this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
|
|
1322
1442
|
} else {
|
|
@@ -1329,7 +1449,10 @@
|
|
|
1329
1449
|
};
|
|
1330
1450
|
|
|
1331
1451
|
pp$8.parseVarId = function(decl, kind) {
|
|
1332
|
-
decl.id =
|
|
1452
|
+
decl.id = kind === "using" || kind === "await using"
|
|
1453
|
+
? this.parseIdent()
|
|
1454
|
+
: this.parseBindingAtom();
|
|
1455
|
+
|
|
1333
1456
|
this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
|
|
1334
1457
|
};
|
|
1335
1458
|
|
|
@@ -1548,11 +1671,9 @@
|
|
|
1548
1671
|
|
|
1549
1672
|
if (this.eat(types$1.eq)) {
|
|
1550
1673
|
// To raise SyntaxError if 'arguments' exists in the initializer.
|
|
1551
|
-
|
|
1552
|
-
var inClassFieldInit = scope.inClassFieldInit;
|
|
1553
|
-
scope.inClassFieldInit = true;
|
|
1674
|
+
this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
|
|
1554
1675
|
field.value = this.parseMaybeAssign();
|
|
1555
|
-
|
|
1676
|
+
this.exitScope();
|
|
1556
1677
|
} else {
|
|
1557
1678
|
field.value = null;
|
|
1558
1679
|
}
|
|
@@ -1668,6 +1789,8 @@
|
|
|
1668
1789
|
this.expectContextual("from");
|
|
1669
1790
|
if (this.type !== types$1.string) { this.unexpected(); }
|
|
1670
1791
|
node.source = this.parseExprAtom();
|
|
1792
|
+
if (this.options.ecmaVersion >= 16)
|
|
1793
|
+
{ node.attributes = this.parseWithClause(); }
|
|
1671
1794
|
this.semicolon();
|
|
1672
1795
|
return this.finishNode(node, "ExportAllDeclaration")
|
|
1673
1796
|
};
|
|
@@ -1692,12 +1815,16 @@
|
|
|
1692
1815
|
{ this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
|
|
1693
1816
|
node.specifiers = [];
|
|
1694
1817
|
node.source = null;
|
|
1818
|
+
if (this.options.ecmaVersion >= 16)
|
|
1819
|
+
{ node.attributes = []; }
|
|
1695
1820
|
} else { // export { x, y as z } [from '...']
|
|
1696
1821
|
node.declaration = null;
|
|
1697
1822
|
node.specifiers = this.parseExportSpecifiers(exports);
|
|
1698
1823
|
if (this.eatContextual("from")) {
|
|
1699
1824
|
if (this.type !== types$1.string) { this.unexpected(); }
|
|
1700
1825
|
node.source = this.parseExprAtom();
|
|
1826
|
+
if (this.options.ecmaVersion >= 16)
|
|
1827
|
+
{ node.attributes = this.parseWithClause(); }
|
|
1701
1828
|
} else {
|
|
1702
1829
|
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
|
|
1703
1830
|
// check for keywords used as local names
|
|
@@ -1713,6 +1840,8 @@
|
|
|
1713
1840
|
}
|
|
1714
1841
|
|
|
1715
1842
|
node.source = null;
|
|
1843
|
+
if (this.options.ecmaVersion >= 16)
|
|
1844
|
+
{ node.attributes = []; }
|
|
1716
1845
|
}
|
|
1717
1846
|
this.semicolon();
|
|
1718
1847
|
}
|
|
@@ -1772,8 +1901,6 @@
|
|
|
1772
1901
|
{ this.checkPatternExport(exports, pat.left); }
|
|
1773
1902
|
else if (type === "RestElement")
|
|
1774
1903
|
{ this.checkPatternExport(exports, pat.argument); }
|
|
1775
|
-
else if (type === "ParenthesizedExpression")
|
|
1776
|
-
{ this.checkPatternExport(exports, pat.expression); }
|
|
1777
1904
|
};
|
|
1778
1905
|
|
|
1779
1906
|
pp$8.checkVariableExport = function(exports, decls) {
|
|
@@ -1840,6 +1967,8 @@
|
|
|
1840
1967
|
this.expectContextual("from");
|
|
1841
1968
|
node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
|
|
1842
1969
|
}
|
|
1970
|
+
if (this.options.ecmaVersion >= 16)
|
|
1971
|
+
{ node.attributes = this.parseWithClause(); }
|
|
1843
1972
|
this.semicolon();
|
|
1844
1973
|
return this.finishNode(node, "ImportDeclaration")
|
|
1845
1974
|
};
|
|
@@ -1900,6 +2029,41 @@
|
|
|
1900
2029
|
return nodes
|
|
1901
2030
|
};
|
|
1902
2031
|
|
|
2032
|
+
pp$8.parseWithClause = function() {
|
|
2033
|
+
var nodes = [];
|
|
2034
|
+
if (!this.eat(types$1._with)) {
|
|
2035
|
+
return nodes
|
|
2036
|
+
}
|
|
2037
|
+
this.expect(types$1.braceL);
|
|
2038
|
+
var attributeKeys = {};
|
|
2039
|
+
var first = true;
|
|
2040
|
+
while (!this.eat(types$1.braceR)) {
|
|
2041
|
+
if (!first) {
|
|
2042
|
+
this.expect(types$1.comma);
|
|
2043
|
+
if (this.afterTrailingComma(types$1.braceR)) { break }
|
|
2044
|
+
} else { first = false; }
|
|
2045
|
+
|
|
2046
|
+
var attr = this.parseImportAttribute();
|
|
2047
|
+
var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
|
|
2048
|
+
if (hasOwn(attributeKeys, keyName))
|
|
2049
|
+
{ this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
|
|
2050
|
+
attributeKeys[keyName] = true;
|
|
2051
|
+
nodes.push(attr);
|
|
2052
|
+
}
|
|
2053
|
+
return nodes
|
|
2054
|
+
};
|
|
2055
|
+
|
|
2056
|
+
pp$8.parseImportAttribute = function() {
|
|
2057
|
+
var node = this.startNode();
|
|
2058
|
+
node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2059
|
+
this.expect(types$1.colon);
|
|
2060
|
+
if (this.type !== types$1.string) {
|
|
2061
|
+
this.unexpected();
|
|
2062
|
+
}
|
|
2063
|
+
node.value = this.parseExprAtom();
|
|
2064
|
+
return this.finishNode(node, "ImportAttribute")
|
|
2065
|
+
};
|
|
2066
|
+
|
|
1903
2067
|
pp$8.parseModuleExportName = function() {
|
|
1904
2068
|
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
|
|
1905
2069
|
var stringLiteral = this.parseLiteral(this.value);
|
|
@@ -2337,7 +2501,7 @@
|
|
|
2337
2501
|
{ this.exprAllowed = type.beforeExpr; }
|
|
2338
2502
|
};
|
|
2339
2503
|
|
|
2340
|
-
// Used to handle
|
|
2504
|
+
// Used to handle edge cases when token context could not be inferred correctly during tokenization phase
|
|
2341
2505
|
|
|
2342
2506
|
pp$6.overrideContext = function(tokenCtx) {
|
|
2343
2507
|
if (this.curContext() !== tokenCtx) {
|
|
@@ -2390,6 +2554,11 @@
|
|
|
2390
2554
|
this.exprAllowed = false;
|
|
2391
2555
|
};
|
|
2392
2556
|
|
|
2557
|
+
types$1.colon.updateContext = function() {
|
|
2558
|
+
if (this.curContext().token === "function") { this.context.pop(); }
|
|
2559
|
+
this.exprAllowed = true;
|
|
2560
|
+
};
|
|
2561
|
+
|
|
2393
2562
|
types$1.backQuote.updateContext = function() {
|
|
2394
2563
|
if (this.curContext() === types.q_tmpl)
|
|
2395
2564
|
{ this.context.pop(); }
|
|
@@ -2658,8 +2827,7 @@
|
|
|
2658
2827
|
node.argument = this.parseMaybeUnary(null, true, update, forInit);
|
|
2659
2828
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
2660
2829
|
if (update) { this.checkLValSimple(node.argument); }
|
|
2661
|
-
else if (this.strict && node.operator === "delete" &&
|
|
2662
|
-
node.argument.type === "Identifier")
|
|
2830
|
+
else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
|
|
2663
2831
|
{ this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
|
|
2664
2832
|
else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
|
|
2665
2833
|
{ this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
|
|
@@ -2694,10 +2862,18 @@
|
|
|
2694
2862
|
}
|
|
2695
2863
|
};
|
|
2696
2864
|
|
|
2865
|
+
function isLocalVariableAccess(node) {
|
|
2866
|
+
return (
|
|
2867
|
+
node.type === "Identifier" ||
|
|
2868
|
+
node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
|
|
2869
|
+
)
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2697
2872
|
function isPrivateFieldAccess(node) {
|
|
2698
2873
|
return (
|
|
2699
2874
|
node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
|
|
2700
|
-
node.type === "ChainExpression" && isPrivateFieldAccess(node.expression)
|
|
2875
|
+
node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
|
|
2876
|
+
node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
|
|
2701
2877
|
)
|
|
2702
2878
|
}
|
|
2703
2879
|
|
|
@@ -2935,12 +3111,14 @@
|
|
|
2935
3111
|
// Consume `import` as an identifier for `import.meta`.
|
|
2936
3112
|
// Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
|
|
2937
3113
|
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
|
|
2938
|
-
|
|
3114
|
+
this.next();
|
|
2939
3115
|
|
|
2940
3116
|
if (this.type === types$1.parenL && !forNew) {
|
|
2941
3117
|
return this.parseDynamicImport(node)
|
|
2942
3118
|
} else if (this.type === types$1.dot) {
|
|
2943
|
-
|
|
3119
|
+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
3120
|
+
meta.name = "import";
|
|
3121
|
+
node.meta = this.finishNode(meta, "Identifier");
|
|
2944
3122
|
return this.parseImportMeta(node)
|
|
2945
3123
|
} else {
|
|
2946
3124
|
this.unexpected();
|
|
@@ -2953,13 +3131,32 @@
|
|
|
2953
3131
|
// Parse node.source.
|
|
2954
3132
|
node.source = this.parseMaybeAssign();
|
|
2955
3133
|
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
3134
|
+
if (this.options.ecmaVersion >= 16) {
|
|
3135
|
+
if (!this.eat(types$1.parenR)) {
|
|
3136
|
+
this.expect(types$1.comma);
|
|
3137
|
+
if (!this.afterTrailingComma(types$1.parenR)) {
|
|
3138
|
+
node.options = this.parseMaybeAssign();
|
|
3139
|
+
if (!this.eat(types$1.parenR)) {
|
|
3140
|
+
this.expect(types$1.comma);
|
|
3141
|
+
if (!this.afterTrailingComma(types$1.parenR)) {
|
|
3142
|
+
this.unexpected();
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
} else {
|
|
3146
|
+
node.options = null;
|
|
3147
|
+
}
|
|
2961
3148
|
} else {
|
|
2962
|
-
|
|
3149
|
+
node.options = null;
|
|
3150
|
+
}
|
|
3151
|
+
} else {
|
|
3152
|
+
// Verify ending.
|
|
3153
|
+
if (!this.eat(types$1.parenR)) {
|
|
3154
|
+
var errorPos = this.start;
|
|
3155
|
+
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
|
|
3156
|
+
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
|
|
3157
|
+
} else {
|
|
3158
|
+
this.unexpected(errorPos);
|
|
3159
|
+
}
|
|
2963
3160
|
}
|
|
2964
3161
|
}
|
|
2965
3162
|
|
|
@@ -2986,7 +3183,8 @@
|
|
|
2986
3183
|
var node = this.startNode();
|
|
2987
3184
|
node.value = value;
|
|
2988
3185
|
node.raw = this.input.slice(this.start, this.end);
|
|
2989
|
-
if (node.raw.charCodeAt(node.raw.length - 1) === 110)
|
|
3186
|
+
if (node.raw.charCodeAt(node.raw.length - 1) === 110)
|
|
3187
|
+
{ node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, ""); }
|
|
2990
3188
|
this.next();
|
|
2991
3189
|
return this.finishNode(node, "Literal")
|
|
2992
3190
|
};
|
|
@@ -3088,9 +3286,12 @@
|
|
|
3088
3286
|
pp$5.parseNew = function() {
|
|
3089
3287
|
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
|
|
3090
3288
|
var node = this.startNode();
|
|
3091
|
-
|
|
3092
|
-
if (this.options.ecmaVersion >= 6 && this.
|
|
3093
|
-
|
|
3289
|
+
this.next();
|
|
3290
|
+
if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
|
|
3291
|
+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
3292
|
+
meta.name = "new";
|
|
3293
|
+
node.meta = this.finishNode(meta, "Identifier");
|
|
3294
|
+
this.next();
|
|
3094
3295
|
var containsEsc = this.containsEsc;
|
|
3095
3296
|
node.property = this.parseIdent(true);
|
|
3096
3297
|
if (node.property.name !== "target")
|
|
@@ -3119,7 +3320,7 @@
|
|
|
3119
3320
|
this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
3120
3321
|
}
|
|
3121
3322
|
elem.value = {
|
|
3122
|
-
raw: this.value,
|
|
3323
|
+
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
3123
3324
|
cooked: null
|
|
3124
3325
|
};
|
|
3125
3326
|
} else {
|
|
@@ -3221,9 +3422,10 @@
|
|
|
3221
3422
|
};
|
|
3222
3423
|
|
|
3223
3424
|
pp$5.parseGetterSetter = function(prop) {
|
|
3224
|
-
|
|
3425
|
+
var kind = prop.key.name;
|
|
3225
3426
|
this.parsePropertyName(prop);
|
|
3226
3427
|
prop.value = this.parseMethod(false);
|
|
3428
|
+
prop.kind = kind;
|
|
3227
3429
|
var paramCount = prop.kind === "get" ? 0 : 1;
|
|
3228
3430
|
if (prop.value.params.length !== paramCount) {
|
|
3229
3431
|
var start = prop.value.start;
|
|
@@ -3246,9 +3448,9 @@
|
|
|
3246
3448
|
prop.kind = "init";
|
|
3247
3449
|
} else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
|
|
3248
3450
|
if (isPattern) { this.unexpected(); }
|
|
3249
|
-
prop.kind = "init";
|
|
3250
3451
|
prop.method = true;
|
|
3251
3452
|
prop.value = this.parseMethod(isGenerator, isAsync);
|
|
3453
|
+
prop.kind = "init";
|
|
3252
3454
|
} else if (!isPattern && !containsEsc &&
|
|
3253
3455
|
this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
|
|
3254
3456
|
(prop.key.name === "get" || prop.key.name === "set") &&
|
|
@@ -3260,7 +3462,6 @@
|
|
|
3260
3462
|
this.checkUnreserved(prop.key);
|
|
3261
3463
|
if (prop.key.name === "await" && !this.awaitIdentPos)
|
|
3262
3464
|
{ this.awaitIdentPos = startPos; }
|
|
3263
|
-
prop.kind = "init";
|
|
3264
3465
|
if (isPattern) {
|
|
3265
3466
|
prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
|
|
3266
3467
|
} else if (this.type === types$1.eq && refDestructuringErrors) {
|
|
@@ -3270,6 +3471,7 @@
|
|
|
3270
3471
|
} else {
|
|
3271
3472
|
prop.value = this.copyNode(prop.key);
|
|
3272
3473
|
}
|
|
3474
|
+
prop.kind = "init";
|
|
3273
3475
|
prop.shorthand = true;
|
|
3274
3476
|
} else { this.unexpected(); }
|
|
3275
3477
|
};
|
|
@@ -3445,7 +3647,7 @@
|
|
|
3445
3647
|
{ this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
|
|
3446
3648
|
if (this.inAsync && name === "await")
|
|
3447
3649
|
{ this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
|
|
3448
|
-
if (this.currentThisScope().
|
|
3650
|
+
if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments")
|
|
3449
3651
|
{ this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
|
|
3450
3652
|
if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
|
|
3451
3653
|
{ this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
|
|
@@ -3492,6 +3694,7 @@
|
|
|
3492
3694
|
(this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
|
|
3493
3695
|
this.context.pop();
|
|
3494
3696
|
}
|
|
3697
|
+
this.type = types$1.name;
|
|
3495
3698
|
} else {
|
|
3496
3699
|
this.unexpected();
|
|
3497
3700
|
}
|
|
@@ -3557,6 +3760,9 @@
|
|
|
3557
3760
|
pp$4.raise = function(pos, message) {
|
|
3558
3761
|
var loc = getLineInfo(this.input, pos);
|
|
3559
3762
|
message += " (" + loc.line + ":" + loc.column + ")";
|
|
3763
|
+
if (this.sourceFile) {
|
|
3764
|
+
message += " in " + this.sourceFile;
|
|
3765
|
+
}
|
|
3560
3766
|
var err = new SyntaxError(message);
|
|
3561
3767
|
err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
|
|
3562
3768
|
throw err
|
|
@@ -3580,8 +3786,6 @@
|
|
|
3580
3786
|
this.lexical = [];
|
|
3581
3787
|
// A list of lexically-declared FunctionDeclaration names in the current lexical scope
|
|
3582
3788
|
this.functions = [];
|
|
3583
|
-
// A switch to disallow the identifier reference 'arguments'
|
|
3584
|
-
this.inClassFieldInit = false;
|
|
3585
3789
|
};
|
|
3586
3790
|
|
|
3587
3791
|
// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
|
|
@@ -3651,7 +3855,7 @@
|
|
|
3651
3855
|
pp$3.currentVarScope = function() {
|
|
3652
3856
|
for (var i = this.scopeStack.length - 1;; i--) {
|
|
3653
3857
|
var scope = this.scopeStack[i];
|
|
3654
|
-
if (scope.flags & SCOPE_VAR) { return scope }
|
|
3858
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope }
|
|
3655
3859
|
}
|
|
3656
3860
|
};
|
|
3657
3861
|
|
|
@@ -3659,7 +3863,8 @@
|
|
|
3659
3863
|
pp$3.currentThisScope = function() {
|
|
3660
3864
|
for (var i = this.scopeStack.length - 1;; i--) {
|
|
3661
3865
|
var scope = this.scopeStack[i];
|
|
3662
|
-
if (scope.flags & SCOPE_VAR
|
|
3866
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) &&
|
|
3867
|
+
!(scope.flags & SCOPE_ARROW)) { return scope }
|
|
3663
3868
|
}
|
|
3664
3869
|
};
|
|
3665
3870
|
|
|
@@ -3715,6 +3920,9 @@
|
|
|
3715
3920
|
return newNode
|
|
3716
3921
|
};
|
|
3717
3922
|
|
|
3923
|
+
// This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
|
|
3924
|
+
var scriptValuesAddedInUnicode = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz";
|
|
3925
|
+
|
|
3718
3926
|
// This file contains Unicode properties extracted from the ECMAScript specification.
|
|
3719
3927
|
// The lists are extracted like so:
|
|
3720
3928
|
// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
|
|
@@ -3757,7 +3965,7 @@
|
|
|
3757
3965
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
3758
3966
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
3759
3967
|
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
3760
|
-
var ecma14ScriptValues = ecma13ScriptValues + "
|
|
3968
|
+
var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;
|
|
3761
3969
|
|
|
3762
3970
|
var unicodeScriptValues = {
|
|
3763
3971
|
9: ecma9ScriptValues,
|
|
@@ -3793,6 +4001,30 @@
|
|
|
3793
4001
|
|
|
3794
4002
|
var pp$1 = Parser.prototype;
|
|
3795
4003
|
|
|
4004
|
+
// Track disjunction structure to determine whether a duplicate
|
|
4005
|
+
// capture group name is allowed because it is in a separate branch.
|
|
4006
|
+
var BranchID = function BranchID(parent, base) {
|
|
4007
|
+
// Parent disjunction branch
|
|
4008
|
+
this.parent = parent;
|
|
4009
|
+
// Identifies this set of sibling branches
|
|
4010
|
+
this.base = base || this;
|
|
4011
|
+
};
|
|
4012
|
+
|
|
4013
|
+
BranchID.prototype.separatedFrom = function separatedFrom (alt) {
|
|
4014
|
+
// A branch is separate from another branch if they or any of
|
|
4015
|
+
// their parents are siblings in a given disjunction
|
|
4016
|
+
for (var self = this; self; self = self.parent) {
|
|
4017
|
+
for (var other = alt; other; other = other.parent) {
|
|
4018
|
+
if (self.base === other.base && self !== other) { return true }
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
4021
|
+
return false
|
|
4022
|
+
};
|
|
4023
|
+
|
|
4024
|
+
BranchID.prototype.sibling = function sibling () {
|
|
4025
|
+
return new BranchID(this.parent, this.base)
|
|
4026
|
+
};
|
|
4027
|
+
|
|
3796
4028
|
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
3797
4029
|
this.parser = parser;
|
|
3798
4030
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
|
|
@@ -3809,8 +4041,9 @@
|
|
|
3809
4041
|
this.lastAssertionIsQuantifiable = false;
|
|
3810
4042
|
this.numCapturingParens = 0;
|
|
3811
4043
|
this.maxBackReference = 0;
|
|
3812
|
-
this.groupNames =
|
|
4044
|
+
this.groupNames = Object.create(null);
|
|
3813
4045
|
this.backReferenceNames = [];
|
|
4046
|
+
this.branchID = null;
|
|
3814
4047
|
};
|
|
3815
4048
|
|
|
3816
4049
|
RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
|
|
@@ -3942,6 +4175,11 @@
|
|
|
3942
4175
|
}
|
|
3943
4176
|
};
|
|
3944
4177
|
|
|
4178
|
+
function hasProp(obj) {
|
|
4179
|
+
for (var _ in obj) { return true }
|
|
4180
|
+
return false
|
|
4181
|
+
}
|
|
4182
|
+
|
|
3945
4183
|
/**
|
|
3946
4184
|
* Validate the pattern part of a given RegExpLiteral.
|
|
3947
4185
|
*
|
|
@@ -3956,7 +4194,7 @@
|
|
|
3956
4194
|
// |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
|
|
3957
4195
|
// exception if _P_ did not conform to the grammar, if any elements of _P_
|
|
3958
4196
|
// were not matched by the parse, or if any Early Error conditions exist.
|
|
3959
|
-
if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames
|
|
4197
|
+
if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
|
|
3960
4198
|
state.switchN = true;
|
|
3961
4199
|
this.regexp_pattern(state);
|
|
3962
4200
|
}
|
|
@@ -3970,8 +4208,9 @@
|
|
|
3970
4208
|
state.lastAssertionIsQuantifiable = false;
|
|
3971
4209
|
state.numCapturingParens = 0;
|
|
3972
4210
|
state.maxBackReference = 0;
|
|
3973
|
-
state.groupNames
|
|
4211
|
+
state.groupNames = Object.create(null);
|
|
3974
4212
|
state.backReferenceNames.length = 0;
|
|
4213
|
+
state.branchID = null;
|
|
3975
4214
|
|
|
3976
4215
|
this.regexp_disjunction(state);
|
|
3977
4216
|
|
|
@@ -3990,7 +4229,7 @@
|
|
|
3990
4229
|
for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
|
|
3991
4230
|
var name = list[i];
|
|
3992
4231
|
|
|
3993
|
-
if (state.groupNames
|
|
4232
|
+
if (!state.groupNames[name]) {
|
|
3994
4233
|
state.raise("Invalid named capture referenced");
|
|
3995
4234
|
}
|
|
3996
4235
|
}
|
|
@@ -3998,10 +4237,14 @@
|
|
|
3998
4237
|
|
|
3999
4238
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
|
|
4000
4239
|
pp$1.regexp_disjunction = function(state) {
|
|
4240
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
4241
|
+
if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
|
|
4001
4242
|
this.regexp_alternative(state);
|
|
4002
4243
|
while (state.eat(0x7C /* | */)) {
|
|
4244
|
+
if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
|
|
4003
4245
|
this.regexp_alternative(state);
|
|
4004
4246
|
}
|
|
4247
|
+
if (trackDisjunction) { state.branchID = state.branchID.parent; }
|
|
4005
4248
|
|
|
4006
4249
|
// Make the same message as V8.
|
|
4007
4250
|
if (this.regexp_eatQuantifier(state, true)) {
|
|
@@ -4014,8 +4257,7 @@
|
|
|
4014
4257
|
|
|
4015
4258
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
|
|
4016
4259
|
pp$1.regexp_alternative = function(state) {
|
|
4017
|
-
while (state.pos < state.source.length && this.regexp_eatTerm(state))
|
|
4018
|
-
{ }
|
|
4260
|
+
while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
|
|
4019
4261
|
};
|
|
4020
4262
|
|
|
4021
4263
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
|
|
@@ -4148,12 +4390,41 @@
|
|
|
4148
4390
|
pp$1.regexp_eatUncapturingGroup = function(state) {
|
|
4149
4391
|
var start = state.pos;
|
|
4150
4392
|
if (state.eat(0x28 /* ( */)) {
|
|
4151
|
-
if (state.eat(0x3F /* ? */)
|
|
4152
|
-
this.
|
|
4153
|
-
|
|
4154
|
-
|
|
4393
|
+
if (state.eat(0x3F /* ? */)) {
|
|
4394
|
+
if (this.options.ecmaVersion >= 16) {
|
|
4395
|
+
var addModifiers = this.regexp_eatModifiers(state);
|
|
4396
|
+
var hasHyphen = state.eat(0x2D /* - */);
|
|
4397
|
+
if (addModifiers || hasHyphen) {
|
|
4398
|
+
for (var i = 0; i < addModifiers.length; i++) {
|
|
4399
|
+
var modifier = addModifiers.charAt(i);
|
|
4400
|
+
if (addModifiers.indexOf(modifier, i + 1) > -1) {
|
|
4401
|
+
state.raise("Duplicate regular expression modifiers");
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
if (hasHyphen) {
|
|
4405
|
+
var removeModifiers = this.regexp_eatModifiers(state);
|
|
4406
|
+
if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
|
|
4407
|
+
state.raise("Invalid regular expression modifiers");
|
|
4408
|
+
}
|
|
4409
|
+
for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
|
|
4410
|
+
var modifier$1 = removeModifiers.charAt(i$1);
|
|
4411
|
+
if (
|
|
4412
|
+
removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
|
|
4413
|
+
addModifiers.indexOf(modifier$1) > -1
|
|
4414
|
+
) {
|
|
4415
|
+
state.raise("Duplicate regular expression modifiers");
|
|
4416
|
+
}
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
}
|
|
4421
|
+
if (state.eat(0x3A /* : */)) {
|
|
4422
|
+
this.regexp_disjunction(state);
|
|
4423
|
+
if (state.eat(0x29 /* ) */)) {
|
|
4424
|
+
return true
|
|
4425
|
+
}
|
|
4426
|
+
state.raise("Unterminated group");
|
|
4155
4427
|
}
|
|
4156
|
-
state.raise("Unterminated group");
|
|
4157
4428
|
}
|
|
4158
4429
|
state.pos = start;
|
|
4159
4430
|
}
|
|
@@ -4175,6 +4446,23 @@
|
|
|
4175
4446
|
}
|
|
4176
4447
|
return false
|
|
4177
4448
|
};
|
|
4449
|
+
// RegularExpressionModifiers ::
|
|
4450
|
+
// [empty]
|
|
4451
|
+
// RegularExpressionModifiers RegularExpressionModifier
|
|
4452
|
+
pp$1.regexp_eatModifiers = function(state) {
|
|
4453
|
+
var modifiers = "";
|
|
4454
|
+
var ch = 0;
|
|
4455
|
+
while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
|
|
4456
|
+
modifiers += codePointToString(ch);
|
|
4457
|
+
state.advance();
|
|
4458
|
+
}
|
|
4459
|
+
return modifiers
|
|
4460
|
+
};
|
|
4461
|
+
// RegularExpressionModifier :: one of
|
|
4462
|
+
// `i` `m` `s`
|
|
4463
|
+
function isRegularExpressionModifier(ch) {
|
|
4464
|
+
return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
|
|
4465
|
+
}
|
|
4178
4466
|
|
|
4179
4467
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
|
|
4180
4468
|
pp$1.regexp_eatExtendedAtom = function(state) {
|
|
@@ -4253,14 +4541,26 @@
|
|
|
4253
4541
|
// `?` GroupName
|
|
4254
4542
|
pp$1.regexp_groupSpecifier = function(state) {
|
|
4255
4543
|
if (state.eat(0x3F /* ? */)) {
|
|
4256
|
-
if (this.regexp_eatGroupName(state)) {
|
|
4257
|
-
|
|
4544
|
+
if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
|
|
4545
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
4546
|
+
var known = state.groupNames[state.lastStringValue];
|
|
4547
|
+
if (known) {
|
|
4548
|
+
if (trackDisjunction) {
|
|
4549
|
+
for (var i = 0, list = known; i < list.length; i += 1) {
|
|
4550
|
+
var altID = list[i];
|
|
4551
|
+
|
|
4552
|
+
if (!altID.separatedFrom(state.branchID))
|
|
4553
|
+
{ state.raise("Duplicate capture group name"); }
|
|
4554
|
+
}
|
|
4555
|
+
} else {
|
|
4258
4556
|
state.raise("Duplicate capture group name");
|
|
4259
4557
|
}
|
|
4260
|
-
state.groupNames.push(state.lastStringValue);
|
|
4261
|
-
return
|
|
4262
4558
|
}
|
|
4263
|
-
|
|
4559
|
+
if (trackDisjunction) {
|
|
4560
|
+
(known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
|
|
4561
|
+
} else {
|
|
4562
|
+
state.groupNames[state.lastStringValue] = true;
|
|
4563
|
+
}
|
|
4264
4564
|
}
|
|
4265
4565
|
};
|
|
4266
4566
|
|
|
@@ -5182,13 +5482,17 @@
|
|
|
5182
5482
|
return this.getTokenFromCode(code)
|
|
5183
5483
|
};
|
|
5184
5484
|
|
|
5185
|
-
pp.
|
|
5186
|
-
var code = this.input.charCodeAt(
|
|
5485
|
+
pp.fullCharCodeAt = function(pos) {
|
|
5486
|
+
var code = this.input.charCodeAt(pos);
|
|
5187
5487
|
if (code <= 0xd7ff || code >= 0xdc00) { return code }
|
|
5188
|
-
var next = this.input.charCodeAt(
|
|
5488
|
+
var next = this.input.charCodeAt(pos + 1);
|
|
5189
5489
|
return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
|
|
5190
5490
|
};
|
|
5191
5491
|
|
|
5492
|
+
pp.fullCharCodeAtPos = function() {
|
|
5493
|
+
return this.fullCharCodeAt(this.pos)
|
|
5494
|
+
};
|
|
5495
|
+
|
|
5192
5496
|
pp.skipBlockComment = function() {
|
|
5193
5497
|
var startLoc = this.options.onComment && this.curPosition();
|
|
5194
5498
|
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
|
|
@@ -5765,15 +6069,18 @@
|
|
|
5765
6069
|
break
|
|
5766
6070
|
|
|
5767
6071
|
case "$":
|
|
5768
|
-
if (this.input[this.pos + 1] !== "{") {
|
|
5769
|
-
|
|
5770
|
-
}
|
|
5771
|
-
|
|
5772
|
-
// falls through
|
|
6072
|
+
if (this.input[this.pos + 1] !== "{") { break }
|
|
6073
|
+
// fall through
|
|
5773
6074
|
case "`":
|
|
5774
6075
|
return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))
|
|
5775
6076
|
|
|
5776
|
-
|
|
6077
|
+
case "\r":
|
|
6078
|
+
if (this.input[this.pos + 1] === "\n") { ++this.pos; }
|
|
6079
|
+
// fall through
|
|
6080
|
+
case "\n": case "\u2028": case "\u2029":
|
|
6081
|
+
++this.curLine;
|
|
6082
|
+
this.lineStart = this.pos + 1;
|
|
6083
|
+
break
|
|
5777
6084
|
}
|
|
5778
6085
|
}
|
|
5779
6086
|
this.raise(this.start, "Unterminated template");
|
|
@@ -5836,6 +6143,7 @@
|
|
|
5836
6143
|
if (isNewLine(ch)) {
|
|
5837
6144
|
// Unicode new line characters after \ get removed from output in both
|
|
5838
6145
|
// template literals and strings
|
|
6146
|
+
if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
|
|
5839
6147
|
return ""
|
|
5840
6148
|
}
|
|
5841
6149
|
return String.fromCharCode(ch)
|
|
@@ -5910,11 +6218,9 @@
|
|
|
5910
6218
|
// Please use the [github bug tracker][ghbt] to report issues.
|
|
5911
6219
|
//
|
|
5912
6220
|
// [ghbt]: https://github.com/acornjs/acorn/issues
|
|
5913
|
-
//
|
|
5914
|
-
// [walk]: util/walk.js
|
|
5915
6221
|
|
|
5916
6222
|
|
|
5917
|
-
var version = "8.
|
|
6223
|
+
var version = "8.16.0";
|
|
5918
6224
|
|
|
5919
6225
|
Parser.acorn = {
|
|
5920
6226
|
Parser: Parser,
|
|
@@ -5939,11 +6245,10 @@
|
|
|
5939
6245
|
};
|
|
5940
6246
|
|
|
5941
6247
|
// The main exported interface (under `self.acorn` when in the
|
|
5942
|
-
// browser) is a `parse` function that takes a code string and
|
|
5943
|
-
//
|
|
5944
|
-
// API][api].
|
|
6248
|
+
// browser) is a `parse` function that takes a code string and returns
|
|
6249
|
+
// an abstract syntax tree as specified by the [ESTree spec][estree].
|
|
5945
6250
|
//
|
|
5946
|
-
// [
|
|
6251
|
+
// [estree]: https://github.com/estree/estree
|
|
5947
6252
|
|
|
5948
6253
|
function parse(input, options) {
|
|
5949
6254
|
return Parser.parse(input, options)
|