mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Fix evaluateNodeProperty handling of unknown types
This commit is contained in:
		@@ -335,7 +335,7 @@ var parseContextStore = function(key) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function evaluateNodeProperty(value, type, node, msg, callback) {
 | 
			
		||||
    var result;
 | 
			
		||||
    var result = value;
 | 
			
		||||
    if (type === 'str') {
 | 
			
		||||
        result = ""+value;
 | 
			
		||||
    } else if (type === 'num') {
 | 
			
		||||
 
 | 
			
		||||
@@ -307,6 +307,10 @@ describe("red/util", function() {
 | 
			
		||||
            },{});
 | 
			
		||||
            result.should.eql("123");
 | 
			
		||||
        });
 | 
			
		||||
        it('returns null', function() {
 | 
			
		||||
            var result = util.evaluateNodeProperty(null,'null');
 | 
			
		||||
            (result === null).should.be.true();
 | 
			
		||||
        })
 | 
			
		||||
        describe('environment variable', function() {
 | 
			
		||||
            before(function() {
 | 
			
		||||
                process.env.NR_TEST_A = "foo";
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user