<commit_before>/**
 * dat.GUI JavaScript Controller Library
 * http://code.google.com/p/dat-gui
 *
 * Copyright 2011 Data Arts Team, Google Creative Lab
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */

define([
  'dat/controllers/Controller',
  'dat/controllers/OptionController',
  'dat/controllers/NumberControllerBox',
  'dat/controllers/NumberControllerSlider',
  'dat/controllers/StringController',
  'dat/controllers/FunctionController',
  'dat/controllers/BooleanController',
  'dat/controllers/ImageController',
  'dat/controllers/ObjectController',
  'dat/controllers/NullController',
  'dat/controllers/UndefinedController',
  'dat/utils/common'
],
    function(Controller, OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, ImageController, ObjectController, NullController, UndefinedController, common) {
      'use strict';
      
      var firstTimeImageController = true;

      var ARR_SLICE = Array.prototype.slice;

      function isControllerTemplate(f) {
        return typeof f === 'function' &&
            f.prototype &&
            typeof f.prototype.onBeforeChange === 'function' &&
            typeof f.prototype.onChange === 'function' &&
            typeof f.prototype.onFinishChange === 'function' &&
            typeof f.prototype.setValue === 'function' &&
            typeof f.prototype.getValue === 'function' &&
            typeof f.prototype.updateDisplay === 'function';
      }

      return function(object, property, controllerName, controllers, options_1, options_2, options_3, options_4, options_5, options_6) {
        // when the user specified a specific controller, we'll be using that one, otherwise we 'sniff' the correct controller giving the input values & ditto types.
        var ControllerConstructor = controllers[controllerName];
        if (!ControllerConstructor && /* controllerName instanceof Controller */ isControllerTemplate(controllerName)) {
          ControllerConstructor = controllerName;
        }
        if (ControllerConstructor) {
          return new ControllerConstructor(object, property, options_1, options_2, options_3, options_4, options_5, options_6);
        }

        var dyninfo = common.setupDynamicProperty(object, property);

        var initialValue = (!__dyninfo ? object[property] : __dyninfo.getter.call(object));

        // Providing options?
        if (common.isArray(options_1) || common.isObject(options_1)) {
          return new OptionController(object, property, options_1);
        }
<commit_msg>fix bug introduced with the dynamic property handling<commit_after>/**
 * dat.GUI JavaScript Controller Library
 * http://code.google.com/p/dat-gui
 *
 * Copyright 2011 Data Arts Team, Google Creative Lab
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */

define([
  'dat/controllers/Controller',
  'dat/controllers/OptionController',
  'dat/controllers/NumberControllerBox',
  'dat/controllers/NumberControllerSlider',
  'dat/controllers/StringController',
  'dat/controllers/FunctionController',
  'dat/controllers/BooleanController',
  'dat/controllers/ImageController',
  'dat/controllers/ObjectController',
  'dat/controllers/NullController',
  'dat/controllers/UndefinedController',
  'dat/utils/common'
],
    function(Controller, OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, ImageController, ObjectController, NullController, UndefinedController, common) {
      'use strict';
      
      var firstTimeImageController = true;

      var ARR_SLICE = Array.prototype.slice;

      function isControllerTemplate(f) {
        return typeof f === 'function' &&
            f.prototype &&
            typeof f.prototype.onBeforeChange === 'function' &&
            typeof f.prototype.onChange === 'function' &&
            typeof f.prototype.onFinishChange === 'function' &&
            typeof f.prototype.setValue === 'function' &&
            typeof f.prototype.getValue === 'function' &&
            typeof f.prototype.updateDisplay === 'function';
      }

      return function(object, property, controllerName, controllers, options_1, options_2, options_3, options_4, options_5, options_6) {
        // when the user specified a specific controller, we'll be using that one, otherwise we 'sniff' the correct controller giving the input values & ditto types.
        var ControllerConstructor = controllers[controllerName];
        if (!ControllerConstructor && /* controllerName instanceof Controller */ isControllerTemplate(controllerName)) {
          ControllerConstructor = controllerName;
        }
        if (ControllerConstructor) {
          return new ControllerConstructor(object, property, options_1, options_2, options_3, options_4, options_5, options_6);
        }

        var dyninfo = common.setupDynamicProperty(object, property);

        var initialValue = (!dyninfo ? object[property] : dyninfo.getter.call(object));

        // Providing options?
        if (common.isArray(options_1) || common.isObject(options_1)) {
          return new OptionController(object, property, options_1);
        }

{'fraction_non_alphanumeric': 0.10513005780346821, 'fraction_numerical': 0.008309248554913294, 'mean_word_length': 3.5760330578512396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4987128', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1397, 'n_words': 367}