Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(runtime-vapor): refactor apiCreateIf #12629

Open
wants to merge 6 commits into
base: vapor
Choose a base branch
from
Open
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
Prev Previous commit
chore: minor tweaks
  • Loading branch information
edison1105 committed Jan 1, 2025
commit 06f525249d8e0dfe209cd38b75b4b755b10cdc45
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok) ? () => {
const n2 = t0()
return n2
} : _ctx.orNot ? () => {
} : (_ctx.orNot) ? () => {
const n5 = t1()
const n6 = t2()
return [n5, n6]
Expand Down Expand Up @@ -104,7 +104,7 @@ export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok) ? () => {
const n2 = t0()
return n2
} : _ctx.orNot ? () => {
} : (_ctx.orNot) ? () => {
const n4 = t1()
return n4
} : () => {
Expand All @@ -124,7 +124,7 @@ export function render(_ctx) {
const n0 = _createIf(() => (_ctx.ok) ? () => {
const n2 = t0()
return n2
} : _ctx.orNot ? () => {
} : (_ctx.orNot) ? () => {
const n4 = t1()
return n4
} : undefined)
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-vapor/src/generators/if.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export function genIf(
const [frag, push] = buildCodeFragment()

const codes: CodeFragment[] = [
isNested ? undefined : '() => (',
isNested ? '(' : '() => (',
...genExpression(condition, context),
isNested ? undefined : ')',
')',
]

let positiveArg = genBlock(positive, context)
Expand Down
Loading