Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

(2.2.1) Invoking .call() on suspended thread produces wrong error

Last post 09-15-2008, 3:15 PM by Mr. Accident. 0 replies.
Sort Posts: Previous Next
  •  09-15-2008, 3:15 PM 2757

    (2.2.1) Invoking .call() on suspended thread produces wrong error

    When .call() is invoked on a thread in a suspended status, the error that is reported seems to be the last error that occurred, instead of the expected error about using .call() on a suspended thread.

    Running the following code in sq.exe:

    function t_main(a)
    {
      print("Starting thread: " + a + " ");
      suspend(1);
    }

    local t = newthread(t_main);

    t.call("hi!");
    t.call("oops");


    produces the following error:

    AN ERROR HAS OCCURRED [the index doesn't exist]

    If you generate another error, and then invoke t.call() again, you get the same error twice. For example, if you evaluate "foobar" when the slot foobar does not exist, you get the expected "the index 'foobar' doesn't exist" error. However, if you then invoke t.call() again, you get "the index 'foobar' doesn't exist" again, so it seems that .call() on a suspended thread is just repeating the last error produced.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems