From 98fe33c72dfefb609930f21dea1844dd40abbf53 Mon Sep 17 00:00:00 2001 From: Mykola Bilochub Date: Mon, 8 May 2017 00:35:56 +0300 Subject: [PATCH] parser: fix '[' being parsed as an empty array PR-URL: https://github.com/metarhia/JSTP/pull/144 Reviewed-By: Alexey Orlenko --- src/jsrs_parser.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/jsrs_parser.cc b/src/jsrs_parser.cc index 53f36d03..3aa1177e 100644 --- a/src/jsrs_parser.cc +++ b/src/jsrs_parser.cc @@ -681,6 +681,11 @@ Local ParseArray(Isolate* isolate, } } + if (is_empty) { + THROW_EXCEPTION(SyntaxError, "Invalid format in array"); + return Undefined(isolate); + } + return array; }