Skip to content

Commit 575d8c9

Browse files
committed
fix(type): compatible with TS 5.8
1 parent 8bd9cdb commit 575d8c9

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

packages/compiler-core/src/transforms/vFor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export function processFor(
263263
dir: DirectiveNode,
264264
context: TransformContext,
265265
processCodegen?: (forNode: ForNode) => (() => void) | undefined,
266-
) {
266+
): (() => void) | undefined {
267267
if (!dir.exp) {
268268
context.onError(
269269
createCompilerError(ErrorCodes.X_V_FOR_NO_EXPRESSION, dir.loc),

packages/compiler-sfc/src/script/defineModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function processDefineModel(
114114
return true
115115
}
116116

117-
export function genModelProps(ctx: ScriptCompileContext) {
117+
export function genModelProps(ctx: ScriptCompileContext): string | undefined {
118118
if (!ctx.hasDefineModelCall) return
119119

120120
const isProd = !!ctx.options.isProd

packages/reactivity/src/ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export function proxyRefs<T extends object>(
275275
objectWithRefs: T,
276276
): ShallowUnwrapRef<T> {
277277
return isReactive(objectWithRefs)
278-
? objectWithRefs
278+
? (objectWithRefs as any)
279279
: new Proxy(objectWithRefs, shallowUnwrapHandlers)
280280
}
281281

packages/runtime-core/src/scheduler.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,21 @@ const pendingPostFlushCbs: SchedulerJob[] = []
4747
let activePostFlushCbs: SchedulerJob[] | null = null
4848
let postFlushIndex = 0
4949

50-
const resolvedPromise = /*@__PURE__*/ Promise.resolve() as Promise<any>
50+
const resolvedPromise = /*@__PURE__*/ Promise.resolve()
5151
let currentFlushPromise: Promise<void> | null = null
5252

5353
const RECURSION_LIMIT = 100
5454
type CountMap = Map<SchedulerJob, number>
5555

56-
export function nextTick<T = void, R = void>(
56+
export function nextTick(): Promise<void>
57+
export function nextTick<T, R>(
5758
this: T,
58-
fn?: (this: T) => R,
59-
): Promise<Awaited<R>> {
59+
fn: (this: T) => R | Promise<R>,
60+
): Promise<R>
61+
export function nextTick<T, R>(
62+
this: T,
63+
fn?: (this: T) => R | Promise<R>,
64+
): Promise<void | R> {
6065
const p = currentFlushPromise || resolvedPromise
6166
return fn ? p.then(this ? fn.bind(this) : fn) : p
6267
}
@@ -113,7 +118,9 @@ export function queueJob(job: SchedulerJob): void {
113118

114119
function queueFlush() {
115120
if (!currentFlushPromise) {
116-
currentFlushPromise = resolvedPromise.then(flushJobs)
121+
currentFlushPromise = resolvedPromise.then(() => {
122+
flushJobs()
123+
})
117124
}
118125
}
119126

0 commit comments

Comments
 (0)