grunt icon indicating copy to clipboard operation
grunt copied to clipboard

grunt.config.merge getter differently

Open panther7 opened this issue 7 years ago • 1 comments

Grunt config merge does not work exactly in v1.0.2 and v1.0.3. Second and third getters are differently.

Example:

module.exports = function (grunt) {
    "use strict";

    var i = 0, y = 0;

    grunt.initConfig({});

    grunt.config.merge({
        a: {
            b: {
                get inc () { return y++; }
            },
            get inc () { return i++; }
        }
    });

    grunt.registerTask("default", function() {
        console.debug( grunt.config.get("a.b.inc") );
        console.debug( grunt.config.get("a.b.inc") );
        console.debug( grunt.config.get("a.inc") );
        console.debug( grunt.config.get("a.inc") );
    });

};
$ grunt --version
grunt v1.0.2
$ grunt
0
1
0
0
$ grunt --version
grunt v1.0.3
$ grunt
0
0
0
0

Env:

$ npm -v
6.0.1
$ nodejs -v
v10.4.0

panther7 avatar Jun 11 '18 12:06 panther7

Hello, any progress?

panther7 avatar Dec 28 '18 11:12 panther7