Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit b8c609f

Browse files
committed
Merge remote-tracking branch 'upstream/minor'
2 parents 761f785 + bb5c31e commit b8c609f

File tree

87 files changed

+1801
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1801
-785
lines changed

.eslintrc.cjs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@ module.exports = {
2626
'no-restricted-syntax': [
2727
'error',
2828
banConstEnum,
29-
// since we target ES2015 for baseline support, we need to forbid object
30-
// rest spread usage in destructure as it compiles into a verbose helper.
31-
'ObjectPattern > RestElement',
32-
// tsc compiles assignment spread into Object.assign() calls, but esbuild
33-
// still generates verbose helpers, so spread assignment is also prohiboted
34-
'ObjectExpression > SpreadElement',
35-
'AwaitExpression',
29+
{
30+
selector: 'ObjectPattern > RestElement',
31+
message:
32+
'Our output target is ES2016, and object rest spread results in ' +
33+
'verbose helpers and should be avoided.',
34+
},
35+
{
36+
selector: 'ObjectExpression > SpreadElement',
37+
message:
38+
'esbuild transpiles object spread into very verbose inline helpers.\n' +
39+
'Please use the `extend` helper from @vue/shared instead.',
40+
},
41+
{
42+
selector: 'AwaitExpression',
43+
message:
44+
'Our output target is ES2016, so async/await syntax should be avoided.',
45+
},
3646
],
3747
'sort-imports': ['error', { ignoreDeclarationSort: true }],
3848

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ TODOs.md
1010
.eslintcache
1111
dts-build/packages
1212
*.tsbuildinfo
13+
*.tgz

.vscode/launch.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,15 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": "Jest",
98
"type": "node",
109
"request": "launch",
11-
"program": "${workspaceFolder}/node_modules/.bin/jest",
12-
"stopOnEntry": false,
13-
"args": ["${fileBasename}", "--runInBand", "--detectOpenHandles"],
14-
"cwd": "${workspaceFolder}",
15-
"preLaunchTask": null,
16-
"runtimeExecutable": null,
17-
"runtimeArgs": ["--nolazy"],
18-
"env": {
19-
"NODE_ENV": "development"
20-
},
21-
"console": "integratedTerminal",
22-
"sourceMaps": true,
23-
"windows": {
24-
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
25-
}
10+
"name": "Vitest - Debug Current Test File",
11+
"autoAttachChildProcesses": true,
12+
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
13+
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
14+
"args": ["run", "${relativeFile}"],
15+
"smartStep": true,
16+
"console": "integratedTerminal"
2617
}
2718
]
2819
}

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
## [3.4.22](https://github.com/vuejs/core/compare/v3.4.21...v3.4.22) (2024-04-15)
2+
3+
4+
### Bug Fixes
5+
6+
* **compat:** fix $options mutation + adjust private API initialization ([d58d133](https://github.com/vuejs/core/commit/d58d133b1cde5085cc5ab0012d544cafd62a6ee6)), closes [#10626](https://github.com/vuejs/core/issues/10626) [#10636](https://github.com/vuejs/core/issues/10636)
7+
* **compile-sfc:** analyze v-bind shorthand usage in template ([#10518](https://github.com/vuejs/core/issues/10518)) ([e5919d4](https://github.com/vuejs/core/commit/e5919d4658cfe0bb18c76611dd3c3432c57f94ab)), closes [#10515](https://github.com/vuejs/core/issues/10515)
8+
* **compiler-core:** fix loc.source for end tags with whitespace before > ([16174da](https://github.com/vuejs/core/commit/16174da21d6c8ac0aae027dd964fc35e221ded0a)), closes [#10694](https://github.com/vuejs/core/issues/10694) [#10695](https://github.com/vuejs/core/issues/10695)
9+
* **compiler-core:** fix v-bind shorthand for component :is ([04af950](https://github.com/vuejs/core/commit/04af9504a720c8e6de26c04b1282cf14fa1bcee3)), closes [#10469](https://github.com/vuejs/core/issues/10469) [#10471](https://github.com/vuejs/core/issues/10471)
10+
* **compiler-sfc:** :is() and :where() in compound selectors ([#10522](https://github.com/vuejs/core/issues/10522)) ([660cadc](https://github.com/vuejs/core/commit/660cadc7aadb909ef33a6055c4374902a82607a4)), closes [#10511](https://github.com/vuejs/core/issues/10511)
11+
* **compiler-sfc:** also search for `.tsx` when type import's extension is omitted ([#10637](https://github.com/vuejs/core/issues/10637)) ([34106bc](https://github.com/vuejs/core/commit/34106bc9c715247211273bb9c64712f04bd4879d)), closes [#10635](https://github.com/vuejs/core/issues/10635)
12+
* **compiler-sfc:** fix defineModel coercion for boolean + string union types ([#9603](https://github.com/vuejs/core/issues/9603)) ([0cef65c](https://github.com/vuejs/core/commit/0cef65cee411356e721bbc90d731fc52fc8fce94)), closes [#9587](https://github.com/vuejs/core/issues/9587) [#10676](https://github.com/vuejs/core/issues/10676)
13+
* **compiler-sfc:** fix universal selector scope ([#10551](https://github.com/vuejs/core/issues/10551)) ([54a6afa](https://github.com/vuejs/core/commit/54a6afa75a546078e901ce0882da53b97420fe94)), closes [#10548](https://github.com/vuejs/core/issues/10548)
14+
* **compiler-sfc:** use options module name if options provide runtimeModuleName options ([#10457](https://github.com/vuejs/core/issues/10457)) ([e76d743](https://github.com/vuejs/core/commit/e76d7430aa7470342f3fe263145a0fa92f5898ca)), closes [#10454](https://github.com/vuejs/core/issues/10454)
15+
* **custom-element:** avoid setting attr to null if it is removed ([#9012](https://github.com/vuejs/core/issues/9012)) ([b49306a](https://github.com/vuejs/core/commit/b49306adff4572d90a42ccd231387f16eb966bbe)), closes [#9006](https://github.com/vuejs/core/issues/9006) [#10324](https://github.com/vuejs/core/issues/10324)
16+
* **hydration:** properly handle optimized mode during hydrate node ([#10638](https://github.com/vuejs/core/issues/10638)) ([2ec06fd](https://github.com/vuejs/core/commit/2ec06fd6c8383e11cdf4efcab1707f973bd6a54c)), closes [#10607](https://github.com/vuejs/core/issues/10607)
17+
* **reactivity:** computed should not be detected as true by isProxy ([#10401](https://github.com/vuejs/core/issues/10401)) ([9da34d7](https://github.com/vuejs/core/commit/9da34d7af81607fddd1f32f21b3b4002402ff1cc))
18+
* **reactivity:** fix hasOwnProperty key coercion edge cases ([969c5fb](https://github.com/vuejs/core/commit/969c5fb30f4c725757c7385abfc74772514eae4b))
19+
* **reactivity:** fix tracking when hasOwnProperty is called with non-string value ([c3c5dc9](https://github.com/vuejs/core/commit/c3c5dc93fbccc196771458f0b43cd5b7ad1863f4)), closes [#10455](https://github.com/vuejs/core/issues/10455) [#10464](https://github.com/vuejs/core/issues/10464)
20+
* **runtime-core:** fix errorHandler causes an infinite loop during execution ([#9575](https://github.com/vuejs/core/issues/9575)) ([ab59bed](https://github.com/vuejs/core/commit/ab59bedae4e5e40b28804d88a51305b236d4a873))
21+
* **runtime-core:** handle invalid values in callWithAsyncErrorHandling ([53d15d3](https://github.com/vuejs/core/commit/53d15d3f76184eed67a18d35e43d9a2062f8e121))
22+
* **runtime-core:** show hydration mismatch details for non-rectified mismatches too when __PROD_HYDRATION_MISMATCH_DETAILS__ is set ([#10599](https://github.com/vuejs/core/issues/10599)) ([0dea7f9](https://github.com/vuejs/core/commit/0dea7f9a260d93eb6c39aabac8c94c2c9b2042dd))
23+
* **runtime-dom:** `v-model` string/number coercion for multiselect options ([#10576](https://github.com/vuejs/core/issues/10576)) ([db374e5](https://github.com/vuejs/core/commit/db374e54c9f5e07324728b85c74eca84e28dd352))
24+
* **runtime-dom:** fix css v-bind for suspensed components ([#8523](https://github.com/vuejs/core/issues/8523)) ([67722ba](https://github.com/vuejs/core/commit/67722ba23b7c36ab8f3fa2d2b4df08e4ddc322e1)), closes [#8520](https://github.com/vuejs/core/issues/8520)
25+
* **runtime-dom:** force update v-model number with leading 0 ([#10506](https://github.com/vuejs/core/issues/10506)) ([15ffe8f](https://github.com/vuejs/core/commit/15ffe8f2c954359770c57e4d9e589b0b622e4a60)), closes [#10503](https://github.com/vuejs/core/issues/10503) [#10615](https://github.com/vuejs/core/issues/10615)
26+
* **runtime-dom:** sanitize wrongly passed string value as event handler ([#8953](https://github.com/vuejs/core/issues/8953)) ([7ccd453](https://github.com/vuejs/core/commit/7ccd453dd004076cad49ec9f56cd5fe97b7b6ed8)), closes [#8818](https://github.com/vuejs/core/issues/8818)
27+
* **ssr:** don't render v-if comments in TransitionGroup ([#6732](https://github.com/vuejs/core/issues/6732)) ([5a96267](https://github.com/vuejs/core/commit/5a9626708e970c6fc0b6f786e3c80c22273d126f)), closes [#6715](https://github.com/vuejs/core/issues/6715)
28+
* **Transition:** ensure the KeepAlive children unmount w/ out-in mode ([#10632](https://github.com/vuejs/core/issues/10632)) ([fc99e4d](https://github.com/vuejs/core/commit/fc99e4d3f01b190ef9fd3c218a668ba9124a32bc)), closes [#10620](https://github.com/vuejs/core/issues/10620)
29+
* **TransitionGroup:** avoid set transition hooks for comment nodes and text nodes ([#9421](https://github.com/vuejs/core/issues/9421)) ([140a768](https://github.com/vuejs/core/commit/140a7681cc3bba22f55d97fd85a5eafe97a1230f)), closes [#4621](https://github.com/vuejs/core/issues/4621) [#4622](https://github.com/vuejs/core/issues/4622) [#5153](https://github.com/vuejs/core/issues/5153) [#5168](https://github.com/vuejs/core/issues/5168) [#7898](https://github.com/vuejs/core/issues/7898) [#9067](https://github.com/vuejs/core/issues/9067)
30+
* **types:** avoid merging object union types when using withDefaults ([#10596](https://github.com/vuejs/core/issues/10596)) ([37ba93c](https://github.com/vuejs/core/commit/37ba93c213a81f99a68a99ef5d4065d61b150ba3)), closes [#10594](https://github.com/vuejs/core/issues/10594)
31+
32+
33+
### Performance Improvements
34+
35+
* add `__NO_SIDE_EFFECTS__` comments ([#9053](https://github.com/vuejs/core/issues/9053)) ([d46df6b](https://github.com/vuejs/core/commit/d46df6bdb14b0509eb2134b3f85297a306821c61))
36+
* optimize component props/slots internal object checks ([6af733d](https://github.com/vuejs/core/commit/6af733d68eb400a3d2c5ef5f465fff32b72a324e))
37+
* **ssr:** avoid calling markRaw on component instance proxy ([4bc9f39](https://github.com/vuejs/core/commit/4bc9f39f028af7313e5cf24c16915a1985d27bf8))
38+
* **ssr:** optimize setup context creation for ssr in v8 ([ca84316](https://github.com/vuejs/core/commit/ca84316bfb3410efe21333670a6ad5cd21857396))
39+
40+
41+
142
## [3.4.21](https://github.com/vuejs/core/compare/v3.4.20...v3.4.21) (2024-02-28)
243

344

FUNDING.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"drips": {
3+
"ethereum": {
4+
"ownedBy": "0x5393BdeA2a020769256d9f337B0fc81a2F64850A"
5+
}
6+
}
7+
}

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"dev": "node scripts/dev.js vue vue-vapor",
88
"build": "node scripts/build.js",
9-
"build-dts": "tsc -p tsconfig.build.json && rollup -c rollup.dts.config.js",
9+
"build-dts": "tsc -p tsconfig.build-browser.json && tsc -p tsconfig.build-node.json && rollup -c rollup.dts.config.js",
1010
"clean": "rimraf packages/*/dist temp .eslintcache",
1111
"size": "run-s \"size-*\" && tsx scripts/usage-size.ts",
1212
"size-global": "node scripts/build.js vue vue-vapor runtime-dom runtime-vapor compiler-dom compiler-vapor -f global -p --size",
@@ -20,7 +20,7 @@
2020
"test-unit": "vitest -c vitest.unit.config.ts",
2121
"test-e2e": "node scripts/build.js vue -f global -d && vitest -c vitest.e2e.config.ts",
2222
"test-dts": "run-s build-dts test-dts-only",
23-
"test-dts-only": "tsc -p ./packages/dts-test/tsconfig.test.json",
23+
"test-dts-only": "tsc -p packages/dts-built-test/tsconfig.json && tsc -p ./packages/dts-test/tsconfig.test.json",
2424
"test-coverage": "vitest -c vitest.unit.config.ts --coverage",
2525
"test-bench": "vitest bench",
2626
"release": "node scripts/release.js",
@@ -59,9 +59,9 @@
5959
"node": ">=18.12.0"
6060
},
6161
"devDependencies": {
62-
"@babel/parser": "^7.24.0",
62+
"@babel/parser": "^7.24.1",
6363
"@babel/types": "^7.24.0",
64-
"@codspeed/vitest-plugin": "^2.3.1",
64+
"@codspeed/vitest-plugin": "^3.1.0",
6565
"@rollup/plugin-alias": "^5.1.0",
6666
"@rollup/plugin-commonjs": "^25.0.7",
6767
"@rollup/plugin-json": "^6.1.0",
@@ -70,16 +70,16 @@
7070
"@rollup/plugin-terser": "^0.4.4",
7171
"@types/hash-sum": "^1.0.2",
7272
"@types/minimist": "^1.2.5",
73-
"@types/node": "^20.11.25",
73+
"@types/node": "^20.12.5",
7474
"@types/semver": "^7.5.8",
75-
"@typescript-eslint/eslint-plugin": "^7.1.1",
76-
"@typescript-eslint/parser": "^7.1.1",
77-
"@vitest/coverage-istanbul": "^1.3.1",
78-
"@vitest/ui": "^1.2.2",
75+
"@typescript-eslint/eslint-plugin": "^7.4.0",
76+
"@typescript-eslint/parser": "^7.4.0",
77+
"@vitest/coverage-istanbul": "^1.4.0",
78+
"@vitest/ui": "^1.4.0",
7979
"@vue/consolidate": "1.0.0",
8080
"conventional-changelog-cli": "^4.1.0",
8181
"enquirer": "^2.4.1",
82-
"esbuild": "^0.20.1",
82+
"esbuild": "^0.20.2",
8383
"esbuild-plugin-polyfill-node": "^0.3.0",
8484
"eslint": "^8.57.0",
8585
"eslint-define-config": "^2.1.0",
@@ -99,21 +99,21 @@
9999
"prettier": "^3.2.5",
100100
"pretty-bytes": "^6.1.1",
101101
"pug": "^3.0.2",
102-
"puppeteer": "~22.4.1",
102+
"puppeteer": "~22.6.3",
103103
"rimraf": "^5.0.5",
104-
"rollup": "^4.12.1",
104+
"rollup": "^4.13.2",
105105
"rollup-plugin-dts": "^6.1.0",
106106
"rollup-plugin-esbuild": "^6.1.1",
107107
"rollup-plugin-polyfill-node": "^0.13.0",
108108
"semver": "^7.6.0",
109109
"serve": "^14.2.1",
110-
"simple-git-hooks": "^2.10.0",
111-
"terser": "^5.29.1",
110+
"simple-git-hooks": "^2.11.1",
111+
"terser": "^5.30.1",
112112
"todomvc-app-css": "^2.4.3",
113113
"tslib": "^2.6.2",
114-
"tsx": "^4.7.1",
115-
"typescript": "^5.2.2",
116-
"vite": "^5.1.5",
117-
"vitest": "^1.3.1"
114+
"tsx": "^4.7.2",
115+
"typescript": "~5.4.5",
116+
"vite": "^5.2.7",
117+
"vitest": "^1.4.0"
118118
}
119119
}

packages/compiler-core/__tests__/parse.spec.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,16 @@ describe('compiler: parse', () => {
20702070
baseParse(`<Foo>`, { parseMode: 'sfc', onError() {} })
20712071
expect(() => baseParse(`{ foo }`)).not.toThrow()
20722072
})
2073+
2074+
test('correct loc when the closing > is foarmatted', () => {
2075+
const [span] = baseParse(`<span></span
2076+
2077+
>`).children
2078+
2079+
expect(span.loc.source).toBe('<span></span\n \n >')
2080+
expect(span.loc.start.offset).toBe(0)
2081+
expect(span.loc.end.offset).toBe(27)
2082+
})
20732083
})
20742084

20752085
describe('decodeEntities option', () => {
@@ -2166,7 +2176,7 @@ describe('compiler: parse', () => {
21662176
})
21672177

21682178
test('should remove leading newline character immediately following the pre element start tag', () => {
2169-
const ast = baseParse(`<pre>\n foo bar </pre>`, {
2179+
const ast = parse(`<pre>\n foo bar </pre>`, {
21702180
isPreTag: tag => tag === 'pre',
21712181
})
21722182
expect(ast.children).toHaveLength(1)
@@ -2176,7 +2186,7 @@ describe('compiler: parse', () => {
21762186
})
21772187

21782188
test('should NOT remove leading newline character immediately following child-tag of pre element', () => {
2179-
const ast = baseParse(`<pre><span></span>\n foo bar </pre>`, {
2189+
const ast = parse(`<pre><span></span>\n foo bar </pre>`, {
21802190
isPreTag: tag => tag === 'pre',
21812191
})
21822192
const preElement = ast.children[0] as ElementNode
@@ -2187,7 +2197,7 @@ describe('compiler: parse', () => {
21872197
})
21882198

21892199
test('self-closing pre tag', () => {
2190-
const ast = baseParse(`<pre/><span>\n foo bar</span>`, {
2200+
const ast = parse(`<pre/><span>\n foo bar</span>`, {
21912201
isPreTag: tag => tag === 'pre',
21922202
})
21932203
const elementAfterPre = ast.children[1] as ElementNode
@@ -2196,7 +2206,7 @@ describe('compiler: parse', () => {
21962206
})
21972207

21982208
test('should NOT condense whitespaces in RCDATA text mode', () => {
2199-
const ast = baseParse(`<textarea>Text:\n foo</textarea>`, {
2209+
const ast = parse(`<textarea>Text:\n foo</textarea>`, {
22002210
parseMode: 'html',
22012211
})
22022212
const preElement = ast.children[0] as ElementNode

packages/compiler-core/__tests__/transforms/transformElement.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,24 @@ describe('compiler: element transform', () => {
12311231
})
12321232
})
12331233

1234+
test('dynamic binding shorthand', () => {
1235+
const { node, root } = parseWithBind(`<component :is />`)
1236+
expect(root.helpers).toContain(RESOLVE_DYNAMIC_COMPONENT)
1237+
expect(node).toMatchObject({
1238+
isBlock: true,
1239+
tag: {
1240+
callee: RESOLVE_DYNAMIC_COMPONENT,
1241+
arguments: [
1242+
{
1243+
type: NodeTypes.SIMPLE_EXPRESSION,
1244+
content: 'is',
1245+
isStatic: false,
1246+
},
1247+
],
1248+
},
1249+
})
1250+
})
1251+
12341252
test('is casting', () => {
12351253
const { node, root } = parseWithBind(`<div is="vue:foo" />`)
12361254
expect(root.helpers).toContain(RESOLVE_COMPONENT)

packages/compiler-core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.4.21",
3+
"version": "3.4.22",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",
@@ -46,11 +46,11 @@
4646
},
4747
"homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/compiler-core#readme",
4848
"dependencies": {
49-
"@babel/parser": "^7.24.0",
49+
"@babel/parser": "^7.24.1",
5050
"@vue/shared": "workspace:*",
5151
"entities": "^4.5.0",
5252
"estree-walker": "^2.0.2",
53-
"source-map-js": "^1.0.2"
53+
"source-map-js": "^1.2.0"
5454
},
5555
"devDependencies": {
5656
"@babel/types": "^7.24.0"

packages/compiler-core/src/codegen.ts

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
getVNodeHelper,
2929
locStub,
3030
} from './ast'
31-
import { type RawSourceMap, SourceMapGenerator } from 'source-map-js'
31+
import { SourceMapGenerator } from 'source-map-js'
3232
import {
3333
advancePositionWithMutation,
3434
assert,
@@ -56,6 +56,45 @@ import {
5656
} from './runtimeHelpers'
5757
import type { ImportItem } from './transform'
5858

59+
/**
60+
* The `SourceMapGenerator` type from `source-map-js` is a bit incomplete as it
61+
* misses `toJSON()`. We also need to add types for internal properties which we
62+
* need to access for better performance.
63+
*
64+
* Since TS 5.3, dts generation starts to strangely include broken triple slash
65+
* references for source-map-js, so we are inlining all source map related types
66+
* here to to workaround that.
67+
*/
68+
export interface CodegenSourceMapGenerator {
69+
setSourceContent(sourceFile: string, sourceContent: string): void
70+
// SourceMapGenerator has this method but the types do not include it
71+
toJSON(): RawSourceMap
72+
_sources: Set<string>
73+
_names: Set<string>
74+
_mappings: {
75+
add(mapping: MappingItem): void
76+
}
77+
}
78+
79+
export interface RawSourceMap {
80+
file?: string
81+
sourceRoot?: string
82+
version: string
83+
sources: string[]
84+
names: string[]
85+
sourcesContent?: string[]
86+
mappings: string
87+
}
88+
89+
interface MappingItem {
90+
source: string
91+
generatedLine: number
92+
generatedColumn: number
93+
originalLine: number
94+
originalColumn: number
95+
name: string | null
96+
}
97+
5998
const PURE_ANNOTATION = `/*#__PURE__*/`
6099

61100
const aliasHelper = (s: symbol) => `${helperNameMap[s]}: _${helperNameMap[s]}`
@@ -101,7 +140,7 @@ export interface CodegenContext
101140
offset: number
102141
indentLevel: number
103142
pure: boolean
104-
map?: SourceMapGenerator
143+
map?: CodegenSourceMapGenerator
105144
helper(key: symbol): string
106145
push(code: string, newlineIndex?: number, node?: CodegenNode): void
107146
indent(): void
@@ -234,14 +273,14 @@ function createCodegenContext(
234273
generatedLine: context.line,
235274
generatedColumn: context.column - 1,
236275
source: filename,
237-
// @ts-expect-error it is possible to be null
238276
name,
239277
})
240278
}
241279

242280
if (!__BROWSER__ && sourceMap) {
243281
// lazy require source-map implementation, only in non-browser builds
244-
context.map = new SourceMapGenerator()
282+
context.map =
283+
new SourceMapGenerator() as unknown as CodegenSourceMapGenerator
245284
context.map.setSourceContent(filename, context.source)
246285
context.map._sources.add(filename)
247286
}

0 commit comments

Comments
 (0)