| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index f5ad23396b9dd5c6d531c585f9be4ec938a093c9..fefdc5be48dde724d2eeff54368985392a6dc7b3 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -2249,6 +2249,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;
|
| @@ -2353,21 +2368,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,
|
| @@ -6495,6 +6495,15 @@ bool JSReceiver::ValidateAndApplyPropertyDescriptor(
|
| }
|
|
|
|
|
| +// static
|
| +Maybe<bool> JSReceiver::CreateDataProperty(LookupIterator* it,
|
| + Handle<Object> value) {
|
| + // TODO(rossberg): Support proxies.
|
| + if (!it->GetReceiver()->IsJSObject()) return Nothing<bool>();
|
| + return JSObject::CreateDataProperty(it, value);
|
| +}
|
| +
|
| +
|
| // TODO(jkummerow): Consider unification with FastAsArrayLength() in
|
| // accessors.cc.
|
| bool PropertyKeyToArrayLength(Handle<Object> value, uint32_t* length) {
|
| @@ -14868,9 +14877,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);
|
| }
|
|
|
|
|
| @@ -14891,9 +14902,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);
|
| }
|
|
|
|
|
|
|