update keymaster/ subproject ot HEAD
Sync to change in https://github.com/johnjbarton/keymaster
Avoid NPE in Editors.js
Use global eval for inserting scripts
Test case for issue #52, Two buttons appearing when using Last Change
Refactor QPRuntime and improve tracing
Fixes #52, Two buttons appearing when using Last Change.
The bug here was calling addEventListener and staging the addEventListener
call.
If the real load event arrives very early it sets the trigger for fireLoad.
Then the startRuntime() calls fireLoad immediately, before the real
load-event turn. Then the real load event turn fires, creating the
duplicate button.
If the real load event arrives later, the startRuntime() call sets the
fireload trigger, and the real load event causes fireLoad() to run.
The real load event does not run in this case, but I don't know why not.
Also unclear: why does the manual reload cause the real load event to
arrive early? I am not able to repro this with an automated test.
The fix avoids setting the real-load-event handler if we set a staged one.
The fix is correct even if some puzzles remain; once we have synchronous
preprocessing these issues will all go away as we won't have artifical
loads any more.
Correct test case for change in turn numbering