Grammalecte  Check-in [7cc552ce5a]

Overview
Comment:[core][js] set echo as console.log if no require available
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | webext2_fix
Files: files | file ages | folders
SHA3-256: 7cc552ce5ae9a73c76b55ac227f70aa6cc270e6340e2b35b9a0e005ce4276110
User & Date: olr on 2017-08-06 12:14:35
Other Links: branch diff | manifest | tags
Context
2017-08-08
16:39
[fx] merge webext2 check-in: 1eac03608e user: IllusionPerdu tags: fx, webext2_fix
2017-08-06
12:22
[core][fr][js] merge webext2_fix: code cleaning + bug fixes + remove Array comprehensions (for compatibility) check-in: d0f7053d0f user: olr tags: fr, core, webext2
12:14
[core][js] set echo as console.log if no require available check-in: 7cc552ce5a user: olr tags: core, webext2_fix
10:09
[core][js] fix wrong filter (was Array comprehension) check-in: 6aa7638d90 user: olr tags: core, webext2_fix
Changes

Modified gc_core/js/lang_core/gc_engine.js from [7b6c2ffd4b] to [46602d3f85].

9
10
11
12
13
14
15

16


17




18
19
20
21
22
23
24
9
10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27
28
29
30







+

+
+
-
+
+
+
+








if (typeof(require) !== 'undefined') {
    var helpers = require("resource://grammalecte/helpers.js");
    var gc_options = require("resource://grammalecte/${lang}/gc_options.js");
    var gc_rules = require("resource://grammalecte/${lang}/gc_rules.js");
    var cregex = require("resource://grammalecte/${lang}/cregex.js");
    var text = require("resource://grammalecte/text.js");
    var echo = helpers.echo;
}
else if (typeof(console) !== "undefined") {
    var echo = function (o) { console.log(o); return true; };

}
else {
    var echo = function () { return true; }
}

function capitalizeArray (aArray) {
    // can’t map on user defined function??
    let aNew = [];
    for (let i = 0; i < aArray.length; i = i + 1) {
        aNew[i] = aArray[i].gl_toCapitalize();
    }