gruntjs / gruntjs/grunt

grunt.config.merge getter differently

Open
#1,640 1 comment 0 reactions 1 assignee Claimed by @shama View on GitHub
Type: Bug
Dominant language
JavaScript
Stars
12.2k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

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

Example:
```javascript
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") );
});

};
```
```cmd
$ grunt --version
grunt v1.0.2
$ grunt
0
1
0
0
```

```cmd
$ grunt --version
grunt v1.0.3
$ grunt
0
0
0
0
```

Env:
```bash
$ npm -v
6.0.1
$ nodejs -v
v10.4.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.