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

Unified Diff: src/json-parser.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 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 | « src/isolate-inl.h ('k') | src/json-stringifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.cc
diff --git a/src/json-parser.cc b/src/json-parser.cc
index e1a342150cbad0e5a7103d896478d3b2f47cc683..784d55d5514e778daf81664b67c58bd56bf7390c 100644
--- a/src/json-parser.cc
+++ b/src/json-parser.cc
@@ -83,7 +83,7 @@ bool JsonParseInternalizer::RecurseAndApply(Handle<JSReceiver> holder,
ASSIGN_RETURN_ON_EXCEPTION_VALUE(
isolate_, result, InternalizeJsonProperty(holder, name), false);
Maybe<bool> change_result = Nothing<bool>();
- if (result->IsUndefined()) {
+ if (result->IsUndefined(isolate_)) {
change_result = JSReceiver::DeletePropertyOrElement(holder, name, SLOPPY);
} else {
PropertyDescriptor desc;
@@ -751,13 +751,13 @@ Handle<String> JsonParser<seq_one_byte>::ScanJsonString() {
Handle<String> result;
while (true) {
Object* element = string_table->KeyAt(entry);
- if (element == isolate()->heap()->undefined_value()) {
+ if (element->IsUndefined(isolate())) {
// Lookup failure.
result =
factory()->InternalizeOneByteString(seq_source_, position_, length);
break;
}
- if (element != isolate()->heap()->the_hole_value() &&
+ if (!element->IsTheHole(isolate()) &&
String::cast(element)->IsOneByteEqualTo(string_vector)) {
result = Handle<String>(String::cast(element), isolate());
#ifdef DEBUG
« no previous file with comments | « src/isolate-inl.h ('k') | src/json-stringifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698