Skip to content

Commit

Permalink
fix: compile ||
Browse files Browse the repository at this point in the history
  • Loading branch information
shirookie authored and harttle committed Feb 3, 2021
1 parent 4a65e6e commit 214058b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/emitters/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,7 @@ export class PHPEmitter extends Emitter {
this.writeSyntaxNode(node.rhs)
break
case '||':
this.write('isset(')
this.writeSyntaxNode(node.lhs)
this.write(')')
this.write(' ? ')
this.writeSyntaxNode(node.lhs)
this.write(' : ')
Expand Down
2 changes: 1 addition & 1 deletion test/unit/emitters/emitter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ describe('PHPEmitter', function () {
}
})

expect(emitter.fullText()).toEqual('isset($foo) ? $foo : $bar')
expect(emitter.fullText()).toEqual('$foo ? $foo : $bar')
})

it('should write isset', function () {
Expand Down

0 comments on commit 214058b

Please sign in to comment.