| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index a75dfc1e8413ba6ed079ecf7b51cfe187bcb811f..19150eec87b9daa6f180c68340b70c1b75418052 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -2118,6 +2118,21 @@ String* JSReceiver::constructor_name() {
|
| }
|
|
|
|
|
| +Context* JSReceiver::GetCreationContext() {
|
| + Object* constructor = map()->GetConstructor();
|
| + JSFunction* function;
|
| + if (!constructor->IsJSFunction()) {
|
| + // Functions have null as a constructor,
|
| + // but any JSFunction knows its context immediately.
|
| + function = JSFunction::cast(this);
|
| + } else {
|
| + function = JSFunction::cast(constructor);
|
| + }
|
| +
|
| + return function->context()->native_context();
|
| +}
|
| +
|
| +
|
| static Handle<Object> WrapType(Handle<HeapType> type) {
|
| if (type->IsClass()) return Map::WeakCellForMap(type->AsClass()->Map());
|
| return type;
|
| @@ -2222,21 +2237,6 @@ void JSObject::AddSlowProperty(Handle<JSObject> object,
|
| }
|
|
|
|
|
| -Context* JSObject::GetCreationContext() {
|
| - Object* constructor = this->map()->GetConstructor();
|
| - JSFunction* function;
|
| - if (!constructor->IsJSFunction()) {
|
| - // Functions have null as a constructor,
|
| - // but any JSFunction knows its context immediately.
|
| - function = JSFunction::cast(this);
|
| - } else {
|
| - function = JSFunction::cast(constructor);
|
| - }
|
| -
|
| - return function->context()->native_context();
|
| -}
|
| -
|
| -
|
| MaybeHandle<Object> JSObject::EnqueueChangeRecord(Handle<JSObject> object,
|
| const char* type_str,
|
| Handle<Name> name,
|
| @@ -14709,9 +14709,11 @@ MaybeHandle<JSObject> JSObject::GetKeysForNamedInterceptor(
|
| }
|
| if (result.IsEmpty()) return MaybeHandle<JSObject>();
|
| DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
|
| - v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
|
| + (v8::Utils::OpenHandle(*result)->IsJSObject() &&
|
| + Handle<JSObject>::cast(v8::Utils::OpenHandle(*result))
|
| + ->HasSloppyArgumentsElements()));
|
| // Rebox before returning.
|
| - return handle(*v8::Utils::OpenHandle(*result), isolate);
|
| + return handle(JSObject::cast(*v8::Utils::OpenHandle(*result)), isolate);
|
| }
|
|
|
|
|
| @@ -14732,9 +14734,11 @@ MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor(
|
| }
|
| if (result.IsEmpty()) return MaybeHandle<JSObject>();
|
| DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
|
| - v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
|
| + (v8::Utils::OpenHandle(*result)->IsJSObject() &&
|
| + Handle<JSObject>::cast(v8::Utils::OpenHandle(*result))
|
| + ->HasSloppyArgumentsElements()));
|
| // Rebox before returning.
|
| - return handle(*v8::Utils::OpenHandle(*result), isolate);
|
| + return handle(JSObject::cast(*v8::Utils::OpenHandle(*result)), isolate);
|
| }
|
|
|
|
|
|
|