<commit_before>import ReplaceSupers from "../../helpers/replace-supers";
import * as t from "../../../types";

function Property(path, node, scope, getObjectRef, file) {
  if (!node.method) return;

  var value = node.value;
  var thisExpr = scope.generateUidIdentifier("this");

  var replaceSupers = new ReplaceSupers({
    topLevelThisReference: thisExpr,
    getObjectRef:          getObjectRef,
    methodNode:            node,
    methodPath:            path,
    isStatic:              true,
    scope:                 scope,
    file:                  file
  });

  replaceSupers.replace();

  if (replaceSupers.hasSuper) {
    value.body.body.unshift(
      t.variableDeclaration("var", [
        t.variableDeclarator(thisExpr, t.thisExpression())
      ])
    );
  }
}

export function ObjectExpression(node, parent, scope, file) {
  var objectRef;
  var getObjectRef = () => objectRef = objectRef || scope.generateUidIdentifier("obj");<commit_msg>clean up es6.objectSuper transformer - fixes #1502<commit_after>import ReplaceSupers from "../../helpers/replace-supers";
import * as t from "../../../types";

function Property(path, node, scope, getObjectRef, file) {
  if (!node.method && node.kind === "init") return;
  if (!t.isFunction(node.value)) return;

  var replaceSupers = new ReplaceSupers({
    getObjectRef: getObjectRef,
    methodNode:   node,
    methodPath:   path,
    isStatic:     true,
    scope:        scope,
    file:         file
  });

  replaceSupers.replace();
}

export function ObjectExpression(node, parent, scope, file) {
  var objectRef;
  var getObjectRef = () => objectRef = objectRef || scope.generateUidIdentifier("obj");
{'fraction_non_alphanumeric': 0.13249400479616308, 'fraction_numerical': 0.002997601918465228, 'mean_word_length': 2.8904428904428903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '2557607', 'n_tokens_mistral': 497, 'n_tokens_neox': 488, 'n_words': 119}