Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: src/api.cc

Issue 2026563002: [json] implement InternalizeJSONProperty in C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase and address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/js/json.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 9ffb4dad206fe969d03bb0954c22160ae69eb35c..d6336f2846be74c571a5b694d35529236c76af7c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2742,9 +2742,10 @@ MaybeLocal<Value> JSON::Parse(Isolate* v8_isolate, Local<String> json_string) {
PREPARE_FOR_EXECUTION_WITH_ISOLATE(isolate, JSON, Parse, Value);
i::Handle<i::String> string = Utils::OpenHandle(*json_string);
i::Handle<i::String> source = i::String::Flatten(string);
+ i::Handle<i::Object> undefined = isolate->factory()->undefined_value();
auto maybe = source->IsSeqOneByteString()
- ? i::JsonParser<true>::Parse(source)
- : i::JsonParser<false>::Parse(source);
+ ? i::JsonParser<true>::Parse(isolate, source, undefined)
+ : i::JsonParser<false>::Parse(isolate, source, undefined);
Local<Value> result;
has_pending_exception = !ToLocal<Value>(maybe, &result);
RETURN_ON_FAILED_EXECUTION(Value);
@@ -2756,9 +2757,10 @@ MaybeLocal<Value> JSON::Parse(Local<Context> context,
PREPARE_FOR_EXECUTION(context, JSON, Parse, Value);
i::Handle<i::String> string = Utils::OpenHandle(*json_string);
i::Handle<i::String> source = i::String::Flatten(string);
+ i::Handle<i::Object> undefined = isolate->factory()->undefined_value();
auto maybe = source->IsSeqOneByteString()
- ? i::JsonParser<true>::Parse(source)
- : i::JsonParser<false>::Parse(source);
+ ? i::JsonParser<true>::Parse(isolate, source, undefined)
+ : i::JsonParser<false>::Parse(isolate, source, undefined);
Local<Value> result;
has_pending_exception = !ToLocal<Value>(maybe, &result);
RETURN_ON_FAILED_EXECUTION(Value);
« no previous file with comments | « no previous file | src/js/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698