function validateAndNormalizeStaticMethods(staticMethods) { nm_.each(staticMethods, function(static_method, key) { if (!nm_.isFunction(static_method)) { throw new lErrors.Schema.InvalidType('Type should be a function.'); } }); }
$assertEveryCalled (function (one, two) { var this_ = undefined var Trait = $trait ({ someValue: $observableProperty (42) }) var Other = $trait ({ someValue: function (_42) { one () } }) var Compo = $component ({ $traits: [Trait, Other], someValue: function (_42) { two () } }) this_ = new Compo () $assert (_.isFunction (this_.someValueChange)) this_.someValue = 33 })
/* I/O API (two-way) */ var frontEnd = function (...args) { const fn = args[0] if (_.isFunction (fn)) { read.call (this, fn) } else { write.apply (this, args) } return frontEnd }
_.forEach(files, function(file) { processing.run(file, function (PreparedFile) { if (_.isFunction(cbPreparedFile)) { cbPreparedFile(PreparedFile); } else { return console.error('cbPreparedFile should be a function'); } }, type); });
self.authorize() .then(function(){ self.method.call(self, method, function(data, response){ // Check if we have to wrap data into a model if (_.isFunction(callback)) { callback(data, response); } }, options) .then(resolve) .catch(reject) }) .catch(reject);
test("IE host objects", function() { var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); ok(!_.isNumber(xml)); ok(!_.isBoolean(xml)); ok(!_.isNaN(xml)); ok(!_.isFunction(xml)); ok(!_.isNull(xml)); ok(!_.isUndefined(xml)); });
_.each (def.__bindables, (member, name) => { var bound = _.filter2 (_.bindable.hooks, function (hook, i) { var bound = pool[_.bindable.hooksShort[i] + name.capitalized] return bound ? [hook, bound] : false }) if (bound.length) { var hooks = {} _.each (bound, function (kv) { _.each (kv[1], function (fn) { fn = $untag (fn) if (_.isFunction (fn)) { var k = '_' + kv[0]; (hooks[k] || (hooks[k] = [])).push (fn) } }) }) def[name] = $bindable ({ hooks: hooks }, member) } })
initialize(self) { return P.resolve() .then(() => { if (_.isFunction(this.definition.initialize)) { return this.definition.initialize(self || this); } }) .catch(err => { this.getLog().warn('Actor initialization failed, destroying, error=', err); this.destroy(); throw err; }) .then(() => { this._setState('ready'); }); }
parser.parse(PreparedFile, function(Resume) { if (_.isFunction(cbGetResume)) { cbGetResume(Resume); } else { console.error('cbGetResume should be a function'); } });
async destroy0(self) { if (this.pendingCount !== 0) { let pending = {}; let promise = new P((resolve, reject) => { pending = { resolve, reject }; }); this.destroyPromise0 = pending; await promise; } if (_.isFunction(this.definition.destroy)) { return this.definition.destroy(self || this); } }
metrics0() { if (_.isFunction(this.definition.metrics)) { return this.definition.metrics(); } return {}; }
var typeMatchesValue = function (c, v) { var contract = Meta.unwrap (c) return (contract === $any) || ((contract === undefined) && (v === undefined)) || (_.isFunction (contract) && ( _.isPrototypeConstructor (contract) ? _.isTypeOf (contract, v) : // constructor type (contract (v) === true))) || // test predicate (typeof v === contract) || // plain JS type (v === contract) }
test("isFunction", function() { ok(!_.isFunction(undefined), 'undefined vars are not functions'); ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); ok(!_.isFunction('moe'), 'strings are not functions'); ok(_.isFunction(_.isFunction), 'but functions are'); ok(_.isFunction(iFunction), 'even from another frame'); ok(_.isFunction(function(){}), 'even anonymous ones'); });
/* Apply cfg thing */ _.each (cfg, function (value, name) { if (!(name in excludeFromCfg)) { this[name] = _.isFunction (value) ? this.$ (value) : value } }, this)
function validateAndNormalizeMethods(methods) { nm_.each(methods, function(method, key) { if (!nm_.isFunction(method)) { throw new lErrors.Schema.InvalidType('Type should be a function.'); } }); }