X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/JSProxy.cpp diff --git a/runtime/JSProxy.cpp b/runtime/JSProxy.cpp index 494a79e..f4c6829 100644 --- a/runtime/JSProxy.cpp +++ b/runtime/JSProxy.cpp @@ -33,16 +33,12 @@ namespace JSC { STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSProxy); -const ClassInfo JSProxy::s_info = { "JSProxy", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSProxy) }; +const ClassInfo JSProxy::s_info = { "JSProxy", &Base::s_info, 0, CREATE_METHOD_TABLE(JSProxy) }; void JSProxy::visitChildren(JSCell* cell, SlotVisitor& visitor) { JSProxy* thisObject = jsCast(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); - - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); - ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); - Base::visitChildren(thisObject, visitor); visitor.append(&thisObject->m_target); } @@ -118,6 +114,25 @@ void JSProxy::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameAr thisObject->target()->methodTable(exec->vm())->getPropertyNames(thisObject->target(), exec, propertyNames, mode); } +uint32_t JSProxy::getEnumerableLength(ExecState* exec, JSObject* object) +{ + JSProxy* thisObject = jsCast(object); + return thisObject->target()->methodTable(exec->vm())->getEnumerableLength(exec, thisObject->target()); +} + +void JSProxy::getStructurePropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode) +{ + // Skip the structure loop, since it is invalid for proxies. +} + +void JSProxy::getGenericPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) +{ + JSProxy* thisObject = jsCast(object); + // Get *all* of the property names, not just the generic ones, since we skipped the structure + // ones above. + thisObject->target()->methodTable(exec->vm())->getPropertyNames(thisObject->target(), exec, propertyNames, mode); +} + void JSProxy::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { JSProxy* thisObject = jsCast(object);