Upon initial script scanning, SV object is not fully initialized in the JS environment in v1.0.5

Just upgraded to v1.0.5 here. It turns out there is a change in the scripting environment that can cause the first scan to fail.

Steps to reproduce:

  1. Write a script that accesses any non-user-interact methods on the SV object in the global. For example:
    SV.getProject();
    
    function getClientInfo() {
      return {
        name: 'Hello',
        author: 'author',
        versionNumber: 1,
        minEditorVersion: 0,
      };
    }
    
    function main() {}
    
  2. Launch Synthesizer V Pro v1.0.5, the script detection will fail with the following error:

    And the script does not get registered:
    19%20PM
    Note that, if the first line is changed to SV.getPlayback();, Synthesizer V Pro will crash:
  3. Run Scripts/Rescan, the rescan will complete without errors, and the script shows up:
    36%20PM
「いいね!」 2

Hello, we are disabling the host object before main() execution and in the future we also plan to do so for getClientInfo(). This is to keep scripts clear from side effects during (re)scanning.

I see. Then maybe the bug should be that upon rescanning, the host object already exists.