#include "config.h"
#include "JSDOMIterator.h"
#include <builtins/BuiltinNames.h>
#include <runtime/ArrayPrototype.h>
namespace WebCore {
void addValueIterableMethods(JSC::JSGlobalObject& globalObject, JSC::JSObject& prototype)
{
JSC::ArrayPrototype* arrayPrototype = globalObject.arrayPrototype();
ASSERT(arrayPrototype);
JSC::ExecState* state = globalObject.globalExec();
ASSERT(state);
JSC::VM& vm = state->vm();
auto copyProperty = [&] (const JSC::Identifier& arrayIdentifier, const JSC::Identifier& otherIdentifier, unsigned attributes = 0) {
JSC::JSValue value = arrayPrototype->getDirect(vm, arrayIdentifier);
ASSERT(value);
prototype.putDirect(vm, otherIdentifier, value, attributes);
};
copyProperty(vm.propertyNames->builtinNames().entriesPrivateName(), vm.propertyNames->builtinNames().entriesPublicName());
copyProperty(vm.propertyNames->builtinNames().forEachPrivateName(), vm.propertyNames->builtinNames().forEachPublicName());
copyProperty(vm.propertyNames->builtinNames().keysPrivateName(), vm.propertyNames->builtinNames().keysPublicName());
copyProperty(vm.propertyNames->builtinNames().valuesPrivateName(), vm.propertyNames->builtinNames().valuesPublicName());
copyProperty(vm.propertyNames->builtinNames().valuesPrivateName(), vm.propertyNames->builtinNames().iteratorSymbol(), JSC::DontEnum);
}
}