michmech / xonomy

A schema-driven XML editor for the web.
MIT License
91 stars 32 forks source link

Fix a bug in answer() function inside the Xonomy.editRaw() #3

Closed filodej closed 7 years ago

filodej commented 7 years ago

The following statement is probably not what was intended:

var jsElement=...;
  Xonomy.answer=function(val) {
    ...
    var jsElement=parameter.toJs(val, jsElement);
  }

The parameter.toJs() function is called with undefined as a second argument and not with jsElement closure as intended.

Inside the Xonomy.answer() function the jsElement is declared as a new variable and so the closure value is hidden in the whole function scope.

michmech commented 7 years ago

That was a silly bug, thanks for catching it.