i::Handle<i::JSObject> obj(i::JSObject::cast(raw_obj), isolate_);
i::Handle<i::String> name = isolate_->factory()->stack_string();
if (!i::JSReceiver::HasProperty(obj, name)) return v8::Local<Value>();
- i::Handle<i::Object> value = i::Object::GetProperty(obj, name);
- if (value.is_null()) return v8::Local<Value>();
+ i::Handle<i::Object> value;
+ if (!i::Object::GetProperty(obj, name).ToHandle(&value)) {
+ return v8::Local<Value>();
+ }
return v8::Utils::ToLocal(scope.CloseAndEscape(value));
} else {
return v8::Local<Value>();
i::Handle<i::String> fmt_str =
isolate->factory()->InternalizeUtf8String(name);
i::Handle<i::Object> object_fun =
- i::GlobalObject::GetPropertyNoExceptionThrown(
- isolate->js_builtins_object(), fmt_str);
+ i::Object::GetProperty(
+ isolate->js_builtins_object(), fmt_str).ToHandleChecked();
i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(object_fun);
return i::Execution::Call(isolate, fun, recv, argc, argv);
}
EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate));
i::Handle<i::JSArray> self = Utils::OpenHandle(this);
i::Handle<i::Object> obj =
- i::Object::GetElementNoExceptionThrown(isolate, self, index);
+ i::Object::GetElement(isolate, self, index).ToHandleChecked();
i::Handle<i::JSObject> jsobj = i::Handle<i::JSObject>::cast(obj);
return scope.Escape(Utils::StackFrameToLocal(jsobj));
}
const char* builtin_name) {
i::Handle<i::String> string =
isolate->factory()->InternalizeUtf8String(builtin_name);
- return *i::GlobalObject::GetPropertyNoExceptionThrown(
- isolate->js_builtins_object(), string);
+ return *i::Object::GetProperty(
+ isolate->js_builtins_object(), string).ToHandleChecked();
}
isolate_debug->debug_context()->global_object());
i::Handle<i::String> name = isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("MakeMirror"));
- i::Handle<i::Object> fun_obj = i::Object::GetProperty(debug, name);
- ASSERT(!fun_obj.is_null());
+ i::Handle<i::Object> fun_obj =
+ i::Object::GetProperty(debug, name).ToHandleChecked();
i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj);
v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun);
const int kArgc = 1;
#define INSTALL_NATIVE(Type, name, var) \
Handle<String> var##_name = \
- factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR(name)); \
- Handle<Object> var##_native = GlobalObject::GetPropertyNoExceptionThrown( \
- handle(native_context()->builtins()), var##_name); \
+ factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR(name)); \
+ Handle<Object> var##_native = Object::GetProperty( \
+ handle(native_context()->builtins()), var##_name).ToHandleChecked(); \
native_context()->set_##var(Type::cast(*var##_native));
{ Handle<String> key = factory()->function_class_string();
Handle<JSFunction> function =
Handle<JSFunction>::cast(Object::GetProperty(
- isolate()->global_object(), key));
+ isolate()->global_object(), key).ToHandleChecked());
Handle<JSObject> proto =
Handle<JSObject>(JSObject::cast(function->instance_prototype()));
Handle<String> property_string = factory->InternalizeUtf8String(property);
ASSERT(!property_string.is_null());
Handle<JSFunction> function = Handle<JSFunction>::cast(
- Object::GetProperty(global, property_string));
+ Object::GetProperty(global, property_string).ToHandleChecked());
return Handle<JSObject>(JSObject::cast(function->prototype()));
}
BuiltinFunctionId id) {
Factory* factory = holder->GetIsolate()->factory();
Handle<String> name = factory->InternalizeUtf8String(function_name);
- Handle<Object> function_object = Object::GetProperty(holder, name);
- ASSERT(!function_object.is_null());
+ Handle<Object> function_object =
+ Object::GetProperty(holder, name).ToHandleChecked();
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
function->shared()->set_function_data(Smi::FromInt(id));
}
Handle<String> name =
factory()->InternalizeUtf8String(Builtins::GetName(id));
Handle<Object> function_object =
- GlobalObject::GetPropertyNoExceptionThrown(builtins, name);
+ Object::GetProperty(builtins, name).ToHandleChecked();
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
builtins->set_javascript_builtin(id, *function);
if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) {
STATIC_ASCII_VECTOR("IsBreakPointTriggered"));
Handle<GlobalObject> debug_global(debug_context()->global_object());
Handle<JSFunction> check_break_point =
- Handle<JSFunction>::cast(GlobalObject::GetPropertyNoExceptionThrown(
- debug_global, is_break_point_triggered_string));
+ Handle<JSFunction>::cast(Object::GetProperty(
+ debug_global, is_break_point_triggered_string).ToHandleChecked());
// Get the break id as an object.
Handle<Object> break_id = factory->NewNumberFromInt(Debug::break_id());
// Clear the mirror cache.
Handle<String> function_name = isolate_->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("ClearMirrorCache"));
- Handle<Object> fun = GlobalObject::GetPropertyNoExceptionThrown(
- isolate_->global_object(), function_name);
+ Handle<Object> fun = Object::GetProperty(
+ isolate_->global_object(), function_name).ToHandleChecked();
ASSERT(fun->IsJSFunction());
Execution::TryCall(
Handle<JSFunction>::cast(fun),
Handle<String> constructor_str =
isolate_->factory()->InternalizeUtf8String(constructor_name);
ASSERT(!constructor_str.is_null());
- Handle<Object> constructor = GlobalObject::GetPropertyNoExceptionThrown(
- isolate_->global_object(), constructor_str);
+ Handle<Object> constructor = Object::GetProperty(
+ isolate_->global_object(), constructor_str).ToHandleChecked();
ASSERT(constructor->IsJSFunction());
if (!constructor->IsJSFunction()) return MaybeHandle<Object>();
return Execution::TryCall(
STATIC_ASCII_VECTOR("UpdateScriptBreakPoints"));
Handle<GlobalObject> debug_global(debug->debug_context()->global_object());
Handle<Object> update_script_break_points =
- GlobalObject::GetPropertyNoExceptionThrown(
- debug_global, update_script_break_points_string);
+ Object::GetProperty(
+ debug_global, update_script_break_points_string).ToHandleChecked();
if (!update_script_break_points->IsJSFunction()) {
return;
}
}
Handle<Object> char_at = Object::GetProperty(
- isolate->js_builtins_object(), factory->char_at_string());
+ isolate->js_builtins_object(),
+ factory->char_at_string()).ToHandleChecked();
if (!char_at->IsJSFunction()) {
return factory->undefined_value();
}
int serial_number = Smi::cast(data->serial_number())->value();
Handle<JSObject> cache(isolate->native_context()->function_cache());
Handle<Object> elm =
- Object::GetElementNoExceptionThrown(isolate, cache, serial_number);
+ Object::GetElement(isolate, cache, serial_number).ToHandleChecked();
if (elm->IsJSFunction()) return Handle<JSFunction>::cast(elm);
}
// The function has not yet been instantiated in this context; do it.
space--;
if (space > 0) {
Handle<String> arg_str = Handle<String>::cast(
- Object::GetElementNoExceptionThrown(isolate(), args, i));
+ Object::GetElement(isolate(), args, i).ToHandleChecked());
SmartArrayPointer<char> arg = arg_str->ToCString();
Vector<char> v2(p, static_cast<int>(space));
OS::StrNCpy(v2, arg.get(), space);
const char* message,
Handle<JSArray> args) {
Handle<String> make_str = InternalizeUtf8String(maker);
- Handle<Object> fun_obj = GlobalObject::GetPropertyNoExceptionThrown(
- isolate()->js_builtins_object(), make_str);
+ Handle<Object> fun_obj = Object::GetProperty(
+ isolate()->js_builtins_object(), make_str).ToHandleChecked();
// If the builtins haven't been properly configured yet this error
// constructor may not have been defined. Bail out.
if (!fun_obj->IsJSFunction()) {
Handle<Object> Factory::NewError(const char* constructor,
Handle<String> message) {
Handle<String> constr = InternalizeUtf8String(constructor);
- Handle<JSFunction> fun = Handle<JSFunction>::cast(
- GlobalObject::GetPropertyNoExceptionThrown(
- isolate()->js_builtins_object(), constr));
+ Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty(
+ isolate()->js_builtins_object(), constr).ToHandleChecked());
Handle<Object> argv[] = { message };
// Invoke the JavaScript factory method. If an exception is thrown while
isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("nameOrSourceURL"));
Handle<JSValue> script_wrapper = GetScriptWrapper(script);
- Handle<Object> property =
- Object::GetProperty(script_wrapper, name_or_source_url_key);
+ Handle<Object> property = Object::GetProperty(
+ script_wrapper, name_or_source_url_key).ToHandleChecked();
ASSERT(property->IsJSFunction());
Handle<JSFunction> method = Handle<JSFunction>::cast(property);
Handle<Object> result;
const char* key,
icu::UnicodeString* setting) {
Handle<String> str = isolate->factory()->NewStringFromAscii(CStrVector(key));
- Handle<Object> object = Object::GetProperty(options, str);
+ Handle<Object> object = Object::GetProperty(options, str).ToHandleChecked();
if (object->IsString()) {
v8::String::Utf8Value utf8_string(
v8::Utils::ToLocal(Handle<String>::cast(object)));
const char* key,
int32_t* value) {
Handle<String> str = isolate->factory()->NewStringFromAscii(CStrVector(key));
- Handle<Object> object = Object::GetProperty(options, str);
+ Handle<Object> object = Object::GetProperty(options, str).ToHandleChecked();
if (object->IsNumber()) {
object->ToInt32(value);
return true;
const char* key,
bool* value) {
Handle<String> str = isolate->factory()->NewStringFromAscii(CStrVector(key));
- Handle<Object> object = Object::GetProperty(options, str);
+ Handle<Object> object = Object::GetProperty(options, str).ToHandleChecked();
if (object->IsBoolean()) {
*value = object->BooleanValue();
return true;
// constructor. Instead, we copy the pre-constructed boilerplate and
// attach the stack trace as a hidden property.
Handle<String> key = factory()->stack_overflow_string();
- Handle<JSObject> boilerplate =
- Handle<JSObject>::cast(Object::GetProperty(js_builtins_object(), key));
+ Handle<JSObject> boilerplate = Handle<JSObject>::cast(
+ Object::GetProperty(js_builtins_object(), key).ToHandleChecked());
Handle<JSObject> exception = JSObject::Copy(boilerplate);
DoThrow(*exception, NULL);
Handle<String> error_key =
factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("$Error"));
- Handle<Object> error_constructor = GlobalObject::GetPropertyNoExceptionThrown(
- js_builtins_object(), error_key);
+ Handle<Object> error_constructor = Object::GetProperty(
+ js_builtins_object(), error_key).ToHandleChecked();
DisallowHeapAllocation no_gc;
for (Object* prototype = *obj; !prototype->IsNull();
HandleScope scope(isolate());
FunctionInfoWrapper info =
FunctionInfoWrapper::cast(
- *Object::GetElementNoExceptionThrown(
- isolate(), result_, current_parent_index_));
+ *Object::GetElement(
+ isolate(), result_, current_parent_index_).ToHandleChecked());
current_parent_index_ = info.GetParentIndex();
}
void FunctionCode(Handle<Code> function_code) {
FunctionInfoWrapper info =
FunctionInfoWrapper::cast(
- *Object::GetElementNoExceptionThrown(
- isolate(), result_, current_parent_index_));
+ *Object::GetElement(
+ isolate(), result_, current_parent_index_).ToHandleChecked());
info.SetFunctionCode(function_code,
Handle<HeapObject>(isolate()->heap()->null_value()));
}
}
FunctionInfoWrapper info =
FunctionInfoWrapper::cast(
- *Object::GetElementNoExceptionThrown(
- isolate(), result_, current_parent_index_));
+ *Object::GetElement(
+ isolate(), result_, current_parent_index_).ToHandleChecked());
info.SetFunctionCode(Handle<Code>(shared->code()),
Handle<HeapObject>(shared->scope_info()));
info.SetSharedFunctionInfo(shared);
for (int i = 0; i < len; i++) {
Handle<SharedFunctionInfo> info(
SharedFunctionInfo::cast(
- *Object::GetElementNoExceptionThrown(isolate, array, i)));
+ *Object::GetElement(isolate, array, i).ToHandleChecked()));
SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create(isolate);
Handle<String> name_handle(String::cast(info->name()));
info_wrapper.SetProperties(name_handle, info->start_position(),
// TODO(635): binary search may be used here
for (int i = 0; i < array_len; i += 3) {
HandleScope scope(isolate);
- Handle<Object> element = Object::GetElementNoExceptionThrown(
- isolate, position_change_array, i);
+ Handle<Object> element = Object::GetElement(
+ isolate, position_change_array, i).ToHandleChecked();
CHECK(element->IsSmi());
int chunk_start = Handle<Smi>::cast(element)->value();
if (original_position < chunk_start) {
break;
}
- element = Object::GetElementNoExceptionThrown(
- isolate, position_change_array, i + 1);
+ element = Object::GetElement(
+ isolate, position_change_array, i + 1).ToHandleChecked();
CHECK(element->IsSmi());
int chunk_end = Handle<Smi>::cast(element)->value();
// Position mustn't be inside a chunk.
ASSERT(original_position >= chunk_end);
- element = Object::GetElementNoExceptionThrown(
- isolate, position_change_array, i + 2);
+ element = Object::GetElement(
+ isolate, position_change_array, i + 2).ToHandleChecked();
CHECK(element->IsSmi());
int chunk_changed_end = Handle<Smi>::cast(element)->value();
position_diff = chunk_changed_end - chunk_end;
for (int i = 0; i < len; i++) {
HandleScope scope(isolate);
Handle<Object> element =
- Object::GetElementNoExceptionThrown(isolate, shared_info_array, i);
+ Object::GetElement(isolate, shared_info_array, i).ToHandleChecked();
Handle<JSValue> jsvalue = Handle<JSValue>::cast(element);
Handle<SharedFunctionInfo> shared =
UnwrapSharedFunctionInfoFromJSValue(jsvalue);
// Replace "blocked on active" with "replaced on active" status.
for (int i = 0; i < array_len; i++) {
Handle<Object> obj =
- Object::GetElementNoExceptionThrown(isolate, result, i);
+ Object::GetElement(isolate, result, i).ToHandleChecked();
if (*obj == Smi::FromInt(LiveEdit::FUNCTION_BLOCKED_ON_ACTIVE_STACK)) {
Handle<Object> replaced(
Smi::FromInt(LiveEdit::FUNCTION_REPLACED_ON_ACTIVE_STACK), isolate);
}
Handle<Object> GetField(int field_position) {
- return Object::GetElementNoExceptionThrown(
- isolate(), array_, field_position);
+ return Object::GetElement(
+ isolate(), array_, field_position).ToHandleChecked();
}
int GetSmiValueField(int field_position) {
public:
static bool IsInstance(Handle<JSArray> array) {
return array->length() == Smi::FromInt(kSize_) &&
- Object::GetElementNoExceptionThrown(
- array->GetIsolate(), array, kSharedInfoOffset_)->IsJSValue();
+ Object::GetElement(array->GetIsolate(), array, kSharedInfoOffset_)
+ .ToHandleChecked()->IsJSValue();
}
explicit SharedInfoWrapper(Handle<JSArray> array)
i++;
ASSERT('0' <= format[i] && format[i] <= '9');
// No exception expected when getting an element from an array literal.
- Handle<Object> obj =
- Object::GetElementNoExceptionThrown(isolate_, args, format[i] - '0');
+ Handle<Object> obj = Object::GetElement(
+ isolate_, args, format[i] - '0').ToHandleChecked();
i++;
switch (format[i]) {
case 's':
Factory* factory = isolate->factory();
Handle<String> fmt_str =
factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("FormatMessage"));
- Handle<JSFunction> fun = Handle<JSFunction>::cast(
- GlobalObject::GetPropertyNoExceptionThrown(
- isolate->js_builtins_object(), fmt_str));
+ Handle<JSFunction> fun = Handle<JSFunction>::cast(Object::GetProperty(
+ isolate->js_builtins_object(), fmt_str).ToHandleChecked());
Handle<JSMessageObject> message = Handle<JSMessageObject>::cast(data);
Handle<Object> argv[] = { Handle<Object>(message->type(), isolate),
Handle<Object>(message->arguments(), isolate) };
}
+MaybeHandle<Object> Object::GetProperty(Handle<Object> object,
+ Handle<Name> name) {
+ PropertyAttributes attributes;
+ return GetPropertyWithReceiver(object, object, name, &attributes);
+}
+
+
MaybeHandle<Object> Object::GetElement(Isolate* isolate,
Handle<Object> object,
uint32_t index) {
}
-Handle<Object> Object::GetElementNoExceptionThrown(Isolate* isolate,
- Handle<Object> object,
+MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object,
+ Handle<Name> name) {
+ uint32_t index;
+ Isolate* isolate = name->GetIsolate();
+ if (name->AsArrayIndex(&index)) return GetElement(isolate, object, index);
+ return GetProperty(object, name);
+}
+
+
+MaybeHandle<Object> JSProxy::GetElementWithHandler(Handle<JSProxy> proxy,
+ Handle<Object> receiver,
uint32_t index) {
- Handle<Object> result =
- Object::GetElementWithReceiver(
- isolate, object, object, index).ToHandleChecked();
- return result;
+ return GetPropertyWithHandler(
+ proxy, receiver, proxy->GetIsolate()->factory()->Uint32ToString(index));
}
-MaybeObject* Object::GetProperty(Name* key) {
- PropertyAttributes attributes;
- return GetPropertyWithReceiver(this, key, &attributes);
+MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy,
+ Handle<JSReceiver> receiver,
+ uint32_t index,
+ Handle<Object> value,
+ StrictMode strict_mode) {
+ Isolate* isolate = proxy->GetIsolate();
+ Handle<String> name = isolate->factory()->Uint32ToString(index);
+ return SetPropertyWithHandler(
+ proxy, receiver, name, value, NONE, strict_mode);
+}
+
+
+bool JSProxy::HasElementWithHandler(Handle<JSProxy> proxy, uint32_t index) {
+ Isolate* isolate = proxy->GetIsolate();
+ Handle<String> name = isolate->factory()->Uint32ToString(index);
+ return HasPropertyWithHandler(proxy, name);
}
}
-Handle<Object> GlobalObject::GetPropertyNoExceptionThrown(
- Handle<GlobalObject> global,
- Handle<Name> name) {
- Handle<Object> result = Object::GetProperty(global, name);
- CHECK_NOT_EMPTY_HANDLE(name->GetIsolate(), result);
- return result;
-}
-
-
bool Name::Equals(Name* other) {
if (other == this) return true;
if ((this->IsInternalizedString() && other->IsInternalizedString()) ||
}
-MaybeObject* Object::GetPropertyWithReceiver(Object* receiver,
- Name* name,
- PropertyAttributes* attributes) {
- LookupResult result(name->GetIsolate());
- Lookup(name, &result);
- MaybeObject* value = GetProperty(receiver, &result, name, attributes);
- ASSERT(*attributes <= ABSENT);
- return value;
-}
-
-
bool Object::ToInt32(int32_t* value) {
if (IsSmi()) {
*value = Smi::cast(this)->value();
}
-MaybeObject* JSProxy::GetPropertyWithHandler(Object* receiver_raw,
- Name* name_raw) {
- Isolate* isolate = GetIsolate();
- HandleScope scope(isolate);
- Handle<Object> receiver(receiver_raw, isolate);
- Handle<Object> name(name_raw, isolate);
+MaybeHandle<Object> JSProxy::GetPropertyWithHandler(Handle<JSProxy> proxy,
+ Handle<Object> receiver,
+ Handle<Name> name) {
+ Isolate* isolate = proxy->GetIsolate();
// TODO(rossberg): adjust once there is a story for symbols vs proxies.
- if (name->IsSymbol()) return isolate->heap()->undefined_value();
+ if (name->IsSymbol()) return isolate->factory()->undefined_value();
Handle<Object> args[] = { receiver, name };
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- CallTrap(handle(this),
- "get",
- isolate->derived_get_trap(),
- ARRAY_SIZE(args),
- args));
- return *result;
-}
-
-
-MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object,
- Handle<Name> name) {
- uint32_t index;
- Isolate* isolate = name->GetIsolate();
- if (name->AsArrayIndex(&index)) return GetElement(isolate, object, index);
- return GetProperty(object, name);
-}
-
-
-Handle<Object> Object::GetProperty(Handle<Object> object,
- Handle<Name> name) {
- CALL_HEAP_FUNCTION(name->GetIsolate(), object->GetProperty(*name), Object);
-}
-
-
-MaybeObject* JSProxy::GetElementWithHandler(Object* receiver,
- uint32_t index) {
- String* name;
- MaybeObject* maybe = GetHeap()->Uint32ToString(index);
- if (!maybe->To<String>(&name)) return maybe;
- return GetPropertyWithHandler(receiver, name);
-}
-
-
-MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy,
- Handle<JSReceiver> receiver,
- uint32_t index,
- Handle<Object> value,
- StrictMode strict_mode) {
- Isolate* isolate = proxy->GetIsolate();
- Handle<String> name = isolate->factory()->Uint32ToString(index);
- return SetPropertyWithHandler(
- proxy, receiver, name, value, NONE, strict_mode);
-}
-
-
-bool JSProxy::HasElementWithHandler(Handle<JSProxy> proxy, uint32_t index) {
- Isolate* isolate = proxy->GetIsolate();
- Handle<String> name = isolate->factory()->Uint32ToString(index);
- return HasPropertyWithHandler(proxy, name);
+ return CallTrap(
+ proxy, "get", isolate->derived_get_trap(), ARRAY_SIZE(args), args);
}
MaybeHandle<Object> Object::GetProperty(Handle<Object> object,
Handle<Object> receiver,
LookupResult* result,
- Handle<Name> key,
+ Handle<Name> name,
PropertyAttributes* attributes) {
- Isolate* isolate = result->isolate();
- CALL_HEAP_FUNCTION(
- isolate,
- object->GetProperty(*receiver, result, *key, attributes),
- Object);
-}
-
-
-// TODO(yangguo): handlify this and get rid of.
-MaybeObject* Object::GetProperty(Object* receiver,
- LookupResult* result,
- Name* name,
- PropertyAttributes* attributes) {
Isolate* isolate = name->GetIsolate();
- Heap* heap = isolate->heap();
-
-#ifdef DEBUG
- // TODO(mstarzinger): Only because of the AssertNoContextChange, drop as soon
- // as this method has been fully handlified.
- HandleScope scope(isolate);
-#endif
+ Factory* factory = isolate->factory();
// Make sure that the top context does not change when doing
// callbacks or interceptor calls.
// holder in the prototype chain.
// Proxy handlers do not use the proxy's prototype, so we can skip this.
if (!result->IsHandler()) {
- Object* last = result->IsProperty()
- ? result->holder()
- : Object::cast(heap->null_value());
- ASSERT(this != this->GetPrototype(isolate));
- for (Object* current = this;
+ ASSERT(*object != object->GetPrototype(isolate));
+ Handle<Object> last = result->IsProperty()
+ ? Handle<Object>(result->holder(), isolate)
+ : Handle<Object>::cast(factory->null_value());
+ for (Handle<Object> current = object;
true;
- current = current->GetPrototype(isolate)) {
+ current = Handle<Object>(current->GetPrototype(isolate), isolate)) {
if (current->IsAccessCheckNeeded()) {
// Check if we're allowed to read from the current object. Note
// that even though we may not actually end up loading the named
// property from the current object, we still check that we have
// access to it.
- JSObject* checked = JSObject::cast(current);
- if (!isolate->MayNamedAccess(checked, name, v8::ACCESS_GET)) {
- HandleScope scope(isolate);
- Handle<Object> value;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, value,
- JSObject::GetPropertyWithFailedAccessCheck(
- handle(checked, isolate),
- handle(receiver, isolate),
- result,
- handle(name, isolate),
- attributes));
- return *value;
+ Handle<JSObject> checked = Handle<JSObject>::cast(current);
+ if (!isolate->MayNamedAccessWrapper(checked, name, v8::ACCESS_GET)) {
+ return JSObject::GetPropertyWithFailedAccessCheck(
+ checked, receiver, result, name, attributes);
}
}
// Stop traversing the chain once we reach the last object in the
// chain; either the holder of the result or null in case of an
// absent property.
- if (current == last) break;
+ if (current.is_identical_to(last)) break;
}
}
if (!result->IsProperty()) {
*attributes = ABSENT;
- return heap->undefined_value();
+ return factory->undefined_value();
}
*attributes = result->GetAttributes();
- Object* value;
+
+ Handle<Object> value;
+ Handle<JSObject> holder(result->holder(), isolate);
switch (result->type()) {
- case NORMAL:
- value = result->holder()->GetNormalizedProperty(result);
- ASSERT(!value->IsTheHole() || result->IsReadOnly());
- return value->IsTheHole() ? heap->undefined_value() : value;
- case FIELD: {
- MaybeObject* maybe_result = result->holder()->FastPropertyAt(
- result->representation(),
- result->GetFieldIndex().field_index());
- if (!maybe_result->To(&value)) return maybe_result;
- ASSERT(!value->IsTheHole() || result->IsReadOnly());
- return value->IsTheHole() ? heap->undefined_value() : value;
+ case NORMAL: {
+ DisallowHeapAllocation no_gc;
+ value = handle(holder->GetNormalizedProperty(result), isolate);
+ break;
}
+ case FIELD:
+ value = JSObject::FastPropertyAt(holder,
+ result->representation(),
+ result->GetFieldIndex().field_index());
+ break;
case CONSTANT:
- return result->GetConstant();
- case CALLBACKS: {
- HandleScope scope(isolate);
- Handle<Object> value;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, value,
- JSObject::GetPropertyWithCallback(
- handle(result->holder(), isolate),
- handle(receiver, isolate),
- handle(result->GetCallbackObject(), isolate),
- handle(name, isolate)));
- return *value;
- }
+ return handle(result->GetConstant(), isolate);
+ case CALLBACKS:
+ return JSObject::GetPropertyWithCallback(
+ holder, receiver, handle(result->GetCallbackObject(), isolate), name);
case HANDLER:
- return result->proxy()->GetPropertyWithHandler(receiver, name);
- case INTERCEPTOR: {
- HandleScope scope(isolate);
- Handle<Object> value;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, value,
- JSObject::GetPropertyWithInterceptor(
- handle(result->holder(), isolate),
- handle(receiver, isolate),
- handle(name, isolate),
- attributes));
- return *value;
- }
+ return JSProxy::GetPropertyWithHandler(
+ handle(result->proxy(), isolate), receiver, name);
+ case INTERCEPTOR:
+ return JSObject::GetPropertyWithInterceptor(
+ holder, receiver, name, attributes);
case NONEXISTENT:
UNREACHABLE();
break;
}
- UNREACHABLE();
- return NULL;
+ ASSERT(!value->IsTheHole() || result->IsReadOnly());
+ return value->IsTheHole() ? Handle<Object>::cast(factory->undefined_value())
+ : value;
}
holder = Handle<Object>(
native_context->boolean_function()->instance_prototype(), isolate);
} else if (holder->IsJSProxy()) {
- CALL_HEAP_FUNCTION(isolate,
- Handle<JSProxy>::cast(holder)->GetElementWithHandler(
- *receiver, index),
- Object);
+ return JSProxy::GetElementWithHandler(
+ Handle<JSProxy>::cast(holder), receiver, index);
} else {
// Undefined and null have no indexed properties.
ASSERT(holder->IsUndefined() || holder->IsNull());
Handle<String> configurable_name =
isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("configurable_"));
- Handle<Object> configurable = Object::GetProperty(desc, configurable_name);
- ASSERT(!configurable.is_null());
- ASSERT(configurable->IsTrue() || configurable->IsFalse());
+ Handle<Object> configurable =
+ Object::GetProperty(desc, configurable_name).ToHandleChecked();
+ ASSERT(configurable->IsBoolean());
if (configurable->IsFalse()) {
Handle<String> trap =
isolate->factory()->InternalizeOneByteString(
Handle<String> hasWritable_name =
isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("hasWritable_"));
- Handle<Object> hasWritable = Object::GetProperty(desc, hasWritable_name);
- ASSERT(!hasWritable.is_null());
- ASSERT(hasWritable->IsTrue() || hasWritable->IsFalse());
+ Handle<Object> hasWritable =
+ Object::GetProperty(desc, hasWritable_name).ToHandleChecked();
+ ASSERT(hasWritable->IsBoolean());
if (hasWritable->IsTrue()) {
Handle<String> writable_name =
isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("writable_"));
- Handle<Object> writable = Object::GetProperty(desc, writable_name);
- ASSERT(!writable.is_null());
- ASSERT(writable->IsTrue() || writable->IsFalse());
+ Handle<Object> writable =
+ Object::GetProperty(desc, writable_name).ToHandleChecked();
+ ASSERT(writable->IsBoolean());
*done = writable->IsFalse();
if (!*done) return isolate->factory()->the_hole_value();
if (strict_mode == SLOPPY) return value;
// We have an AccessorDescriptor.
Handle<String> set_name = isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("set_"));
- Handle<Object> setter = Object::GetProperty(desc, set_name);
- ASSERT(!setter.is_null());
+ Handle<Object> setter = Object::GetProperty(desc, set_name).ToHandleChecked();
if (!setter->IsUndefined()) {
// TODO(rossberg): nicer would be to cast to some JSCallable here...
return SetPropertyWithDefinedSetter(
// Convert result to PropertyAttributes.
Handle<String> enum_n = isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("enumerable_"));
- Handle<Object> enumerable = Object::GetProperty(desc, enum_n);
- RETURN_IF_EMPTY_HANDLE_VALUE(isolate, enumerable, NONE);
+ Handle<Object> enumerable;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, enumerable, Object::GetProperty(desc, enum_n), NONE);
Handle<String> conf_n = isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("configurable_"));
- Handle<Object> configurable = Object::GetProperty(desc, conf_n);
- RETURN_IF_EMPTY_HANDLE_VALUE(isolate, configurable, NONE);
+ Handle<Object> configurable;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, configurable, Object::GetProperty(desc, conf_n), NONE);
Handle<String> writ_n = isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("writable_"));
- Handle<Object> writable = Object::GetProperty(desc, writ_n);
- RETURN_IF_EMPTY_HANDLE_VALUE(isolate, writable, NONE);
+ Handle<Object> writable;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, writable, Object::GetProperty(desc, writ_n), NONE);
if (!writable->BooleanValue()) {
Handle<String> set_n = isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("set_"));
- Handle<Object> setter = Object::GetProperty(desc, set_n);
- RETURN_IF_EMPTY_HANDLE_VALUE(isolate, setter, NONE);
+ Handle<Object> setter;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, setter, Object::GetProperty(desc, set_n), NONE);
writable = isolate->factory()->ToBoolean(!setter->IsUndefined());
}
if (!GetLocalElementAccessorPair(object, index).is_null()) {
old_value = Handle<Object>::cast(factory->the_hole_value());
} else {
- old_value = Object::GetElementNoExceptionThrown(isolate, object, index);
+ old_value = Object::GetElement(
+ isolate, object, index).ToHandleChecked();
}
}
}
// In particular, don't try to copy the length attribute of
// an array.
if (attributes != NONE) continue;
- Handle<Object> value = Object::GetProperty(copy, key_string);
- CHECK_NOT_EMPTY_HANDLE(isolate, value);
+ Handle<Object> value =
+ Object::GetProperty(copy, key_string).ToHandleChecked();
if (value->IsJSObject()) {
Handle<JSObject> result = VisitElementOrProperty(
copy, Handle<JSObject>::cast(value));
if (is_element) {
preexists = HasLocalElement(object, index);
if (preexists && GetLocalElementAccessorPair(object, index).is_null()) {
- old_value = Object::GetElementNoExceptionThrown(isolate, object, index);
+ old_value =
+ Object::GetElement(isolate, object, index).ToHandleChecked();
}
} else {
LookupResult lookup(isolate);
if (!JSObject::GetLocalElementAccessorPair(object, index).is_null()) {
value = Handle<Object>::cast(isolate->factory()->the_hole_value());
} else {
- value = Object::GetElementNoExceptionThrown(isolate, object, index);
+ value = Object::GetElement(isolate, object, index).ToHandleChecked();
}
old_values->Add(value);
indices->Add(index);
if (old_attributes != ABSENT) {
if (GetLocalElementAccessorPair(object, index).is_null()) {
- old_value = Object::GetElementNoExceptionThrown(isolate, object, index);
+ old_value = Object::GetElement(isolate, object, index).ToHandleChecked();
}
} else if (object->IsJSArray()) {
// Store old array length in case adding an element grows the array.
EnqueueChangeRecord(object, "reconfigure", name, old_value);
} else {
Handle<Object> new_value =
- Object::GetElementNoExceptionThrown(isolate, object, index);
+ Object::GetElement(isolate, object, index).ToHandleChecked();
bool value_changed = !old_value->SameValue(*new_value);
if (old_attributes != new_attributes) {
if (!value_changed) old_value = isolate->factory()->the_hole_value();
void Lookup(Name* name, LookupResult* result);
- // Property access.
- MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key);
-
- // TODO(yangguo): this should eventually replace the non-handlified version.
MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithReceiver(
Handle<Object> object,
Handle<Object> receiver,
Handle<Name> name,
PropertyAttributes* attributes);
- MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver(
- Object* receiver,
- Name* key,
- PropertyAttributes* attributes);
-
- MUST_USE_RESULT static MaybeHandle<Object> GetPropertyOrElement(
+ MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement(
Handle<Object> object,
Handle<Name> key);
- static Handle<Object> GetProperty(Handle<Object> object,
- Handle<Name> key);
+ MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty(
+ Handle<Object> object,
+ Handle<Name> key);
MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
Handle<Object> object,
Handle<Object> receiver,
Handle<Name> key,
PropertyAttributes* attributes);
- MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver,
- LookupResult* result,
- Name* key,
- PropertyAttributes* attributes);
-
MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithDefinedGetter(
Handle<Object> object,
Handle<Object> receiver,
Handle<Object> object,
uint32_t index);
- // For use when we know that no exception can be thrown.
- static inline Handle<Object> GetElementNoExceptionThrown(
- Isolate* isolate,
- Handle<Object> object,
- uint32_t index);
-
MUST_USE_RESULT static MaybeHandle<Object> GetElementWithReceiver(
Isolate* isolate,
Handle<Object> object,
// Retrieve the property cell used to store a property.
PropertyCell* GetPropertyCell(LookupResult* result);
- // This is like GetProperty, but is used when you know the lookup won't fail
- // by throwing an exception. This is for the debug and builtins global
- // objects, where it is known which properties can be expected to be present
- // on the object.
- static inline Handle<Object> GetPropertyNoExceptionThrown(
- Handle<GlobalObject> global,
- Handle<Name> name);
-
// Casting.
static inline GlobalObject* cast(Object* obj);
// Casting.
static inline JSProxy* cast(Object* obj);
- MUST_USE_RESULT MaybeObject* GetPropertyWithHandler(
- Object* receiver,
- Name* name);
- MUST_USE_RESULT MaybeObject* GetElementWithHandler(
- Object* receiver,
+ MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler(
+ Handle<JSProxy> proxy,
+ Handle<Object> receiver,
+ Handle<Name> name);
+ MUST_USE_RESULT static inline MaybeHandle<Object> GetElementWithHandler(
+ Handle<JSProxy> proxy,
+ Handle<Object> receiver,
uint32_t index);
// If the handler defines an accessor property with a setter, invoke it.
Handle<Object> value,
PropertyAttributes attributes,
StrictMode strict_mode);
- MUST_USE_RESULT static MaybeHandle<Object> SetElementWithHandler(
+ MUST_USE_RESULT static inline MaybeHandle<Object> SetElementWithHandler(
Handle<JSProxy> proxy,
Handle<JSReceiver> receiver,
uint32_t index,
StrictMode strict_mode);
static bool HasPropertyWithHandler(Handle<JSProxy> proxy, Handle<Name> name);
- static bool HasElementWithHandler(Handle<JSProxy> proxy, uint32_t index);
+ static inline bool HasElementWithHandler(Handle<JSProxy> proxy,
+ uint32_t index);
MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyWithHandler(
Handle<JSProxy> proxy,
HandleScope scope(isolate);
if (args[0]->IsSymbol()) {
// Lookup in the initial Object.prototype object.
- Handle<Object> result = Object::GetProperty(
- isolate->initial_object_prototype(), args.at<Symbol>(0));
- RETURN_IF_EMPTY_HANDLE(isolate, result);
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ Object::GetProperty(
+ isolate->initial_object_prototype(), args.at<Symbol>(0)));
return *result;
}
}
// Lookup in the initial Object.prototype object.
- Handle<Object> result = Object::GetProperty(
- isolate->initial_object_prototype(), key);
- RETURN_IF_EMPTY_HANDLE(isolate, result);
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ Object::GetProperty(isolate->initial_object_prototype(), key));
return *result;
}
// No need to unhole the value here. This is taken care of by the
// GetProperty function.
- Handle<Object> value = Object::GetProperty(object, name);
- RETURN_IF_EMPTY_HANDLE_VALUE(
- isolate, value, MakePair(Failure::Exception(), NULL));
+ Handle<Object> value;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, value,
+ Object::GetProperty(object, name),
+ MakePair(Failure::Exception(), NULL));
return MakePair(*value, *receiver_handle);
}
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
i::Handle<i::JSObject> cache(i_isolate->native_context()->function_cache());
i::Handle<i::Object> elm =
- i::Object::GetElementNoExceptionThrown(i_isolate, cache, serial_number);
+ i::Object::GetElement(i_isolate, cache, serial_number).ToHandleChecked();
CHECK(elm->IsUndefined());
// Verify that each Function::New creates a new function instance
Local<Object> data2 = v8::Object::New(isolate);
Isolate* isolate = CcTest::i_isolate();
Handle<String> internalized_name =
isolate->factory()->InternalizeUtf8String(name);
- return GlobalObject::GetPropertyNoExceptionThrown(
- isolate->global_object(), internalized_name);
+ return Object::GetProperty(
+ isolate->global_object(), internalized_name).ToHandleChecked();
}
Handle<String> foo_string = isolate->factory()->InternalizeOneByteString(
STATIC_ASCII_VECTOR("foo"));
Handle<Object> fun1 = Object::GetProperty(
- isolate->global_object(), foo_string);
+ isolate->global_object(), foo_string).ToHandleChecked();
CHECK(fun1->IsJSFunction());
Handle<Object> argv[] = { isolate->factory()->InternalizeOneByteString(
JSReceiver::SetProperty(
obj, prop_namex, twenty_four, NONE, SLOPPY).Check();
- CHECK_EQ(Smi::FromInt(23), *Object::GetProperty(obj, prop_name));
- CHECK_EQ(Smi::FromInt(24), *Object::GetProperty(obj, prop_namex));
+ CHECK_EQ(Smi::FromInt(23),
+ *Object::GetProperty(obj, prop_name).ToHandleChecked());
+ CHECK_EQ(Smi::FromInt(24),
+ *Object::GetProperty(obj, prop_namex).ToHandleChecked());
}
heap->CollectGarbage(NEW_SPACE);
// Function should be alive.
CHECK(JSReceiver::HasLocalProperty(global, name));
// Check function is retained.
- Handle<Object> func_value = Object::GetProperty(global, name);
+ Handle<Object> func_value =
+ Object::GetProperty(global, name).ToHandleChecked();
CHECK(func_value->IsJSFunction());
Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
heap->CollectGarbage(NEW_SPACE);
CHECK(JSReceiver::HasLocalProperty(global, obj_name));
- Handle<Object> obj = Object::GetProperty(global, obj_name);
+ Handle<Object> obj =
+ Object::GetProperty(global, obj_name).ToHandleChecked();
CHECK(obj->IsJSObject());
- CHECK_EQ(Smi::FromInt(23), *Object::GetProperty(obj, prop_name));
+ CHECK_EQ(Smi::FromInt(23),
+ *Object::GetProperty(obj, prop_name).ToHandleChecked());
}
Handle<String> prop_name = factory->InternalizeUtf8String("theSlot");
Handle<JSObject> obj = factory->NewJSObject(function);
JSReceiver::SetProperty(obj, prop_name, twenty_three, NONE, SLOPPY).Check();
- CHECK_EQ(Smi::FromInt(23), *Object::GetProperty(obj, prop_name));
+ CHECK_EQ(Smi::FromInt(23),
+ *Object::GetProperty(obj, prop_name).ToHandleChecked());
// Check that we can add properties to function objects.
JSReceiver::SetProperty(
function, prop_name, twenty_four, NONE, SLOPPY).Check();
- CHECK_EQ(Smi::FromInt(24), *Object::GetProperty(function, prop_name));
+ CHECK_EQ(Smi::FromInt(24),
+ *Object::GetProperty(function, prop_name).ToHandleChecked());
}
v8::HandleScope sc(CcTest::isolate());
Handle<String> object_string(String::cast(CcTest::heap()->Object_string()));
- Handle<Object> object =
- Object::GetProperty(CcTest::i_isolate()->global_object(), object_string);
+ Handle<Object> object = Object::GetProperty(
+ CcTest::i_isolate()->global_object(), object_string).ToHandleChecked();
Handle<JSFunction> constructor = Handle<JSFunction>::cast(object);
Handle<JSObject> obj = factory->NewJSObject(constructor);
Handle<String> first = factory->InternalizeUtf8String("first");
// Set a propery
Handle<Smi> twenty_three(Smi::FromInt(23), isolate);
JSReceiver::SetProperty(obj, prop_name, twenty_three, NONE, SLOPPY).Check();
- CHECK_EQ(Smi::FromInt(23), *Object::GetProperty(obj, prop_name));
+ CHECK_EQ(Smi::FromInt(23),
+ *Object::GetProperty(obj, prop_name).ToHandleChecked());
// Check the map has changed
CHECK(*initial_map != obj->map());
v8::HandleScope sc(CcTest::isolate());
Handle<String> name = factory->InternalizeUtf8String("Array");
- Handle<Object> fun_obj =
- Object::GetProperty(CcTest::i_isolate()->global_object(), name);
+ Handle<Object> fun_obj = Object::GetProperty(
+ CcTest::i_isolate()->global_object(), name).ToHandleChecked();
Handle<JSFunction> function = Handle<JSFunction>::cast(fun_obj);
// Allocate the object.
v8::HandleScope sc(CcTest::isolate());
Handle<String> object_string(String::cast(CcTest::heap()->Object_string()));
- Handle<Object> object =
- Object::GetProperty(CcTest::i_isolate()->global_object(), object_string);
+ Handle<Object> object = Object::GetProperty(
+ CcTest::i_isolate()->global_object(), object_string).ToHandleChecked();
Handle<JSFunction> constructor = Handle<JSFunction>::cast(object);
Handle<JSObject> obj = factory->NewJSObject(constructor);
Handle<String> first = factory->InternalizeUtf8String("first");
CHECK_EQ(*i::Object::GetElement(isolate, obj, 1).ToHandleChecked(),
*i::Object::GetElement(isolate, clone, 1).ToHandleChecked());
- CHECK_EQ(*Object::GetProperty(obj, first),
- *Object::GetProperty(clone, first));
- CHECK_EQ(*Object::GetProperty(obj, second),
- *Object::GetProperty(clone, second));
+ CHECK_EQ(*Object::GetProperty(obj, first).ToHandleChecked(),
+ *Object::GetProperty(clone, first).ToHandleChecked());
+ CHECK_EQ(*Object::GetProperty(obj, second).ToHandleChecked(),
+ *Object::GetProperty(clone, second).ToHandleChecked());
// Flip the values.
JSReceiver::SetProperty(clone, first, two, NONE, SLOPPY).Check();
CHECK_EQ(*i::Object::GetElement(isolate, obj, 0).ToHandleChecked(),
*i::Object::GetElement(isolate, clone, 1).ToHandleChecked());
- CHECK_EQ(*Object::GetProperty(obj, second),
- *Object::GetProperty(clone, first));
- CHECK_EQ(*Object::GetProperty(obj, first),
- *Object::GetProperty(clone, second));
+ CHECK_EQ(*Object::GetProperty(obj, second).ToHandleChecked(),
+ *Object::GetProperty(clone, first).ToHandleChecked());
+ CHECK_EQ(*Object::GetProperty(obj, first).ToHandleChecked(),
+ *Object::GetProperty(clone, second).ToHandleChecked());
}
}
// Check function is compiled.
- Handle<Object> func_value =
- Object::GetProperty(CcTest::i_isolate()->global_object(), foo_name);
+ Handle<Object> func_value = Object::GetProperty(
+ CcTest::i_isolate()->global_object(), foo_name).ToHandleChecked();
CHECK(func_value->IsJSFunction());
Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
CHECK(function->shared()->is_compiled());
// Check function is compiled.
Handle<Object> func_value =
- Object::GetProperty(isolate->global_object(), foo_name);
+ Object::GetProperty(isolate->global_object(), foo_name).ToHandleChecked();
CHECK(func_value->IsJSFunction());
Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
CHECK(function->shared()->is_compiled());
// Check function is compiled.
Handle<Object> func_value =
- Object::GetProperty(isolate->global_object(), foo_name);
+ Object::GetProperty(isolate->global_object(), foo_name).ToHandleChecked();
CHECK(func_value->IsJSFunction());
Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
CHECK(function->shared()->is_compiled());
// Check functions are compiled.
Handle<Object> func_value =
- Object::GetProperty(isolate->global_object(), foo_name);
+ Object::GetProperty(isolate->global_object(), foo_name).ToHandleChecked();
CHECK(func_value->IsJSFunction());
Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
CHECK(function->shared()->is_compiled());
Handle<Object> func_value2 =
- Object::GetProperty(isolate->global_object(), bar_name);
+ Object::GetProperty(isolate->global_object(), bar_name).ToHandleChecked();
CHECK(func_value2->IsJSFunction());
Handle<JSFunction> function2 = Handle<JSFunction>::cast(func_value2);
CHECK(function2->shared()->is_compiled());
// Check function is compiled.
Handle<Object> func_value =
- Object::GetProperty(isolate->global_object(), foo_name);
+ Object::GetProperty(isolate->global_object(), foo_name).ToHandleChecked();
CHECK(func_value->IsJSFunction());
Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
CHECK(function->shared()->is_compiled());
{ HandleScope scope(isolate);
Handle<String> func_name = factory->InternalizeUtf8String("theFunction");
CHECK(JSReceiver::HasLocalProperty(global, func_name));
- Handle<Object> func_value = Object::GetProperty(global, func_name);
+ Handle<Object> func_value =
+ Object::GetProperty(global, func_name).ToHandleChecked();
CHECK(func_value->IsJSFunction());
Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
Handle<JSObject> obj = factory->NewJSObject(function);
{ HandleScope scope(isolate);
Handle<String> obj_name = factory->InternalizeUtf8String("theObject");
CHECK(JSReceiver::HasLocalProperty(global, obj_name));
- Handle<Object> object = Object::GetProperty(global, obj_name);
+ Handle<Object> object =
+ Object::GetProperty(global, obj_name).ToHandleChecked();
CHECK(object->IsJSObject());
Handle<String> prop_name = factory->InternalizeUtf8String("theSlot");
- CHECK_EQ(*Object::GetProperty(object, prop_name), Smi::FromInt(23));
+ CHECK_EQ(*Object::GetProperty(object, prop_name).ToHandleChecked(),
+ Smi::FromInt(23));
}
}