Skip to content

Commit

Permalink
feat: 收敛 renderer 的参数
Browse files Browse the repository at this point in the history
BREAKING CHANGE: a6deec8
  • Loading branch information
meixg committed Dec 3, 2021
1 parent b7b6b4e commit c0e63f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/target-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ export default class ToJSCompiler implements TargetCodeGenerator {
if (options.bareFunctionBody) {
emitter.writeLine('let exports = {}, module = { exports };')
this.doCompileToSource(sourceFile, options, emitter)
emitter.writeLine('return module.exports(data, {noDataOutput});')
emitter.writeLine('return module.exports(data, info);')
} else if (options.bareFunction) {
emitter.writeFunction('render', ['data', 'info'], () => {
emitter.writeLine('let noDataOutput = info && info.noDataOutput;')
emitter.writeLine('let exports = {}, module = { exports };')
this.doCompileToSource(sourceFile, options, emitter)
emitter.writeLine('return module.exports(data, {noDataOutput});')
emitter.writeLine('return module.exports(data, info);')
})
} else {
this.doCompileToSource(sourceFile, options, emitter)
Expand Down

0 comments on commit c0e63f9

Please sign in to comment.