chrome-devtools-frontend 1.0.1626840 → 1.0.1629211
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 +0 -3
- package/front_end/core/root/ExperimentNames.ts +0 -4
- package/front_end/core/sdk/CSSContainerQuery.ts +3 -1
- package/front_end/core/sdk/CSSModel.ts +23 -0
- package/front_end/core/sdk/DOMModel.ts +0 -5
- 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 -2
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -2
- package/front_end/entrypoints/main/MainImpl.ts +0 -10
- package/front_end/generated/InspectorBackendCommands.ts +3 -3
- package/front_end/generated/protocol.ts +6 -0
- package/front_end/models/emulation/DeviceModeModel.ts +4 -0
- package/front_end/models/issues_manager/GenericIssue.ts +18 -1
- package/front_end/models/issues_manager/descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/common/freDialog.css +1 -0
- package/front_end/panels/console/ConsoleView.ts +2 -2
- package/front_end/panels/elements/StylePropertiesSection.ts +6 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +9 -8
- package/front_end/panels/elements/elements-meta.ts +0 -25
- package/front_end/panels/elements/elements.ts +0 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +346 -265
- package/front_end/panels/emulation/DeviceModeView.ts +2 -2
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +9 -4
- package/front_end/panels/profiler/ProfilesPanel.ts +7 -1
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +7 -6
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +29 -18
- package/front_end/panels/sources/sources-meta.ts +7 -0
- 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/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/legacy/TabbedPane.ts +142 -16
- package/front_end/ui/legacy/TextPrompt.docs.ts +51 -0
- package/front_end/ui/legacy/TextPrompt.ts +55 -6
- package/front_end/ui/legacy/Toolbar.ts +2 -1
- package/front_end/ui/legacy/View.ts +2 -1
- package/front_end/ui/legacy/ViewManager.ts +11 -5
- package/front_end/ui/legacy/textPrompt.css +4 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/elements/NodeStackTraceWidget.ts +0 -76
- package/front_end/panels/elements/nodeStackTraceWidget.css +0 -11
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// This file was generated. Do not modify manually!
|
|
2
|
-
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,
|
|
2
|
+
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];
|
|
3
3
|
|
|
4
4
|
// This file was generated. Do not modify manually!
|
|
5
|
-
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,
|
|
5
|
+
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];
|
|
6
6
|
|
|
7
7
|
// This file was generated. Do not modify manually!
|
|
8
|
-
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\
|
|
8
|
+
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";
|
|
9
9
|
|
|
10
10
|
// This file was generated. Do not modify manually!
|
|
11
|
-
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-\
|
|
11
|
+
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";
|
|
12
12
|
|
|
13
13
|
// These are a run-length and offset encoded representation of the
|
|
14
14
|
// >0xffff code points that are a valid part of identifiers. The
|
|
@@ -273,8 +273,10 @@ var isArray = Array.isArray || (function (obj) { return (
|
|
|
273
273
|
toString.call(obj) === "[object Array]"
|
|
274
274
|
); });
|
|
275
275
|
|
|
276
|
+
var regexpCache = Object.create(null);
|
|
277
|
+
|
|
276
278
|
function wordsRegexp(words) {
|
|
277
|
-
return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
|
|
279
|
+
return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"))
|
|
278
280
|
}
|
|
279
281
|
|
|
280
282
|
function codePointToString(code) {
|
|
@@ -331,14 +333,14 @@ var defaultOptions = {
|
|
|
331
333
|
// for new syntax features.
|
|
332
334
|
ecmaVersion: null,
|
|
333
335
|
// `sourceType` indicates the mode the code should be parsed in.
|
|
334
|
-
// Can be either `"script"` or `"
|
|
336
|
+
// Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
|
|
335
337
|
// strict mode and parsing of `import` and `export` declarations.
|
|
336
338
|
sourceType: "script",
|
|
337
|
-
// `onInsertedSemicolon` can be a callback that will be called
|
|
338
|
-
//
|
|
339
|
-
//
|
|
340
|
-
// enabled, it is given the location as a `{line,
|
|
341
|
-
// as second argument.
|
|
339
|
+
// `onInsertedSemicolon` can be a callback that will be called when
|
|
340
|
+
// a semicolon is automatically inserted. It will be passed the
|
|
341
|
+
// position of the inserted semicolon as an offset, and if
|
|
342
|
+
// `locations` is enabled, it is given the location as a `{line,
|
|
343
|
+
// column}` object as second argument.
|
|
342
344
|
onInsertedSemicolon: null,
|
|
343
345
|
// `onTrailingComma` is similar to `onInsertedSemicolon`, but for
|
|
344
346
|
// trailing commas.
|
|
@@ -391,6 +393,8 @@ var defaultOptions = {
|
|
|
391
393
|
// passed, the full `{line, column}` locations of the start and
|
|
392
394
|
// end of the comments. Note that you are not allowed to call the
|
|
393
395
|
// parser from the callback—that will corrupt its internal state.
|
|
396
|
+
// When this option has an array as value, objects representing the
|
|
397
|
+
// comments are pushed to it.
|
|
394
398
|
onComment: null,
|
|
395
399
|
// Nodes have their start and end characters offsets recorded in
|
|
396
400
|
// `start` and `end` properties (directly on the node, rather than
|
|
@@ -453,6 +457,9 @@ function getOptions(opts) {
|
|
|
453
457
|
if (isArray(options.onComment))
|
|
454
458
|
{ options.onComment = pushComment(options, options.onComment); }
|
|
455
459
|
|
|
460
|
+
if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction)
|
|
461
|
+
{ throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs") }
|
|
462
|
+
|
|
456
463
|
return options
|
|
457
464
|
}
|
|
458
465
|
|
|
@@ -483,6 +490,8 @@ var
|
|
|
483
490
|
SCOPE_SUPER = 64,
|
|
484
491
|
SCOPE_DIRECT_SUPER = 128,
|
|
485
492
|
SCOPE_CLASS_STATIC_BLOCK = 256,
|
|
493
|
+
SCOPE_CLASS_FIELD_INIT = 512,
|
|
494
|
+
SCOPE_SWITCH = 1024,
|
|
486
495
|
SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
487
496
|
|
|
488
497
|
function functionFlags(async, generator) {
|
|
@@ -572,7 +581,12 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
572
581
|
|
|
573
582
|
// Scope tracking for duplicate variable names (see scope.js)
|
|
574
583
|
this.scopeStack = [];
|
|
575
|
-
this.enterScope(
|
|
584
|
+
this.enterScope(
|
|
585
|
+
this.options.sourceType === "commonjs"
|
|
586
|
+
// In commonjs, the top-level scope behaves like a function scope
|
|
587
|
+
? SCOPE_FUNCTION
|
|
588
|
+
: SCOPE_TOP
|
|
589
|
+
);
|
|
576
590
|
|
|
577
591
|
// For RegExp validation
|
|
578
592
|
this.regexpState = null;
|
|
@@ -583,7 +597,7 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
583
597
|
this.privateNameStack = [];
|
|
584
598
|
};
|
|
585
599
|
|
|
586
|
-
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 } };
|
|
600
|
+
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 } };
|
|
587
601
|
|
|
588
602
|
Parser.prototype.parse = function parse () {
|
|
589
603
|
var node = this.options.program || this.startNode();
|
|
@@ -593,24 +607,30 @@ Parser.prototype.parse = function parse () {
|
|
|
593
607
|
|
|
594
608
|
prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
|
|
595
609
|
|
|
596
|
-
prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0
|
|
610
|
+
prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
|
|
597
611
|
|
|
598
|
-
prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0
|
|
612
|
+
prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
|
|
599
613
|
|
|
600
614
|
prototypeAccessors.canAwait.get = function () {
|
|
601
615
|
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
602
|
-
var
|
|
603
|
-
|
|
604
|
-
if (
|
|
616
|
+
var ref = this.scopeStack[i];
|
|
617
|
+
var flags = ref.flags;
|
|
618
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false }
|
|
619
|
+
if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 }
|
|
605
620
|
}
|
|
606
621
|
return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
|
|
607
622
|
};
|
|
608
623
|
|
|
624
|
+
prototypeAccessors.allowReturn.get = function () {
|
|
625
|
+
if (this.inFunction) { return true }
|
|
626
|
+
if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) { return true }
|
|
627
|
+
return false
|
|
628
|
+
};
|
|
629
|
+
|
|
609
630
|
prototypeAccessors.allowSuper.get = function () {
|
|
610
631
|
var ref = this.currentThisScope();
|
|
611
632
|
var flags = ref.flags;
|
|
612
|
-
|
|
613
|
-
return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod
|
|
633
|
+
return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod
|
|
614
634
|
};
|
|
615
635
|
|
|
616
636
|
prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
|
|
@@ -618,10 +638,21 @@ prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThis
|
|
|
618
638
|
prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
|
|
619
639
|
|
|
620
640
|
prototypeAccessors.allowNewDotTarget.get = function () {
|
|
621
|
-
var
|
|
641
|
+
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
|
|
642
|
+
var ref = this.scopeStack[i];
|
|
643
|
+
var flags = ref.flags;
|
|
644
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||
|
|
645
|
+
((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true }
|
|
646
|
+
}
|
|
647
|
+
return false
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
prototypeAccessors.allowUsing.get = function () {
|
|
651
|
+
var ref = this.currentScope();
|
|
622
652
|
var flags = ref.flags;
|
|
623
|
-
|
|
624
|
-
|
|
653
|
+
if (flags & SCOPE_SWITCH) { return false }
|
|
654
|
+
if (!this.inModule && flags & SCOPE_TOP) { return false }
|
|
655
|
+
return true
|
|
625
656
|
};
|
|
626
657
|
|
|
627
658
|
prototypeAccessors.inClassStaticBlock.get = function () {
|
|
@@ -657,7 +688,7 @@ var pp$9 = Parser.prototype;
|
|
|
657
688
|
|
|
658
689
|
// ## Parser utilities
|
|
659
690
|
|
|
660
|
-
var literal = /^(?:'((
|
|
691
|
+
var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
661
692
|
pp$9.strictDirective = function(start) {
|
|
662
693
|
if (this.options.ecmaVersion < 5) { return false }
|
|
663
694
|
for (;;) {
|
|
@@ -828,7 +859,7 @@ pp$8.parseTopLevel = function(node) {
|
|
|
828
859
|
} }
|
|
829
860
|
this.adaptDirectivePrologue(node.body);
|
|
830
861
|
this.next();
|
|
831
|
-
node.sourceType = this.options.sourceType;
|
|
862
|
+
node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
|
|
832
863
|
return this.finishNode(node, "Program")
|
|
833
864
|
};
|
|
834
865
|
|
|
@@ -838,20 +869,21 @@ pp$8.isLet = function(context) {
|
|
|
838
869
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
|
|
839
870
|
skipWhiteSpace.lastIndex = this.pos;
|
|
840
871
|
var skip = skipWhiteSpace.exec(this.input);
|
|
841
|
-
var next = this.pos + skip[0].length, nextCh = this.
|
|
872
|
+
var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);
|
|
842
873
|
// For ambiguous cases, determine if a LexicalDeclaration (or only a
|
|
843
874
|
// Statement) is allowed here. If context is not empty then only a Statement
|
|
844
875
|
// is allowed. However, `let [` is an explicit negative lookahead for
|
|
845
876
|
// ExpressionStatement, so special-case it first.
|
|
846
|
-
if (nextCh === 91 || nextCh === 92) { return true } // '[', '
|
|
877
|
+
if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
|
|
847
878
|
if (context) { return false }
|
|
848
879
|
|
|
849
|
-
if (nextCh === 123
|
|
850
|
-
if (isIdentifierStart(nextCh
|
|
851
|
-
var
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
880
|
+
if (nextCh === 123) { return true } // '{'
|
|
881
|
+
if (isIdentifierStart(nextCh)) {
|
|
882
|
+
var start = next;
|
|
883
|
+
do { next += nextCh <= 0xffff ? 1 : 2; }
|
|
884
|
+
while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)))
|
|
885
|
+
if (nextCh === 92) { return true }
|
|
886
|
+
var ident = this.input.slice(start, next);
|
|
855
887
|
if (!keywordRelationalOperator.test(ident)) { return true }
|
|
856
888
|
}
|
|
857
889
|
return false
|
|
@@ -870,7 +902,50 @@ pp$8.isAsyncFunction = function() {
|
|
|
870
902
|
return !lineBreak.test(this.input.slice(this.pos, next)) &&
|
|
871
903
|
this.input.slice(next, next + 8) === "function" &&
|
|
872
904
|
(next + 8 === this.input.length ||
|
|
873
|
-
!(isIdentifierChar(after = this.
|
|
905
|
+
!(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92 /* '\' */))
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
909
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using"))
|
|
910
|
+
{ return false }
|
|
911
|
+
|
|
912
|
+
skipWhiteSpace.lastIndex = this.pos;
|
|
913
|
+
var skip = skipWhiteSpace.exec(this.input);
|
|
914
|
+
var next = this.pos + skip[0].length;
|
|
915
|
+
|
|
916
|
+
if (lineBreak.test(this.input.slice(this.pos, next))) { return false }
|
|
917
|
+
|
|
918
|
+
if (isAwaitUsing) {
|
|
919
|
+
var usingEndPos = next + 5 /* using */, after;
|
|
920
|
+
if (this.input.slice(next, usingEndPos) !== "using" ||
|
|
921
|
+
usingEndPos === this.input.length ||
|
|
922
|
+
isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) ||
|
|
923
|
+
after === 92 /* '\' */
|
|
924
|
+
) { return false }
|
|
925
|
+
|
|
926
|
+
skipWhiteSpace.lastIndex = usingEndPos;
|
|
927
|
+
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
928
|
+
next = usingEndPos + skipAfterUsing[0].length;
|
|
929
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) { return false }
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
var ch = this.fullCharCodeAt(next);
|
|
933
|
+
if (!isIdentifierStart(ch) && ch !== 92 /* '\' */) { return false }
|
|
934
|
+
var idStart = next;
|
|
935
|
+
do { next += ch <= 0xffff ? 1 : 2; }
|
|
936
|
+
while (isIdentifierChar(ch = this.fullCharCodeAt(next)))
|
|
937
|
+
if (ch === 92) { return true }
|
|
938
|
+
var id = this.input.slice(idStart, next);
|
|
939
|
+
if (keywordRelationalOperator.test(id) || isFor && id === "of") { return false }
|
|
940
|
+
return true
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
pp$8.isAwaitUsing = function(isFor) {
|
|
944
|
+
return this.isUsingKeyword(true, isFor)
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
pp$8.isUsing = function(isFor) {
|
|
948
|
+
return this.isUsingKeyword(false, isFor)
|
|
874
949
|
};
|
|
875
950
|
|
|
876
951
|
// Parse a single statement.
|
|
@@ -949,6 +1024,23 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
949
1024
|
return this.parseFunctionStatement(node, true, !context)
|
|
950
1025
|
}
|
|
951
1026
|
|
|
1027
|
+
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
1028
|
+
if (usingKind) {
|
|
1029
|
+
if (!this.allowUsing) {
|
|
1030
|
+
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
|
|
1031
|
+
}
|
|
1032
|
+
if (usingKind === "await using") {
|
|
1033
|
+
if (!this.canAwait) {
|
|
1034
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
1035
|
+
}
|
|
1036
|
+
this.next();
|
|
1037
|
+
}
|
|
1038
|
+
this.next();
|
|
1039
|
+
this.parseVar(node, false, usingKind);
|
|
1040
|
+
this.semicolon();
|
|
1041
|
+
return this.finishNode(node, "VariableDeclaration")
|
|
1042
|
+
}
|
|
1043
|
+
|
|
952
1044
|
var maybeName = this.value, expr = this.parseExpression();
|
|
953
1045
|
if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
|
|
954
1046
|
{ return this.parseLabeledStatement(node, maybeName, expr, context) }
|
|
@@ -1024,25 +1116,37 @@ pp$8.parseForStatement = function(node) {
|
|
|
1024
1116
|
this.next();
|
|
1025
1117
|
this.parseVar(init$1, true, kind);
|
|
1026
1118
|
this.finishNode(init$1, "VariableDeclaration");
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1119
|
+
return this.parseForAfterInit(node, init$1, awaitAt)
|
|
1120
|
+
}
|
|
1121
|
+
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
1122
|
+
|
|
1123
|
+
var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
|
|
1124
|
+
if (usingKind) {
|
|
1125
|
+
var init$2 = this.startNode();
|
|
1126
|
+
this.next();
|
|
1127
|
+
if (usingKind === "await using") {
|
|
1128
|
+
if (!this.canAwait) {
|
|
1129
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
1032
1130
|
}
|
|
1033
|
-
|
|
1131
|
+
this.next();
|
|
1034
1132
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1133
|
+
this.parseVar(init$2, true, usingKind);
|
|
1134
|
+
this.finishNode(init$2, "VariableDeclaration");
|
|
1135
|
+
return this.parseForAfterInit(node, init$2, awaitAt)
|
|
1037
1136
|
}
|
|
1038
|
-
var
|
|
1137
|
+
var containsEsc = this.containsEsc;
|
|
1039
1138
|
var refDestructuringErrors = new DestructuringErrors;
|
|
1040
|
-
var
|
|
1139
|
+
var initPos = this.start;
|
|
1140
|
+
var init = awaitAt > -1
|
|
1141
|
+
? this.parseExprSubscripts(refDestructuringErrors, "await")
|
|
1142
|
+
: this.parseExpression(true, refDestructuringErrors);
|
|
1041
1143
|
if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
1042
|
-
if (
|
|
1043
|
-
if (this.type === types$1._in) {
|
|
1044
|
-
|
|
1045
|
-
|
|
1144
|
+
if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
|
|
1145
|
+
if (this.type === types$1._in) { this.unexpected(awaitAt); }
|
|
1146
|
+
node.await = true;
|
|
1147
|
+
} else if (isForOf && this.options.ecmaVersion >= 8) {
|
|
1148
|
+
if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
|
|
1149
|
+
else if (this.options.ecmaVersion >= 9) { node.await = false; }
|
|
1046
1150
|
}
|
|
1047
1151
|
if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
|
|
1048
1152
|
this.toAssignable(init, false, refDestructuringErrors);
|
|
@@ -1055,6 +1159,20 @@ pp$8.parseForStatement = function(node) {
|
|
|
1055
1159
|
return this.parseFor(node, init)
|
|
1056
1160
|
};
|
|
1057
1161
|
|
|
1162
|
+
// Helper method to parse for loop after variable initialization
|
|
1163
|
+
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
1164
|
+
if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) {
|
|
1165
|
+
if (this.options.ecmaVersion >= 9) {
|
|
1166
|
+
if (this.type === types$1._in) {
|
|
1167
|
+
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
1168
|
+
} else { node.await = awaitAt > -1; }
|
|
1169
|
+
}
|
|
1170
|
+
return this.parseForIn(node, init)
|
|
1171
|
+
}
|
|
1172
|
+
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
1173
|
+
return this.parseFor(node, init)
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1058
1176
|
pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
|
|
1059
1177
|
this.next();
|
|
1060
1178
|
return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
|
|
@@ -1070,7 +1188,7 @@ pp$8.parseIfStatement = function(node) {
|
|
|
1070
1188
|
};
|
|
1071
1189
|
|
|
1072
1190
|
pp$8.parseReturnStatement = function(node) {
|
|
1073
|
-
if (!this.
|
|
1191
|
+
if (!this.allowReturn)
|
|
1074
1192
|
{ this.raise(this.start, "'return' outside of function"); }
|
|
1075
1193
|
this.next();
|
|
1076
1194
|
|
|
@@ -1089,7 +1207,7 @@ pp$8.parseSwitchStatement = function(node) {
|
|
|
1089
1207
|
node.cases = [];
|
|
1090
1208
|
this.expect(types$1.braceL);
|
|
1091
1209
|
this.labels.push(switchLabel);
|
|
1092
|
-
this.enterScope(
|
|
1210
|
+
this.enterScope(SCOPE_SWITCH);
|
|
1093
1211
|
|
|
1094
1212
|
// Statements under must be grouped (by label) in SwitchCase
|
|
1095
1213
|
// nodes. `cur` is used to keep the node that we are currently
|
|
@@ -1311,6 +1429,8 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
1311
1429
|
decl.init = this.parseMaybeAssign(isFor);
|
|
1312
1430
|
} else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
|
|
1313
1431
|
this.unexpected();
|
|
1432
|
+
} else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) {
|
|
1433
|
+
this.raise(this.lastTokEnd, ("Missing initializer in " + kind + " declaration"));
|
|
1314
1434
|
} else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
|
|
1315
1435
|
this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
|
|
1316
1436
|
} else {
|
|
@@ -1323,7 +1443,10 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
1323
1443
|
};
|
|
1324
1444
|
|
|
1325
1445
|
pp$8.parseVarId = function(decl, kind) {
|
|
1326
|
-
decl.id =
|
|
1446
|
+
decl.id = kind === "using" || kind === "await using"
|
|
1447
|
+
? this.parseIdent()
|
|
1448
|
+
: this.parseBindingAtom();
|
|
1449
|
+
|
|
1327
1450
|
this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
|
|
1328
1451
|
};
|
|
1329
1452
|
|
|
@@ -1542,11 +1665,9 @@ pp$8.parseClassField = function(field) {
|
|
|
1542
1665
|
|
|
1543
1666
|
if (this.eat(types$1.eq)) {
|
|
1544
1667
|
// To raise SyntaxError if 'arguments' exists in the initializer.
|
|
1545
|
-
|
|
1546
|
-
var inClassFieldInit = scope.inClassFieldInit;
|
|
1547
|
-
scope.inClassFieldInit = true;
|
|
1668
|
+
this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
|
|
1548
1669
|
field.value = this.parseMaybeAssign();
|
|
1549
|
-
|
|
1670
|
+
this.exitScope();
|
|
1550
1671
|
} else {
|
|
1551
1672
|
field.value = null;
|
|
1552
1673
|
}
|
|
@@ -1662,6 +1783,8 @@ pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
|
1662
1783
|
this.expectContextual("from");
|
|
1663
1784
|
if (this.type !== types$1.string) { this.unexpected(); }
|
|
1664
1785
|
node.source = this.parseExprAtom();
|
|
1786
|
+
if (this.options.ecmaVersion >= 16)
|
|
1787
|
+
{ node.attributes = this.parseWithClause(); }
|
|
1665
1788
|
this.semicolon();
|
|
1666
1789
|
return this.finishNode(node, "ExportAllDeclaration")
|
|
1667
1790
|
};
|
|
@@ -1686,12 +1809,16 @@ pp$8.parseExport = function(node, exports) {
|
|
|
1686
1809
|
{ this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
|
|
1687
1810
|
node.specifiers = [];
|
|
1688
1811
|
node.source = null;
|
|
1812
|
+
if (this.options.ecmaVersion >= 16)
|
|
1813
|
+
{ node.attributes = []; }
|
|
1689
1814
|
} else { // export { x, y as z } [from '...']
|
|
1690
1815
|
node.declaration = null;
|
|
1691
1816
|
node.specifiers = this.parseExportSpecifiers(exports);
|
|
1692
1817
|
if (this.eatContextual("from")) {
|
|
1693
1818
|
if (this.type !== types$1.string) { this.unexpected(); }
|
|
1694
1819
|
node.source = this.parseExprAtom();
|
|
1820
|
+
if (this.options.ecmaVersion >= 16)
|
|
1821
|
+
{ node.attributes = this.parseWithClause(); }
|
|
1695
1822
|
} else {
|
|
1696
1823
|
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
|
|
1697
1824
|
// check for keywords used as local names
|
|
@@ -1707,6 +1834,8 @@ pp$8.parseExport = function(node, exports) {
|
|
|
1707
1834
|
}
|
|
1708
1835
|
|
|
1709
1836
|
node.source = null;
|
|
1837
|
+
if (this.options.ecmaVersion >= 16)
|
|
1838
|
+
{ node.attributes = []; }
|
|
1710
1839
|
}
|
|
1711
1840
|
this.semicolon();
|
|
1712
1841
|
}
|
|
@@ -1766,8 +1895,6 @@ pp$8.checkPatternExport = function(exports, pat) {
|
|
|
1766
1895
|
{ this.checkPatternExport(exports, pat.left); }
|
|
1767
1896
|
else if (type === "RestElement")
|
|
1768
1897
|
{ this.checkPatternExport(exports, pat.argument); }
|
|
1769
|
-
else if (type === "ParenthesizedExpression")
|
|
1770
|
-
{ this.checkPatternExport(exports, pat.expression); }
|
|
1771
1898
|
};
|
|
1772
1899
|
|
|
1773
1900
|
pp$8.checkVariableExport = function(exports, decls) {
|
|
@@ -1834,6 +1961,8 @@ pp$8.parseImport = function(node) {
|
|
|
1834
1961
|
this.expectContextual("from");
|
|
1835
1962
|
node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
|
|
1836
1963
|
}
|
|
1964
|
+
if (this.options.ecmaVersion >= 16)
|
|
1965
|
+
{ node.attributes = this.parseWithClause(); }
|
|
1837
1966
|
this.semicolon();
|
|
1838
1967
|
return this.finishNode(node, "ImportDeclaration")
|
|
1839
1968
|
};
|
|
@@ -1894,6 +2023,41 @@ pp$8.parseImportSpecifiers = function() {
|
|
|
1894
2023
|
return nodes
|
|
1895
2024
|
};
|
|
1896
2025
|
|
|
2026
|
+
pp$8.parseWithClause = function() {
|
|
2027
|
+
var nodes = [];
|
|
2028
|
+
if (!this.eat(types$1._with)) {
|
|
2029
|
+
return nodes
|
|
2030
|
+
}
|
|
2031
|
+
this.expect(types$1.braceL);
|
|
2032
|
+
var attributeKeys = {};
|
|
2033
|
+
var first = true;
|
|
2034
|
+
while (!this.eat(types$1.braceR)) {
|
|
2035
|
+
if (!first) {
|
|
2036
|
+
this.expect(types$1.comma);
|
|
2037
|
+
if (this.afterTrailingComma(types$1.braceR)) { break }
|
|
2038
|
+
} else { first = false; }
|
|
2039
|
+
|
|
2040
|
+
var attr = this.parseImportAttribute();
|
|
2041
|
+
var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
|
|
2042
|
+
if (hasOwn(attributeKeys, keyName))
|
|
2043
|
+
{ this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
|
|
2044
|
+
attributeKeys[keyName] = true;
|
|
2045
|
+
nodes.push(attr);
|
|
2046
|
+
}
|
|
2047
|
+
return nodes
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
pp$8.parseImportAttribute = function() {
|
|
2051
|
+
var node = this.startNode();
|
|
2052
|
+
node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2053
|
+
this.expect(types$1.colon);
|
|
2054
|
+
if (this.type !== types$1.string) {
|
|
2055
|
+
this.unexpected();
|
|
2056
|
+
}
|
|
2057
|
+
node.value = this.parseExprAtom();
|
|
2058
|
+
return this.finishNode(node, "ImportAttribute")
|
|
2059
|
+
};
|
|
2060
|
+
|
|
1897
2061
|
pp$8.parseModuleExportName = function() {
|
|
1898
2062
|
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
|
|
1899
2063
|
var stringLiteral = this.parseLiteral(this.value);
|
|
@@ -2331,7 +2495,7 @@ pp$6.updateContext = function(prevType) {
|
|
|
2331
2495
|
{ this.exprAllowed = type.beforeExpr; }
|
|
2332
2496
|
};
|
|
2333
2497
|
|
|
2334
|
-
// Used to handle
|
|
2498
|
+
// Used to handle edge cases when token context could not be inferred correctly during tokenization phase
|
|
2335
2499
|
|
|
2336
2500
|
pp$6.overrideContext = function(tokenCtx) {
|
|
2337
2501
|
if (this.curContext() !== tokenCtx) {
|
|
@@ -2384,6 +2548,11 @@ types$1._function.updateContext = types$1._class.updateContext = function(prevTy
|
|
|
2384
2548
|
this.exprAllowed = false;
|
|
2385
2549
|
};
|
|
2386
2550
|
|
|
2551
|
+
types$1.colon.updateContext = function() {
|
|
2552
|
+
if (this.curContext().token === "function") { this.context.pop(); }
|
|
2553
|
+
this.exprAllowed = true;
|
|
2554
|
+
};
|
|
2555
|
+
|
|
2387
2556
|
types$1.backQuote.updateContext = function() {
|
|
2388
2557
|
if (this.curContext() === types.q_tmpl)
|
|
2389
2558
|
{ this.context.pop(); }
|
|
@@ -2652,8 +2821,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
2652
2821
|
node.argument = this.parseMaybeUnary(null, true, update, forInit);
|
|
2653
2822
|
this.checkExpressionErrors(refDestructuringErrors, true);
|
|
2654
2823
|
if (update) { this.checkLValSimple(node.argument); }
|
|
2655
|
-
else if (this.strict && node.operator === "delete" &&
|
|
2656
|
-
node.argument.type === "Identifier")
|
|
2824
|
+
else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
|
|
2657
2825
|
{ this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
|
|
2658
2826
|
else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
|
|
2659
2827
|
{ this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
|
|
@@ -2688,10 +2856,18 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
2688
2856
|
}
|
|
2689
2857
|
};
|
|
2690
2858
|
|
|
2859
|
+
function isLocalVariableAccess(node) {
|
|
2860
|
+
return (
|
|
2861
|
+
node.type === "Identifier" ||
|
|
2862
|
+
node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
|
|
2863
|
+
)
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2691
2866
|
function isPrivateFieldAccess(node) {
|
|
2692
2867
|
return (
|
|
2693
2868
|
node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
|
|
2694
|
-
node.type === "ChainExpression" && isPrivateFieldAccess(node.expression)
|
|
2869
|
+
node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
|
|
2870
|
+
node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
|
|
2695
2871
|
)
|
|
2696
2872
|
}
|
|
2697
2873
|
|
|
@@ -2929,12 +3105,14 @@ pp$5.parseExprImport = function(forNew) {
|
|
|
2929
3105
|
// Consume `import` as an identifier for `import.meta`.
|
|
2930
3106
|
// Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
|
|
2931
3107
|
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
|
|
2932
|
-
|
|
3108
|
+
this.next();
|
|
2933
3109
|
|
|
2934
3110
|
if (this.type === types$1.parenL && !forNew) {
|
|
2935
3111
|
return this.parseDynamicImport(node)
|
|
2936
3112
|
} else if (this.type === types$1.dot) {
|
|
2937
|
-
|
|
3113
|
+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
3114
|
+
meta.name = "import";
|
|
3115
|
+
node.meta = this.finishNode(meta, "Identifier");
|
|
2938
3116
|
return this.parseImportMeta(node)
|
|
2939
3117
|
} else {
|
|
2940
3118
|
this.unexpected();
|
|
@@ -2947,13 +3125,32 @@ pp$5.parseDynamicImport = function(node) {
|
|
|
2947
3125
|
// Parse node.source.
|
|
2948
3126
|
node.source = this.parseMaybeAssign();
|
|
2949
3127
|
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
3128
|
+
if (this.options.ecmaVersion >= 16) {
|
|
3129
|
+
if (!this.eat(types$1.parenR)) {
|
|
3130
|
+
this.expect(types$1.comma);
|
|
3131
|
+
if (!this.afterTrailingComma(types$1.parenR)) {
|
|
3132
|
+
node.options = this.parseMaybeAssign();
|
|
3133
|
+
if (!this.eat(types$1.parenR)) {
|
|
3134
|
+
this.expect(types$1.comma);
|
|
3135
|
+
if (!this.afterTrailingComma(types$1.parenR)) {
|
|
3136
|
+
this.unexpected();
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
} else {
|
|
3140
|
+
node.options = null;
|
|
3141
|
+
}
|
|
2955
3142
|
} else {
|
|
2956
|
-
|
|
3143
|
+
node.options = null;
|
|
3144
|
+
}
|
|
3145
|
+
} else {
|
|
3146
|
+
// Verify ending.
|
|
3147
|
+
if (!this.eat(types$1.parenR)) {
|
|
3148
|
+
var errorPos = this.start;
|
|
3149
|
+
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
|
|
3150
|
+
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
|
|
3151
|
+
} else {
|
|
3152
|
+
this.unexpected(errorPos);
|
|
3153
|
+
}
|
|
2957
3154
|
}
|
|
2958
3155
|
}
|
|
2959
3156
|
|
|
@@ -2980,7 +3177,8 @@ pp$5.parseLiteral = function(value) {
|
|
|
2980
3177
|
var node = this.startNode();
|
|
2981
3178
|
node.value = value;
|
|
2982
3179
|
node.raw = this.input.slice(this.start, this.end);
|
|
2983
|
-
if (node.raw.charCodeAt(node.raw.length - 1) === 110)
|
|
3180
|
+
if (node.raw.charCodeAt(node.raw.length - 1) === 110)
|
|
3181
|
+
{ node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, ""); }
|
|
2984
3182
|
this.next();
|
|
2985
3183
|
return this.finishNode(node, "Literal")
|
|
2986
3184
|
};
|
|
@@ -3082,9 +3280,12 @@ var empty = [];
|
|
|
3082
3280
|
pp$5.parseNew = function() {
|
|
3083
3281
|
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
|
|
3084
3282
|
var node = this.startNode();
|
|
3085
|
-
|
|
3086
|
-
if (this.options.ecmaVersion >= 6 && this.
|
|
3087
|
-
|
|
3283
|
+
this.next();
|
|
3284
|
+
if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
|
|
3285
|
+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
|
|
3286
|
+
meta.name = "new";
|
|
3287
|
+
node.meta = this.finishNode(meta, "Identifier");
|
|
3288
|
+
this.next();
|
|
3088
3289
|
var containsEsc = this.containsEsc;
|
|
3089
3290
|
node.property = this.parseIdent(true);
|
|
3090
3291
|
if (node.property.name !== "target")
|
|
@@ -3113,7 +3314,7 @@ pp$5.parseTemplateElement = function(ref) {
|
|
|
3113
3314
|
this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
3114
3315
|
}
|
|
3115
3316
|
elem.value = {
|
|
3116
|
-
raw: this.value,
|
|
3317
|
+
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
3117
3318
|
cooked: null
|
|
3118
3319
|
};
|
|
3119
3320
|
} else {
|
|
@@ -3215,9 +3416,10 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
|
3215
3416
|
};
|
|
3216
3417
|
|
|
3217
3418
|
pp$5.parseGetterSetter = function(prop) {
|
|
3218
|
-
|
|
3419
|
+
var kind = prop.key.name;
|
|
3219
3420
|
this.parsePropertyName(prop);
|
|
3220
3421
|
prop.value = this.parseMethod(false);
|
|
3422
|
+
prop.kind = kind;
|
|
3221
3423
|
var paramCount = prop.kind === "get" ? 0 : 1;
|
|
3222
3424
|
if (prop.value.params.length !== paramCount) {
|
|
3223
3425
|
var start = prop.value.start;
|
|
@@ -3240,9 +3442,9 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
|
3240
3442
|
prop.kind = "init";
|
|
3241
3443
|
} else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
|
|
3242
3444
|
if (isPattern) { this.unexpected(); }
|
|
3243
|
-
prop.kind = "init";
|
|
3244
3445
|
prop.method = true;
|
|
3245
3446
|
prop.value = this.parseMethod(isGenerator, isAsync);
|
|
3447
|
+
prop.kind = "init";
|
|
3246
3448
|
} else if (!isPattern && !containsEsc &&
|
|
3247
3449
|
this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
|
|
3248
3450
|
(prop.key.name === "get" || prop.key.name === "set") &&
|
|
@@ -3254,7 +3456,6 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
|
3254
3456
|
this.checkUnreserved(prop.key);
|
|
3255
3457
|
if (prop.key.name === "await" && !this.awaitIdentPos)
|
|
3256
3458
|
{ this.awaitIdentPos = startPos; }
|
|
3257
|
-
prop.kind = "init";
|
|
3258
3459
|
if (isPattern) {
|
|
3259
3460
|
prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
|
|
3260
3461
|
} else if (this.type === types$1.eq && refDestructuringErrors) {
|
|
@@ -3264,6 +3465,7 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
|
|
|
3264
3465
|
} else {
|
|
3265
3466
|
prop.value = this.copyNode(prop.key);
|
|
3266
3467
|
}
|
|
3468
|
+
prop.kind = "init";
|
|
3267
3469
|
prop.shorthand = true;
|
|
3268
3470
|
} else { this.unexpected(); }
|
|
3269
3471
|
};
|
|
@@ -3439,7 +3641,7 @@ pp$5.checkUnreserved = function(ref) {
|
|
|
3439
3641
|
{ this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
|
|
3440
3642
|
if (this.inAsync && name === "await")
|
|
3441
3643
|
{ this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
|
|
3442
|
-
if (this.currentThisScope().
|
|
3644
|
+
if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments")
|
|
3443
3645
|
{ this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
|
|
3444
3646
|
if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
|
|
3445
3647
|
{ this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
|
|
@@ -3486,6 +3688,7 @@ pp$5.parseIdentNode = function() {
|
|
|
3486
3688
|
(this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
|
|
3487
3689
|
this.context.pop();
|
|
3488
3690
|
}
|
|
3691
|
+
this.type = types$1.name;
|
|
3489
3692
|
} else {
|
|
3490
3693
|
this.unexpected();
|
|
3491
3694
|
}
|
|
@@ -3551,6 +3754,9 @@ var pp$4 = Parser.prototype;
|
|
|
3551
3754
|
pp$4.raise = function(pos, message) {
|
|
3552
3755
|
var loc = getLineInfo(this.input, pos);
|
|
3553
3756
|
message += " (" + loc.line + ":" + loc.column + ")";
|
|
3757
|
+
if (this.sourceFile) {
|
|
3758
|
+
message += " in " + this.sourceFile;
|
|
3759
|
+
}
|
|
3554
3760
|
var err = new SyntaxError(message);
|
|
3555
3761
|
err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
|
|
3556
3762
|
throw err
|
|
@@ -3574,8 +3780,6 @@ var Scope = function Scope(flags) {
|
|
|
3574
3780
|
this.lexical = [];
|
|
3575
3781
|
// A list of lexically-declared FunctionDeclaration names in the current lexical scope
|
|
3576
3782
|
this.functions = [];
|
|
3577
|
-
// A switch to disallow the identifier reference 'arguments'
|
|
3578
|
-
this.inClassFieldInit = false;
|
|
3579
3783
|
};
|
|
3580
3784
|
|
|
3581
3785
|
// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
|
|
@@ -3645,7 +3849,7 @@ pp$3.currentScope = function() {
|
|
|
3645
3849
|
pp$3.currentVarScope = function() {
|
|
3646
3850
|
for (var i = this.scopeStack.length - 1;; i--) {
|
|
3647
3851
|
var scope = this.scopeStack[i];
|
|
3648
|
-
if (scope.flags & SCOPE_VAR) { return scope }
|
|
3852
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope }
|
|
3649
3853
|
}
|
|
3650
3854
|
};
|
|
3651
3855
|
|
|
@@ -3653,7 +3857,8 @@ pp$3.currentVarScope = function() {
|
|
|
3653
3857
|
pp$3.currentThisScope = function() {
|
|
3654
3858
|
for (var i = this.scopeStack.length - 1;; i--) {
|
|
3655
3859
|
var scope = this.scopeStack[i];
|
|
3656
|
-
if (scope.flags & SCOPE_VAR
|
|
3860
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) &&
|
|
3861
|
+
!(scope.flags & SCOPE_ARROW)) { return scope }
|
|
3657
3862
|
}
|
|
3658
3863
|
};
|
|
3659
3864
|
|
|
@@ -3709,6 +3914,9 @@ pp$2.copyNode = function(node) {
|
|
|
3709
3914
|
return newNode
|
|
3710
3915
|
};
|
|
3711
3916
|
|
|
3917
|
+
// This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
|
|
3918
|
+
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";
|
|
3919
|
+
|
|
3712
3920
|
// This file contains Unicode properties extracted from the ECMAScript specification.
|
|
3713
3921
|
// The lists are extracted like so:
|
|
3714
3922
|
// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
|
|
@@ -3751,7 +3959,7 @@ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Han
|
|
|
3751
3959
|
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
|
|
3752
3960
|
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
|
|
3753
3961
|
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
|
|
3754
|
-
var ecma14ScriptValues = ecma13ScriptValues + "
|
|
3962
|
+
var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;
|
|
3755
3963
|
|
|
3756
3964
|
var unicodeScriptValues = {
|
|
3757
3965
|
9: ecma9ScriptValues,
|
|
@@ -3787,6 +3995,30 @@ for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
|
|
|
3787
3995
|
|
|
3788
3996
|
var pp$1 = Parser.prototype;
|
|
3789
3997
|
|
|
3998
|
+
// Track disjunction structure to determine whether a duplicate
|
|
3999
|
+
// capture group name is allowed because it is in a separate branch.
|
|
4000
|
+
var BranchID = function BranchID(parent, base) {
|
|
4001
|
+
// Parent disjunction branch
|
|
4002
|
+
this.parent = parent;
|
|
4003
|
+
// Identifies this set of sibling branches
|
|
4004
|
+
this.base = base || this;
|
|
4005
|
+
};
|
|
4006
|
+
|
|
4007
|
+
BranchID.prototype.separatedFrom = function separatedFrom (alt) {
|
|
4008
|
+
// A branch is separate from another branch if they or any of
|
|
4009
|
+
// their parents are siblings in a given disjunction
|
|
4010
|
+
for (var self = this; self; self = self.parent) {
|
|
4011
|
+
for (var other = alt; other; other = other.parent) {
|
|
4012
|
+
if (self.base === other.base && self !== other) { return true }
|
|
4013
|
+
}
|
|
4014
|
+
}
|
|
4015
|
+
return false
|
|
4016
|
+
};
|
|
4017
|
+
|
|
4018
|
+
BranchID.prototype.sibling = function sibling () {
|
|
4019
|
+
return new BranchID(this.parent, this.base)
|
|
4020
|
+
};
|
|
4021
|
+
|
|
3790
4022
|
var RegExpValidationState = function RegExpValidationState(parser) {
|
|
3791
4023
|
this.parser = parser;
|
|
3792
4024
|
this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
|
|
@@ -3803,8 +4035,9 @@ var RegExpValidationState = function RegExpValidationState(parser) {
|
|
|
3803
4035
|
this.lastAssertionIsQuantifiable = false;
|
|
3804
4036
|
this.numCapturingParens = 0;
|
|
3805
4037
|
this.maxBackReference = 0;
|
|
3806
|
-
this.groupNames =
|
|
4038
|
+
this.groupNames = Object.create(null);
|
|
3807
4039
|
this.backReferenceNames = [];
|
|
4040
|
+
this.branchID = null;
|
|
3808
4041
|
};
|
|
3809
4042
|
|
|
3810
4043
|
RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
|
|
@@ -3936,6 +4169,11 @@ pp$1.validateRegExpFlags = function(state) {
|
|
|
3936
4169
|
}
|
|
3937
4170
|
};
|
|
3938
4171
|
|
|
4172
|
+
function hasProp(obj) {
|
|
4173
|
+
for (var _ in obj) { return true }
|
|
4174
|
+
return false
|
|
4175
|
+
}
|
|
4176
|
+
|
|
3939
4177
|
/**
|
|
3940
4178
|
* Validate the pattern part of a given RegExpLiteral.
|
|
3941
4179
|
*
|
|
@@ -3950,7 +4188,7 @@ pp$1.validateRegExpPattern = function(state) {
|
|
|
3950
4188
|
// |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
|
|
3951
4189
|
// exception if _P_ did not conform to the grammar, if any elements of _P_
|
|
3952
4190
|
// were not matched by the parse, or if any Early Error conditions exist.
|
|
3953
|
-
if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames
|
|
4191
|
+
if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
|
|
3954
4192
|
state.switchN = true;
|
|
3955
4193
|
this.regexp_pattern(state);
|
|
3956
4194
|
}
|
|
@@ -3964,8 +4202,9 @@ pp$1.regexp_pattern = function(state) {
|
|
|
3964
4202
|
state.lastAssertionIsQuantifiable = false;
|
|
3965
4203
|
state.numCapturingParens = 0;
|
|
3966
4204
|
state.maxBackReference = 0;
|
|
3967
|
-
state.groupNames
|
|
4205
|
+
state.groupNames = Object.create(null);
|
|
3968
4206
|
state.backReferenceNames.length = 0;
|
|
4207
|
+
state.branchID = null;
|
|
3969
4208
|
|
|
3970
4209
|
this.regexp_disjunction(state);
|
|
3971
4210
|
|
|
@@ -3984,7 +4223,7 @@ pp$1.regexp_pattern = function(state) {
|
|
|
3984
4223
|
for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
|
|
3985
4224
|
var name = list[i];
|
|
3986
4225
|
|
|
3987
|
-
if (state.groupNames
|
|
4226
|
+
if (!state.groupNames[name]) {
|
|
3988
4227
|
state.raise("Invalid named capture referenced");
|
|
3989
4228
|
}
|
|
3990
4229
|
}
|
|
@@ -3992,10 +4231,14 @@ pp$1.regexp_pattern = function(state) {
|
|
|
3992
4231
|
|
|
3993
4232
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
|
|
3994
4233
|
pp$1.regexp_disjunction = function(state) {
|
|
4234
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
4235
|
+
if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
|
|
3995
4236
|
this.regexp_alternative(state);
|
|
3996
4237
|
while (state.eat(0x7C /* | */)) {
|
|
4238
|
+
if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
|
|
3997
4239
|
this.regexp_alternative(state);
|
|
3998
4240
|
}
|
|
4241
|
+
if (trackDisjunction) { state.branchID = state.branchID.parent; }
|
|
3999
4242
|
|
|
4000
4243
|
// Make the same message as V8.
|
|
4001
4244
|
if (this.regexp_eatQuantifier(state, true)) {
|
|
@@ -4008,8 +4251,7 @@ pp$1.regexp_disjunction = function(state) {
|
|
|
4008
4251
|
|
|
4009
4252
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
|
|
4010
4253
|
pp$1.regexp_alternative = function(state) {
|
|
4011
|
-
while (state.pos < state.source.length && this.regexp_eatTerm(state))
|
|
4012
|
-
{ }
|
|
4254
|
+
while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
|
|
4013
4255
|
};
|
|
4014
4256
|
|
|
4015
4257
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
|
|
@@ -4142,12 +4384,41 @@ pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
|
|
|
4142
4384
|
pp$1.regexp_eatUncapturingGroup = function(state) {
|
|
4143
4385
|
var start = state.pos;
|
|
4144
4386
|
if (state.eat(0x28 /* ( */)) {
|
|
4145
|
-
if (state.eat(0x3F /* ? */)
|
|
4146
|
-
this.
|
|
4147
|
-
|
|
4148
|
-
|
|
4387
|
+
if (state.eat(0x3F /* ? */)) {
|
|
4388
|
+
if (this.options.ecmaVersion >= 16) {
|
|
4389
|
+
var addModifiers = this.regexp_eatModifiers(state);
|
|
4390
|
+
var hasHyphen = state.eat(0x2D /* - */);
|
|
4391
|
+
if (addModifiers || hasHyphen) {
|
|
4392
|
+
for (var i = 0; i < addModifiers.length; i++) {
|
|
4393
|
+
var modifier = addModifiers.charAt(i);
|
|
4394
|
+
if (addModifiers.indexOf(modifier, i + 1) > -1) {
|
|
4395
|
+
state.raise("Duplicate regular expression modifiers");
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
if (hasHyphen) {
|
|
4399
|
+
var removeModifiers = this.regexp_eatModifiers(state);
|
|
4400
|
+
if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
|
|
4401
|
+
state.raise("Invalid regular expression modifiers");
|
|
4402
|
+
}
|
|
4403
|
+
for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
|
|
4404
|
+
var modifier$1 = removeModifiers.charAt(i$1);
|
|
4405
|
+
if (
|
|
4406
|
+
removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
|
|
4407
|
+
addModifiers.indexOf(modifier$1) > -1
|
|
4408
|
+
) {
|
|
4409
|
+
state.raise("Duplicate regular expression modifiers");
|
|
4410
|
+
}
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4413
|
+
}
|
|
4414
|
+
}
|
|
4415
|
+
if (state.eat(0x3A /* : */)) {
|
|
4416
|
+
this.regexp_disjunction(state);
|
|
4417
|
+
if (state.eat(0x29 /* ) */)) {
|
|
4418
|
+
return true
|
|
4419
|
+
}
|
|
4420
|
+
state.raise("Unterminated group");
|
|
4149
4421
|
}
|
|
4150
|
-
state.raise("Unterminated group");
|
|
4151
4422
|
}
|
|
4152
4423
|
state.pos = start;
|
|
4153
4424
|
}
|
|
@@ -4169,6 +4440,23 @@ pp$1.regexp_eatCapturingGroup = function(state) {
|
|
|
4169
4440
|
}
|
|
4170
4441
|
return false
|
|
4171
4442
|
};
|
|
4443
|
+
// RegularExpressionModifiers ::
|
|
4444
|
+
// [empty]
|
|
4445
|
+
// RegularExpressionModifiers RegularExpressionModifier
|
|
4446
|
+
pp$1.regexp_eatModifiers = function(state) {
|
|
4447
|
+
var modifiers = "";
|
|
4448
|
+
var ch = 0;
|
|
4449
|
+
while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
|
|
4450
|
+
modifiers += codePointToString(ch);
|
|
4451
|
+
state.advance();
|
|
4452
|
+
}
|
|
4453
|
+
return modifiers
|
|
4454
|
+
};
|
|
4455
|
+
// RegularExpressionModifier :: one of
|
|
4456
|
+
// `i` `m` `s`
|
|
4457
|
+
function isRegularExpressionModifier(ch) {
|
|
4458
|
+
return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
|
|
4459
|
+
}
|
|
4172
4460
|
|
|
4173
4461
|
// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
|
|
4174
4462
|
pp$1.regexp_eatExtendedAtom = function(state) {
|
|
@@ -4247,14 +4535,26 @@ pp$1.regexp_eatExtendedPatternCharacter = function(state) {
|
|
|
4247
4535
|
// `?` GroupName
|
|
4248
4536
|
pp$1.regexp_groupSpecifier = function(state) {
|
|
4249
4537
|
if (state.eat(0x3F /* ? */)) {
|
|
4250
|
-
if (this.regexp_eatGroupName(state)) {
|
|
4251
|
-
|
|
4538
|
+
if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
|
|
4539
|
+
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
4540
|
+
var known = state.groupNames[state.lastStringValue];
|
|
4541
|
+
if (known) {
|
|
4542
|
+
if (trackDisjunction) {
|
|
4543
|
+
for (var i = 0, list = known; i < list.length; i += 1) {
|
|
4544
|
+
var altID = list[i];
|
|
4545
|
+
|
|
4546
|
+
if (!altID.separatedFrom(state.branchID))
|
|
4547
|
+
{ state.raise("Duplicate capture group name"); }
|
|
4548
|
+
}
|
|
4549
|
+
} else {
|
|
4252
4550
|
state.raise("Duplicate capture group name");
|
|
4253
4551
|
}
|
|
4254
|
-
state.groupNames.push(state.lastStringValue);
|
|
4255
|
-
return
|
|
4256
4552
|
}
|
|
4257
|
-
|
|
4553
|
+
if (trackDisjunction) {
|
|
4554
|
+
(known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
|
|
4555
|
+
} else {
|
|
4556
|
+
state.groupNames[state.lastStringValue] = true;
|
|
4557
|
+
}
|
|
4258
4558
|
}
|
|
4259
4559
|
};
|
|
4260
4560
|
|
|
@@ -5176,13 +5476,17 @@ pp.readToken = function(code) {
|
|
|
5176
5476
|
return this.getTokenFromCode(code)
|
|
5177
5477
|
};
|
|
5178
5478
|
|
|
5179
|
-
pp.
|
|
5180
|
-
var code = this.input.charCodeAt(
|
|
5479
|
+
pp.fullCharCodeAt = function(pos) {
|
|
5480
|
+
var code = this.input.charCodeAt(pos);
|
|
5181
5481
|
if (code <= 0xd7ff || code >= 0xdc00) { return code }
|
|
5182
|
-
var next = this.input.charCodeAt(
|
|
5482
|
+
var next = this.input.charCodeAt(pos + 1);
|
|
5183
5483
|
return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
|
|
5184
5484
|
};
|
|
5185
5485
|
|
|
5486
|
+
pp.fullCharCodeAtPos = function() {
|
|
5487
|
+
return this.fullCharCodeAt(this.pos)
|
|
5488
|
+
};
|
|
5489
|
+
|
|
5186
5490
|
pp.skipBlockComment = function() {
|
|
5187
5491
|
var startLoc = this.options.onComment && this.curPosition();
|
|
5188
5492
|
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
|
|
@@ -5759,15 +6063,18 @@ pp.readInvalidTemplateToken = function() {
|
|
|
5759
6063
|
break
|
|
5760
6064
|
|
|
5761
6065
|
case "$":
|
|
5762
|
-
if (this.input[this.pos + 1] !== "{") {
|
|
5763
|
-
|
|
5764
|
-
}
|
|
5765
|
-
|
|
5766
|
-
// falls through
|
|
6066
|
+
if (this.input[this.pos + 1] !== "{") { break }
|
|
6067
|
+
// fall through
|
|
5767
6068
|
case "`":
|
|
5768
6069
|
return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))
|
|
5769
6070
|
|
|
5770
|
-
|
|
6071
|
+
case "\r":
|
|
6072
|
+
if (this.input[this.pos + 1] === "\n") { ++this.pos; }
|
|
6073
|
+
// fall through
|
|
6074
|
+
case "\n": case "\u2028": case "\u2029":
|
|
6075
|
+
++this.curLine;
|
|
6076
|
+
this.lineStart = this.pos + 1;
|
|
6077
|
+
break
|
|
5771
6078
|
}
|
|
5772
6079
|
}
|
|
5773
6080
|
this.raise(this.start, "Unterminated template");
|
|
@@ -5830,6 +6137,7 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
5830
6137
|
if (isNewLine(ch)) {
|
|
5831
6138
|
// Unicode new line characters after \ get removed from output in both
|
|
5832
6139
|
// template literals and strings
|
|
6140
|
+
if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
|
|
5833
6141
|
return ""
|
|
5834
6142
|
}
|
|
5835
6143
|
return String.fromCharCode(ch)
|
|
@@ -5904,11 +6212,9 @@ pp.readWord = function() {
|
|
|
5904
6212
|
// Please use the [github bug tracker][ghbt] to report issues.
|
|
5905
6213
|
//
|
|
5906
6214
|
// [ghbt]: https://github.com/acornjs/acorn/issues
|
|
5907
|
-
//
|
|
5908
|
-
// [walk]: util/walk.js
|
|
5909
6215
|
|
|
5910
6216
|
|
|
5911
|
-
var version = "8.
|
|
6217
|
+
var version = "8.16.0";
|
|
5912
6218
|
|
|
5913
6219
|
Parser.acorn = {
|
|
5914
6220
|
Parser: Parser,
|
|
@@ -5933,11 +6239,10 @@ Parser.acorn = {
|
|
|
5933
6239
|
};
|
|
5934
6240
|
|
|
5935
6241
|
// The main exported interface (under `self.acorn` when in the
|
|
5936
|
-
// browser) is a `parse` function that takes a code string and
|
|
5937
|
-
//
|
|
5938
|
-
// API][api].
|
|
6242
|
+
// browser) is a `parse` function that takes a code string and returns
|
|
6243
|
+
// an abstract syntax tree as specified by the [ESTree spec][estree].
|
|
5939
6244
|
//
|
|
5940
|
-
// [
|
|
6245
|
+
// [estree]: https://github.com/estree/estree
|
|
5941
6246
|
|
|
5942
6247
|
function parse(input, options) {
|
|
5943
6248
|
return Parser.parse(input, options)
|