@@ -18,6 +18,7 @@ bool JSONParser::Parse(const std::string& content) {
1818 DCHECK (!parsed_);
1919
2020 Isolate* isolate = isolate_.get ();
21+ v8::Locker locker (isolate);
2122 v8::Isolate::Scope isolate_scope (isolate);
2223 v8::HandleScope handle_scope (isolate);
2324
@@ -47,6 +48,7 @@ bool JSONParser::Parse(const std::string& content) {
4748std::optional<std::string> JSONParser::GetTopLevelStringField (
4849 std::string_view field) {
4950 Isolate* isolate = isolate_.get ();
51+ v8::Locker locker (isolate);
5052 v8::Isolate::Scope isolate_scope (isolate);
5153 v8::HandleScope handle_scope (isolate);
5254
@@ -73,6 +75,7 @@ std::optional<std::string> JSONParser::GetTopLevelStringField(
7375
7476std::optional<bool > JSONParser::GetTopLevelBoolField (std::string_view field) {
7577 Isolate* isolate = isolate_.get ();
78+ v8::Locker locker (isolate);
7679 v8::Isolate::Scope isolate_scope (isolate);
7780 v8::HandleScope handle_scope (isolate);
7881
@@ -105,6 +108,8 @@ std::optional<bool> JSONParser::GetTopLevelBoolField(std::string_view field) {
105108std::optional<JSONParser::StringDict> JSONParser::GetTopLevelStringDict (
106109 std::string_view field) {
107110 Isolate* isolate = isolate_.get ();
111+ v8::Locker locker (isolate);
112+ v8::Isolate::Scope isolate_scope (isolate);
108113 v8::HandleScope handle_scope (isolate);
109114 Local<Context> context = context_.Get (isolate);
110115 Local<Object> content_object = content_.Get (isolate);
0 commit comments