GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: enter and lock isolate properly in json parser · nodejs/node@5e14fd1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • json_parser.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/json_parser.cc‎

Copy file name to clipboardExpand all lines: src/json_parser.cc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {
4748
std::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

7476
std::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) {
105108
std::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

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.