A couple of weeks ago I upgraded Handsontable from version 9.0.2 to 14.2.0.
And there is an error when loading one of tables:
“Uncaught Error: Assertion failed: Expecting an unsigned number.
at t.assert (handsontable.full.min.js:933:148046)
at t.default.obtain (handsontable.full.min.js:933:137787)
at t.default.getMeta (handsontable.full.min.js:933:140173)
at h.getCellMeta (handsontable.full.min.js:933:136264)
at t.default.getCellMeta (handsontable.full.min.js:933:104572)
at t.default. (handsontable.full.min.js:933:175843)
at t.fastCall (handsontable.full.min.js:933:219203)
at g.run (handsontable.full.min.js:964:1742)
at t.default.runHooks (handsontable.full.min.js:933:113769)
at t.default.validateCell (handsontable.full.min.js:933:90513)
t.assert @ handsontable.full.min.js:933
obtain @ handsontable.full.min.js:933
getMeta @ handsontable.full.min.js:933
getCellMeta @ handsontable.full.min.js:933
getCellMeta @ handsontable.full.min.js:933
(anonymous) @ handsontable.full.min.js:933
t.fastCall @ handsontable.full.min.js:933
run @ handsontable.full.min.js:964
runHooks @ handsontable.full.min.js:933
validateCell @ handsontable.full.min.js:933
ie @ handsontable.full.min.js:933
setDataAtCell @ handsontable.full.min.js:933
calcTotal @ VM41:1164
afterLoadData @ VM41:667
(anonymous) @ excelTable.js:693
t.fastCall @ handsontable.full.min.js:933
run @ handsontable.full.min.js:964
runHooks @ handsontable.full.min.js:933
t.replaceData @ handsontable.full.min.js:933
loadData @ handsontable.full.min.js:933
loadData @ excelTable.js:1203
(anonymous) @ excelTable.js:1246
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
y @ jquery.min.js:4
c @ jquery.min.js:4”.
In this table in an “afterLoadData” hook a function is called to get a sum of cells in a row and to write the result to a cell for a total value.
To write a result a setDataAtCell method is used:
hot.setDataAtCell(row, column, res, source);
In my case row = 0, column = 32, res = 0, source = undefined.
After a sequence of methods and functions called:
setDataAtCell - ie - validateCell - runHooks - run
we get to fastCall method, where in an “if” statement it was expected to call a certain function with defined arguments:
But instead of another function was called, where the third argument was undefined:
And then the undefined argument was sent to a propToCall method and the error detected.
As I see, the wrong function came from globalBucket, it is a value for “beforeValidate” hook.
In a “run” function a variable “l” (L in lower case) assigned a value from this.globalBucket[“beforeValidate”] and it is that (e,t,r) function:
This error began to appear since version 10.0.0.
With version 9.0.2 there was no error, everything worked.
For me helped a solution to comment a block of code in a (e,t,r) function:
After that no errors appear.
Could you, please, check my way of thinking?
May be, there is another solution?