RusticiSoftware/TinCanJS

Line 2640 in tincan.js (retrieveState)- this.log is not a function (out of scope)

Closed this issue · 3 comments

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

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.

Lands in next build.

Available in 0.40.0.