Exceptions thrown in scripting/engine_spidermonkey.cpp need to be handled there

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.1.2
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There are a few cases where a "native" JavaScript function implemented in scripting/engine_spidermonkey.cpp or scripting/sm_db.cpp will throw an exception. An example (currently) is the native_print() function which calls Convertor::toString() which can throw an exception. If this exception isn't caught before control passes out through SpiderMonkey then SpiderMonkey is left in a corrupted state and attempts to use JavaScript after this, even to display the shell's prompt, will generate access violations (segfaults).

      We need to use try/catch around any exceptions that can be thrown within engine_spidermonkey.cpp and return normally (usually with JS_FALSE) so that SpiderMonkey can maintain its state properly.

            Assignee:
            Tad Marshall
            Reporter:
            Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: