Skip to content

Commit

Permalink
fix(compiler-sfc): fix script setup hidden flag codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 24, 2021
1 parent ac853ff commit a5a66c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,11 +946,13 @@ export function compileScript(
allBindings[key] = true
}
}
returned = `{ ${Object.keys(allBindings).join(', ')}${
const keys = Object.keys(allBindings)
if (!__TEST__) {
// the `__isScriptSetup: true` flag is used by componentPublicInstance
// proxy to allow properties that start with $ or _
__TEST__ ? `` : `, __isScriptSetup: true`
} }`
keys.push(`__isScriptSetup: true`)
}
returned = `{ ${keys.join(', ')} }`
}
s.appendRight(endOffset, `\nreturn ${returned}\n}\n\n`)

Expand Down

0 comments on commit a5a66c5

Please sign in to comment.