Line 2640 in tincan.js (retrieveState)- this.log is not a function (out of scope)
Closed this issue · 3 comments
mpkliewer commented
I found that while using getState I would get the error "this.log is not a function"
on line 2640 (in the retrieveState function):
this.log("retrieveState - failed to deserialize JSON: " + ex);
this
seems to be out of scope by the time it gets down that far.
Adding var that=this
to line 2570 and changing (what is now) 2641 to that.log
fixed it for me.
Thanks for all the work on this library!
Matt
garemoko commented
Thanks for raising this and explaining the fix!
For whoever does the PR, the relevant line is https://github.com/RusticiSoftware/TinCanJS/blob/master/src/LRS.js#L918
I suggest trying var lrs = this;
at the start of that function rather than that
.
@mpkliewer please feel free to raise a PR for this yourself.
brianjmiller commented
Lands in next build.
brianjmiller commented
Available in 0.40.0.