Skip to content

Commit

Permalink
parser: fix '[' being parsed as an empty array
Browse files Browse the repository at this point in the history
PR-URL: metarhia/jstp#144
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
  • Loading branch information
belochub committed Jul 21, 2018
1 parent fe96c62 commit c46a3b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/jsrs_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,11 @@ Local<Value> ParseArray(Isolate* isolate,
}
}

if (is_empty) {
THROW_EXCEPTION(SyntaxError, "Invalid format in array");
return Undefined(isolate);
}

return array;
}

Expand Down

0 comments on commit c46a3b1

Please sign in to comment.