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: #144
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
  • Loading branch information
belochub committed May 8, 2017
1 parent 5fa7a4c commit 98fe33c
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 98fe33c

Please sign in to comment.