Tihauan / jsgauge

Automatically exported from code.google.com/p/jsgauge
0 stars 0 forks source link

setValue throws TypeError #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Tested with SRWare Iron 16.0.950.0 (Chromium/Webkit based)

What steps will reproduce the problem?

1. initialze gauge
2. use setValue method

The error is caused by gauge.js:351 where

  if (that.cancelRequestAnimFrame) {
    that.cancelRequestAnimFrame(that.animationToken);

is called with that.animationToken==null. 

The issue can be fixed by changing the previous condition:

-  if (that.cancelRequestAnimFrame) {
+  if (that.cancelRequestAnimFrame && that.animationToken) {

Best regards,
Carsten

Original issue reported on code.google.com by carsten....@googlemail.com on 31 Dec 2011 at 10:24

GoogleCodeExporter commented 9 years ago
It seems, there are several signatures to the cancelRequestAnimFrame method in 
the wild. My Browser shows the following signature without any parameters:

cancelRequestAnimFrame: function webkitCancelRequestAnimationFrame() { [native 
code] }

Within the webkit commit log, there are hints for other signatures and for a 
recent renaming of the method:

http://www.mail-archive.com/webkit-changes@lists.webkit.org/msg14211.html

After reading these messages I have modified my fix:

-  if (that.cancelRequestAnimFrame) {
+  if (that.cancelRequestAnimFrame && that.cancelRequestAnimFrame.arguments != 
null) {

Carsten

Original comment by carsten....@googlemail.com on 31 Dec 2011 at 10:41

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r64.

Original comment by dragos.tihauan on 1 Jan 2012 at 8:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Other people are also running into this problem: 

http://stackoverflow.com/questions/9114903/jsgauge-setvalue-gives-illegal-invoca
tion-in-chrome

It might be a good idea to release a new version of jsgauge with this fix.

Original comment by justin.e...@gmail.com on 2 Feb 2012 at 4:49