<commit_before>/*
 * Copyright (c) 2012-2013 <NAME>
 * Alle Rechte vorbehalten / All Rights Reserved.  Use is subject to license terms.
 *
 * <https://github.com/anba/es6draft>
 */

(function OldProxyAPI(global) {
"use strict";

const Object = global.Object,
      Array = global.Array,
      Proxy = global.Proxy,
      TypeError = global.TypeError;

const Object_create = Object.create,
      Object_assign = Object.assign,
      Array_from = Array.from;

const iteratorSym = getSym("@@iterator");

function toProxyHandler(handler) {
  var TypeErrorThrower = () => { throw TypeError() };
  var proxyHandler = {
    getOwnPropertyDescriptor: TypeErrorThrower,
    getPropertyDescriptor: TypeErrorThrower,
    getOwnPropertyNames: TypeErrorThrower,
    getPropertyNames: TypeErrorThrower,
    defineProperty: TypeErrorThrower,
    delete: TypeErrorThrower,
    ownKeys: TypeErrorThrower,
  };

  // fundamental traps
  if ('getOwnPropertyDescriptor' in handler) {
    proxyHandler['getOwnPropertyDescriptor'] = (_, pk) => handler['getOwnPropertyDescriptor'](pk);
  }
  if (!('getOwnPropertyDescriptor' in handler) && 'getPropertyDescriptor' in handler) {
    proxyHandler['getOwnPropertyDescriptor'] = (_, pk) => handler['getPropertyDescriptor'](pk);
  }
  if ('getOwnPropertyNames' in handler) {
    proxyHandler['ownKeys'] = () => Array_from(handler['getOwnPropertyNames']()).values()[iteratorSym]();
  }
  if ('defineProperty' in handler) {
    proxyHandler['defineProperty'] = (_, pk, desc) => (handler['defineProperty'](pk, desc), true);
  }
  if ('delete' in handler) {
    proxyHandler['deleteProperty'] = (_, pk) => handler['delete'](pk);
  }<commit_msg>Remove unused entries in proxy-handler and fix delete trap name<commit_after>/*
 * Copyright (c) 2012-2013 <NAME>
 * Alle Rechte vorbehalten / All Rights Reserved.  Use is subject to license terms.
 *
 * <https://github.com/anba/es6draft>
 */

(function OldProxyAPI(global) {
"use strict";

const Object = global.Object,
      Array = global.Array,
      Proxy = global.Proxy,
      TypeError = global.TypeError;

const Object_create = Object.create,
      Object_assign = Object.assign,
      Array_from = Array.from;

const iteratorSym = getSym("@@iterator");

function toProxyHandler(handler) {
  var TypeErrorThrower = () => { throw TypeError() };
  /* fundamental traps mapping:
   * getOwnPropertyDescriptor -> getOwnPropertyDescriptor
   * getPropertyDescriptor -> -
   * getOwnPropertyNames -> ownKeys
   * getPropertyNames -> -
   * defineProperty -> defineProperty
   * delete -> deleteProperty
   * fix -> -
   */
  var proxyHandler = {
    getOwnPropertyDescriptor: TypeErrorThrower,
    defineProperty: TypeErrorThrower,
    deleteProperty: TypeErrorThrower,
    ownKeys: TypeErrorThrower,
  };

  // fundamental traps
  if ('getOwnPropertyDescriptor' in handler) {
    proxyHandler['getOwnPropertyDescriptor'] = (_, pk) => handler['getOwnPropertyDescriptor'](pk);
  } else if ('getPropertyDescriptor' in handler) {
    proxyHandler['getOwnPropertyDescriptor'] = (_, pk) => handler['getPropertyDescriptor'](pk);
  }
  if ('getOwnPropertyNames' in handler) {
    proxyHandler['ownKeys'] = () => Array_from(handler['getOwnPropertyNames']()).values()[iteratorSym]();
  }
  if ('defineProperty' in handler) {
    proxyHandler['defineProperty'] = (_, pk, desc) => (handler['defineProperty'](pk, desc), true);
  }
  if ('delete' in handler) {
    proxyHandler['deleteProperty'] = (_, pk) => handler['delete'](pk);
  }
{'fraction_non_alphanumeric': 0.1374067699368904, 'fraction_numerical': 0.0051635111876075735, 'mean_word_length': 4.3894899536321486, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 26, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '485053', 'n_tokens_mistral': 1018, 'n_tokens_neox': 1022, 'n_words': 225}