mirror of
https://scm.univ-tours.fr/22107988t/rappaurio-sae501_502.git
synced 2025-08-29 22:05:57 +02:00
38 lines
1.9 KiB
JavaScript
38 lines
1.9 KiB
JavaScript
'use strict';
|
||
if (typeof CeL === 'function')
|
||
CeL.run({
|
||
// name/id.
|
||
name : 'extension.loop1',
|
||
// dependency.
|
||
require : 'extension.loop2.loop2_function',
|
||
// post action.
|
||
finish : function(name_space) {
|
||
// assert: this.id===name_space.Class
|
||
this.base.log('Module [' + name_space.Class + '] loaded.');
|
||
},
|
||
// source code.
|
||
code : function(library_namespace) {
|
||
// requiring
|
||
var loop2_function = this.r('loop2_function');
|
||
|
||
function loop1_function(caller) {
|
||
library_namespace
|
||
.debug(
|
||
'This is extension.loop1.loop1_function'
|
||
+ (caller ? ', called by ' + caller
|
||
: '') + '.', 1,
|
||
'loop1_function');
|
||
}
|
||
;
|
||
|
||
function loop1_function2(caller) {
|
||
library_namespace.debug('Calling loop2_function..', 1,
|
||
'loop1_function2');
|
||
loop2_function(caller || 'loop1_function2');
|
||
}
|
||
;
|
||
|
||
return [ loop1_function, loop1_function2 ];
|
||
}
|
||
});
|