Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 3f028c62824a35653bdc4ef03b265f6eedd4413e..24237f6f72785e6d5e5858c5cf704ace7370a3bb 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -611,6 +611,23 @@ MaybeHandle<Object> Object::BitwiseXor(Isolate* isolate, Handle<Object> lhs, |
} |
+Maybe<bool> Object::IsArray(Handle<Object> object) { |
+ if (object->IsJSArray()) return Just(true); |
+ if (object->IsJSProxy()) { |
+ Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
+ Isolate* isolate = proxy->GetIsolate(); |
+ if (proxy->IsRevoked()) { |
+ isolate->Throw(*isolate->factory()->NewTypeError( |
+ MessageTemplate::kProxyRevoked, |
+ isolate->factory()->NewStringFromAsciiChecked("IsArray"))); |
+ return Nothing<bool>(); |
+ } |
+ return Object::IsArray(handle(proxy->target(), isolate)); |
+ } |
+ return Just(false); |
+} |
+ |
+ |
bool Object::IsPromise(Handle<Object> object) { |
if (!object->IsJSObject()) return false; |
auto js_object = Handle<JSObject>::cast(object); |
@@ -983,7 +1000,7 @@ MaybeHandle<Object> JSProxy::GetPrototype(Handle<JSProxy> proxy) { |
} |
-bool JSProxy::IsRevoked() { |
+bool JSProxy::IsRevoked() const { |
// TODO(neis): Decide on how to represent revocation. For now, revocation is |
// unsupported. |
DCHECK(target()->IsJSReceiver()); |