Fix JS error when unknown option is set

Unknown option (when option handler function is not defined in the
renderer) must be ignored. The current implemention calls renederer
function instead.

Avoid calling renderer function when setting unknown option. 

Change-Id: Iad824b9f4f4e3ca69106535d3028ced9a835cb21
diff --git a/bundles/org.eclipse.rap.addons.chart/js/chart/chart.js b/bundles/org.eclipse.rap.addons.chart/js/chart/chart.js
index bc98c85..e991a9e 100644
--- a/bundles/org.eclipse.rap.addons.chart/js/chart/chart.js
+++ b/bundles/org.eclipse.rap.addons.chart/js/chart/chart.js
@@ -47,7 +47,7 @@
       }
       obj = obj[part];
     });
-    if( typeof obj === "function" ) {
+    if( typeof obj === "function" && obj !== this._renderer ) {
       obj( value );
       this._scheduleUpdate();
     }
diff --git a/tests/org.eclipse.rap.addons.chart.test/js/chart/chart-spec.js b/tests/org.eclipse.rap.addons.chart.test/js/chart/chart-spec.js
index ef1bee0..6b7c492 100644
--- a/tests/org.eclipse.rap.addons.chart.test/js/chart/chart-spec.js
+++ b/tests/org.eclipse.rap.addons.chart.test/js/chart/chart-spec.js
@@ -104,6 +104,12 @@
       expect( renderer.foo.bar ).toHaveBeenCalledWith( 23 );
     } );
 
+    it( "doesn't call renderer when method is missing", function() {
+      chart.setOption( "foo", 23 );
+
+      expect( renderer ).not.toHaveBeenCalledWith( 23 );
+    } );
+
   } );
 
 } );