Commit 6c9a2986 authored by Mathieu Rodic's avatar Mathieu Rodic

[FEATURE] ajout d'un message d'erreur lorsque de mauvais paramètres sont passés au constructeur

parent c8af4ec8
...@@ -545,6 +545,9 @@ var Graph = function(container, width, height) { ...@@ -545,6 +545,9 @@ var Graph = function(container, width, height) {
}; };
(function() { (function() {
if (typeof(container) != 'object') {
console.error('The first parameter of the Graph class constructor should be a valid DOM object.');
}
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
var canvasContext = canvas.getContext && canvas.getContext('2d'); var canvasContext = canvas.getContext && canvas.getContext('2d');
if (!!canvasContext) { if (!!canvasContext) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment