How to use the ariatemplates/utils/Type.isFunction function in ariatemplates

To help you get started, we’ve selected a few ariatemplates examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Sequence.js View on Github external
run : function (onEnd, scope, arg) {
            // -------------------------------------- input arguments processing

            if (!ariaUtilsType.isFunction(onEnd)) {
                onEnd = Aria.empty;
            }

            if (scope == null) {
                scope = this;
            }

            // ------------------------------------------------------ processing

            // actual sequence creation ----------------------------------------

            var sequence = new ariaCoreSequencer();
            this._toDispose.push(sequence);
            this.__sequence = sequence;

            ariaUtilsArray.forEach(this.__tasks, function (task) {
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Sequencer.js View on Github external
ariaUtilsArray.forEach(specs, function (spec) {
                if (spec.children == null) {
                // task --------------------------------------------------------

                    sequence.addTask(this.task(spec));
                } else {
                // sequence ----------------------------------------------------

                    var children = spec.children;

                    if (ariaUtilsType.isString(children)) {
                        children = this.scope[children];
                    }

                    if (ariaUtilsType.isFunction(children)) {
                        children = children.apply(this.scope, spec.args || []);
                    }

                    sequence.addSequence(this.sequence(spec.name, children));
                }
            }, this);
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Task.js View on Github external
this.args = args;

        // callback > asynchronous ---------------------------------------------

        var asynchronous = spec.asynchronous;
        if (asynchronous == null) {
            asynchronous = true;
        }
        asynchronous = !!asynchronous;
        this.asynchronous = asynchronous;

        // fn ------------------------------------------------------------------

        var fn = spec.fn;

        if (!ariaUtilsType.isFunction(fn)) {
            throw Error('The function to be used by the task is not properly specified. Got: ' + fn);
        }

        this.fn = fn;

        // trace ---------------------------------------------------------------

        var trace = spec.trace;
        this.trace = {};
        if (ariaUtilsType.isObject(trace)) {
            // trace > enable --------------------------------------------------

            var enable = trace.enable;

            if (enable == null) {
                enable = trace.activate;
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Sequencer.js View on Github external
var scope = spec.scope;

            if (scope == null) {
                scope = registeredProperties.scope;
            }
            if (scope == null) {
                scope = this.scope;
            }

            // fn (actual callback) --------------------------------------------

            if (ariaUtilsType.isString(fn)) {
                fn = scope[fn];
            }

            if (!ariaUtilsType.isFunction(fn)) {
                throw new Error('Wrong function definition, got: ' + fn);
            }

            // asynchronous ----------------------------------------------------

            var asynchronous = spec.asynchronous;

            if (asynchronous == null) {
                asynchronous = registeredProperties.asynchronous;
            }

            if (asynchronous == null) {
                asynchronous = this.asynchronous;
            }

            asynchronous = !!asynchronous;
github ariatemplates / ariatemplates / test / EnhancedRobotBase.js View on Github external
creator.call(this, function add(fnOrName) {
            var fn;
            if (ariaUtilsType.isString(fnOrName)) {
                fn = self[fnOrName];
            } else {
                fn = fnOrName;
            }

            if (fn == null) {
                throw new Error('The given value is not defined, cannot add any function.');
            }

            if (ariaUtilsType.isFunction(fn.async)) {
                fn = fn.async;
            }

            if (arguments.length > 1) {
                var boundArguments = Array.prototype.slice.call(arguments, 1);
                fn = self._partializeAsynchronousFunction(fn, boundArguments);
            }

            sequence.push(fn);
        });
github ariatemplates / ariatemplates / test / aria / ext / filesgenerator / GeneratorTestCase.js View on Github external
moduleControllerLoaded : function (res) {
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinition));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinition));
            this.assertTrue(typeof res.moduleCtrl == "object", "Instantiating generated Module didn't produce an object");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrlPrivate, "aria.my.great.test.ModuleDefinition"), "Instantiated object is not of the correct type");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrl, "aria.my.great.test.IModuleDefinition"), "Instantiated object is not of the correct type");
            res.moduleCtrlPrivate.$dispose();
            Aria.dispose("aria.my.great.test.ModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinitionFlow");
            Aria.dispose("aria.my.great.test.ModuleDefinitionFlow");
            this.notifyTestEnd("testAsyncModuleControllerClass");
        },
github ariatemplates / ariatemplates / test / aria / ext / filesgenerator / GeneratorTestCase.js View on Github external
moduleControllerLoaded : function (res) {
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinition));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinition));
            this.assertTrue(typeof res.moduleCtrl == "object", "Instantiating generated Module didn't produce an object");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrlPrivate, "aria.my.great.test.ModuleDefinition"), "Instantiated object is not of the correct type");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrl, "aria.my.great.test.IModuleDefinition"), "Instantiated object is not of the correct type");
            res.moduleCtrlPrivate.$dispose();
            Aria.dispose("aria.my.great.test.ModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinitionFlow");
            Aria.dispose("aria.my.great.test.ModuleDefinitionFlow");
            this.notifyTestEnd("testAsyncModuleControllerClass");
        },
github ariatemplates / ariatemplates / test / aria / ext / filesgenerator / GeneratorTestCase.js View on Github external
moduleControllerLoaded : function (res) {
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinition));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinition));
            this.assertTrue(typeof res.moduleCtrl == "object", "Instantiating generated Module didn't produce an object");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrlPrivate, "aria.my.great.test.ModuleDefinition"), "Instantiated object is not of the correct type");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrl, "aria.my.great.test.IModuleDefinition"), "Instantiated object is not of the correct type");
            res.moduleCtrlPrivate.$dispose();
            Aria.dispose("aria.my.great.test.ModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinitionFlow");
            Aria.dispose("aria.my.great.test.ModuleDefinitionFlow");
            this.notifyTestEnd("testAsyncModuleControllerClass");
        },
github ariatemplates / ariatemplates / test / aria / ext / filesgenerator / GeneratorTestCase.js View on Github external
moduleControllerLoaded : function (res) {
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinition));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.IModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinitionFlow));
            this.assertTrue(ariaUtilsType.isFunction(aria.my.great.test.ModuleDefinition));
            this.assertTrue(typeof res.moduleCtrl == "object", "Instantiating generated Module didn't produce an object");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrlPrivate, "aria.my.great.test.ModuleDefinition"), "Instantiated object is not of the correct type");
            this.assertTrue(ariaUtilsType.isInstanceOf(res.moduleCtrl, "aria.my.great.test.IModuleDefinition"), "Instantiated object is not of the correct type");
            res.moduleCtrlPrivate.$dispose();
            Aria.dispose("aria.my.great.test.ModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinition");
            Aria.dispose("aria.my.great.test.IModuleDefinitionFlow");
            Aria.dispose("aria.my.great.test.ModuleDefinitionFlow");
            this.notifyTestEnd("testAsyncModuleControllerClass");
        },