<commit_before>/*
 * Copyright (c) 2011-2013 by Animatron.
 * All rights are reserved.
 *
 * Animatron Player is licensed under the MIT License, see LICENSE.
 *
 * @VERSION
 */

(function() { // anonymous wrapper to exclude global context clash
  var C = anm.C,
      is = __anm.is;
  var _ResMan = __anm.resource_manager;
  var Player = anm.Player;

  C.MOD_SCRIPTING = 'scripting';
  if (anm.M[C.MOD_SCRIPTING]) throw new Error('SCRIPTING module already enabled');

  anm.M[C.MOD_SCRIPTING] = {};

  var E = anm.Element;

  function user_ctx(elm) {
    var ctx = elm.bstate;
    ctx.findByName = function(name) {
      return anm.findByName(elm.scene, name);
    };

    ctx.$ = elm;
    return ctx;
  }

  var BOUNDS_PAIR = [
      '(function(ctx) { ' +
        'return function(evt, t) { ' +
          'if (this.$.contains(evt.pos)) { ' +
            '(function(ctx, evt, t) { ' +
              'var _b = Builder._$;',
                /* content */
            '\n}).call(user_ctx(this.$), ctx, evt, t);' +
          '}' +
        '}' +
      '})(____user_ctx)'];

  var NO_BOUNDS_PAIR = [
      '(function(ctx) { ' +
        'return function(evt, t) { ' +<commit_msg>[scripting] context for findByName<commit_after>/*
 * Copyright (c) 2011-2013 by Animatron.
 * All rights are reserved.
 *
 * Animatron Player is licensed under the MIT License, see LICENSE.
 *
 * @VERSION
 */

(function() { // anonymous wrapper to exclude global context clash
  var C = anm.C,
      is = __anm.is;
  var _ResMan = __anm.resource_manager;
  var Player = anm.Player;

  C.MOD_SCRIPTING = 'scripting';
  if (anm.M[C.MOD_SCRIPTING]) throw new Error('SCRIPTING module already enabled');

  anm.M[C.MOD_SCRIPTING] = {};

  var E = anm.Element;

  function user_ctx(elm) {
    var ctx = elm.bstate;
    ctx.findByName = function(name, context) {
      return anm.findByName(context || elm.scene, name);
    };

    ctx.$ = elm;
    return ctx;
  }

  var BOUNDS_PAIR = [
      '(function(ctx) { ' +
        'return function(evt, t) { ' +
          'if (this.$.contains(evt.pos)) { ' +
            '(function(ctx, evt, t) { ' +
              'var _b = Builder._$;',
                /* content */
            '\n}).call(user_ctx(this.$), ctx, evt, t);' +
          '}' +
        '}' +
      '})(____user_ctx)'];

  var NO_BOUNDS_PAIR = [
      '(function(ctx) { ' +
        'return function(evt, t) { ' +
{'fraction_non_alphanumeric': 0.15974842767295597, 'fraction_numerical': 0.0067085953878406705, 'mean_word_length': 2.2462585034013607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5181886', 'n_tokens_mistral': 873, 'n_tokens_neox': 850, 'n_words': 193}