I ran into an error in a custom grunt task. Below I posted a simple test case relating the problem :
Gruntfile.js
module.exports = function( grunt ){
grunt.task.registerTask( 'endsWith', 'Test of string.prototype.endsWith', function(){
var value = grunt.option('value');
grunt.log.writeln( typeof value );
grunt.log.writeln( value.endsWith( 'bar' ) );
})
};
Test
> grunt endsWith --value=foobar
Running "endsWith" task
string
Warning: Object foobar has no method 'endsWith' Use --force to continue.
Aborted due to warnings.
Execution Time (2016-02-12 16:15:19 UTC)
Total 12ms
It's like grunt doesn't recognize the String.proptotype.endsWith function. Is that normal ?
Edit: I'm using node v0.10.4