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

Unified Diff: src/runtime/runtime-object.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing wrongly wrapped lines 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
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 9bef97df2ac737079d50cc449cdc066db3b68965..d430ce6d9c8ef944bc1674b3646886d12c0dda54 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -18,7 +18,7 @@ namespace internal {
MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
Handle<Object> object,
Handle<Object> key) {
- if (object->IsUndefined() || object->IsNull()) {
+ if (object->IsUndefined(isolate) || object->IsNull()) {
THROW_NEW_ERROR(
isolate,
NewTypeError(MessageTemplate::kNonObjectPropertyLoad, key, object),
@@ -62,7 +62,9 @@ static MaybeHandle<Object> KeyedGetObjectProperty(Isolate* isolate,
PropertyCell* cell = PropertyCell::cast(dictionary->ValueAt(entry));
if (cell->property_details().type() == DATA) {
Object* value = cell->value();
- if (!value->IsTheHole()) return Handle<Object>(value, isolate);
+ if (!value->IsTheHole(isolate)) {
+ return Handle<Object>(value, isolate);
+ }
// If value is the hole (meaning, absent) do the general lookup.
}
}
@@ -194,7 +196,7 @@ RUNTIME_FUNCTION(Runtime_ObjectHasOwnProperty) {
key_is_array_index
? index < static_cast<uint32_t>(String::cast(*object)->length())
: key->Equals(isolate->heap()->length_string()));
- } else if (object->IsNull() || object->IsUndefined()) {
+ } else if (object->IsNull() || object->IsUndefined(isolate)) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kUndefinedOrNullToObject));
}
@@ -207,7 +209,7 @@ MaybeHandle<Object> Runtime::SetObjectProperty(Isolate* isolate,
Handle<Object> key,
Handle<Object> value,
LanguageMode language_mode) {
- if (object->IsUndefined() || object->IsNull()) {
+ if (object->IsUndefined(isolate) || object->IsNull()) {
THROW_NEW_ERROR(
isolate,
NewTypeError(MessageTemplate::kNonObjectPropertyStore, key, object),

Powered by Google App Engine
This is Rietveld 408576698