Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/compiler-core/src/transforms/vFor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export function processFor(
dir: DirectiveNode,
context: TransformContext,
processCodegen?: (forNode: ForNode) => (() => void) | undefined,
) {
): (() => void) | undefined {
if (!dir.exp) {
context.onError(
createCompilerError(ErrorCodes.X_V_FOR_NO_EXPRESSION, dir.loc),
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/script/defineModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function processDefineModel(
return true
}

export function genModelProps(ctx: ScriptCompileContext) {
export function genModelProps(ctx: ScriptCompileContext): string | undefined {
if (!ctx.hasDefineModelCall) return

const isProd = !!ctx.options.isProd
Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export function proxyRefs<T extends object>(
objectWithRefs: T,
): ShallowUnwrapRef<T> {
return isReactive(objectWithRefs)
? objectWithRefs
? (objectWithRefs as any)
: new Proxy(objectWithRefs, shallowUnwrapHandlers)
}

Expand Down
17 changes: 12 additions & 5 deletions packages/runtime-core/src/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,21 @@ const pendingPostFlushCbs: SchedulerJob[] = []
let activePostFlushCbs: SchedulerJob[] | null = null
let postFlushIndex = 0

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

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

export function nextTick<T = void, R = void>(
export function nextTick(): Promise<void>
export function nextTick<T, R>(
this: T,
fn?: (this: T) => R,
): Promise<Awaited<R>> {
fn: (this: T) => R | Promise<R>,
): Promise<R>
export function nextTick<T, R>(
this: T,
fn?: (this: T) => R | Promise<R>,
): Promise<void | R> {
const p = currentFlushPromise || resolvedPromise
return fn ? p.then(this ? fn.bind(this) : fn) : p
}
Expand Down Expand Up @@ -113,7 +118,9 @@ export function queueJob(job: SchedulerJob): void {

function queueFlush() {
if (!currentFlushPromise) {
currentFlushPromise = resolvedPromise.then(flushJobs)
currentFlushPromise = resolvedPromise.then(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested that revert this change and the change of line 50.
tsc works fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I just thought we can get rid of the type assertion, I can change it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted.

flushJobs()
})
}
}

Expand Down