Add a custom setter to your record

@class Definition
@method setter
@param {string} name - The setter name
@param {function} fn - The method to call

@return {Definition}
487844
function(name, fn) {
    const externalName = this.store.toExternalAttributeName(name)
    this.instanceMethods.__defineSetter__(name, fn)
    if(externalName !== name) this.instanceMethods.__defineSetter__(externalName, fn)
    return this
  }
787202
function defineProp (obj, name, fn) {
  Object.defineProperty(obj, name, {
    enumerable: true,
    configurable: true,
    get: function () {
      return fn();
    }
  });
}
181211
static
	public void putFunction(String name, Function function){
		FunctionRegistry.functions.put(Objects.requireNonNull(name), function);
	}
197440
def setter(self, func):
        
        if not callable(func):
            raise TypeError('setter must be callable function')
        if hasattr(func, '__code__') and func.__code__.co_argcount != 2:
            raise TypeError('setter must be a function with two arguments')
        if func.__name__ != self.name:
            raise TypeError('setter function must have same name as getter')
        self._set_func = func
        return self
666505
function(name,options) {
    var cls = new Class(name,options);
    cls = cls.toFunction();
    return new cls();
  }
510933
function (name, callback) {
    var self = this;

    if (!self.callbacks[name])
      self.callbacks[name] = [callback];
    else
      self.callbacks[name].push(callback);
  }
946072
function (key, fn) {
    if (typeof key === 'function') {
      fn = key;
      key = null;
    }
    if (typeof fn !== 'function') {
      fn = this.pickOption('renameKey');
    }
    if (typeof fn !== 'function') {
      fn = utils.identity;
    }

    this.options.renameKey = fn;
    if (arguments.length === 2) {
      return fn(key);
    }
    if (typeof key === 'string') {
      return fn(key);
    }
    return fn;
  }
1314762
function(name, fn) {
    const _name = this.store.toInternalAttributeName(name)
    const Store = require('../store')
    if (!this.attributes[_name]) throw new Store.UnknownAttributeError(name)

    this.attributes[_name].variant = fn

    this[name + '$'] = function(args) {
      return fn.call(this, this[_name], args)
    }

    return this
  }
1112774
function prototypeize(fn, name = fn.name) {
  if (name) { // IE11 does not support name
    defineProperty(prototype, name, {
      get: function() { return fn(this); }
    });
  }
}
1135581
function Component_set(name, config, Func) {
        if (!this.has(name)) {
            config.name = name;
            try {
                this.checkDependency(config);
                if (!Type.isFunction(Func)) {
                    if (config.filePath) {
                        Func = di.load(config.filePath);
                    } else {
                        Func = di.load(name);
                    }
                }
                this.components[name] = new Func(config);
            } catch (e) {
                throw new error.Exception('Component "' + name + '" is not initialized', e);
            }
        } else {
            throw new error.DataError(config, 'Component "' + name + '" already exist in system');
        }
        return this.get(name);
    }
277165
function(name) {
    var CustomProperty = lib.method.createMethod(name,function() {});
    lib.inherits.inherits(CustomProperty,Property);
    lib.extend.extend(CustomProperty,{ name: name });
    return CustomProperty;
  }
359980
function( name, fn ) {
				var args = Array.prototype.slice.call( arguments, 0 );

				if ( CKEDITOR.env.ie && ( /^focus|blur$/ ).exec( name ) ) {
					name = name == 'focus' ? 'focusin' : 'focusout';

					// The "focusin/focusout" events bubbled, e.g. If there are elements with layout
					// they fire this event when clicking in to edit them but it must be ignored
					// to allow edit their contents. (#4682)
					fn = isNotBubbling( fn, this );
					args[ 0 ] = name;
					args[ 1 ] = fn;
				}

				return CKEDITOR.dom.element.prototype.on.apply( this, args );
			}
885414
def set_function_name(f, name, cls):
    
    f.__name__ = name
    f.__qualname__ = '{klass}.{name}'.format(
        klass=cls.__name__,
        name=name)
    f.__module__ = cls.__module__
    return f
1218331
function(name, definition){
      var region;

      var isObject = _.isObject(definition);
      var isString = _.isString(definition);
      var hasSelector = !!definition.selector;

      if (isString || (isObject && hasSelector)){
        region = Marionette.Region.buildRegion(definition, Marionette.Region);
      } else if (_.isFunction(definition)){
        region = Marionette.Region.buildRegion(definition, Marionette.Region);
      } else {
        region = definition;
      }

      this._store(name, region);
      this.triggerMethod("region:add", name, region);
      return region;
    }
4330
function _fn (context, object) {
    return context.customElement(_name, _attributes, _fnBody, context, object);
  }
78029
function (name, func)
        {
            if (typeof(ModalDialog.events) == 'undefined') {
                ModalDialog.events = [];
            }
    
            ModalDialog.events.push([name, func]);
        }
621636
function MANDATORY_SETTER_FUNCTION(name) {
    function SETTER_FUNCTION(value) {
      _emberMetalDebug.assert('You must use Ember.set() to set the `' + name + '` property (of ' + this + ') to `' + value + '`.', false);
    }

    SETTER_FUNCTION.isMandatorySetter = true;
    return SETTER_FUNCTION;
  }