Skip to content

Commit

Permalink
Corrige bug na declaração de funções
Browse files Browse the repository at this point in the history
Corrigindo bug que permite declarar funções sem identificador no escopo
global.
  • Loading branch information
Andre0n committed Jan 8, 2023
1 parent f18d1d3 commit a921c7d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,10 +798,7 @@ module.exports = class Parser {

declaration() {
try {
if (
this.check(tokenTypes.FUNÇÃO) &&
this.checkNext(tokenTypes.IDENTIFIER)
) {
if (this.check(tokenTypes.FUNÇÃO)) {
this.consume(tokenTypes.FUNÇÃO, null);
return this.function("função");
}
Expand Down

0 comments on commit a921c7d

Please # to comment.