You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterating through a matrix with nested loops (i, j), the same method gets called twice with the arguments swapped depending on their relative values REPL. Extract below.
{{#each triangularMatrix as ri, i}}
<tr>
{{#each triangularMatrix as rj, j}}
{{#if i > j}}
<td><input type="number" value={{ri[j]}} on:click='lowerThan(j, i)'></td>
{{elseif i === j}}
<td>1</td>
{{else}}
<td><input type="number" value={{rj[i]}} on:click='lowerThan(i, j)'></td>
{{/if}}
{{/each}}
</tr>
{{/each}}
the lowerThan function is called twice with the arguments swapped:
if i < j, <td ... on:click='lowerThan(i, j) //correct
if i > j, <td ... on:click='lowerThan(j, i) //always fails
In the generated code, a single change handler is registered and the arguments get swapped on the second call (ie the second assertion always fails).
The indices in the view are fine, the problem is only with the event handlers
The text was updated successfully, but these errors were encountered:
hville
changed the title
multiple method calls with different argument sequence get 're-sorted'
multiple method calls with different argument sequence
Apr 11, 2017
I think I know what's going on here — two event handlers are being created, but they're both being given the name click_handler rather than click_handler and click_handler_1. Fairly sure I know how to fix that... on it
Iterating through a matrix with nested loops (i, j), the same method gets called twice with the arguments swapped depending on their relative values REPL. Extract below.
the
lowerThan
function is called twice with the arguments swapped:<td ... on:click='lowerThan(i, j)
//correct<td ... on:click='lowerThan(j, i)
//always failsIn the generated code, a single change handler is registered and the arguments get swapped on the second call (ie the second assertion always fails).
The indices in the view are fine, the problem is only with the event handlers
The text was updated successfully, but these errors were encountered: