Subj : Constructor function cleanly failing To : netscape.public.mozilla.jseng From : Matthew Mondor Date : Mon Jan 10 2005 02:07 am Hi all, I was wondering if it is possible for a constructor function for a class to return with an error to notify the script, although not causing script execution to stop? Must object creation with "new" always succeed for a script to continue in ECMAScript? What I tried was making a constructor return JS_FALSE, which causes the script to be aborted. I hence tried returning JS_TRUE after setting JSVAL_VOID and JSVAL_NULL in rval and JS_TRUE, which didn't do the trick... If object constructor should not fail, I should at worse create a useless object until some of its methods/functions is called to make it useful, perhaps... i.e. var map; map = new fileMap(); if (!map.map("fullpath")) ... As opposed to: var map; if (!(map = new fileMap("fullpath"))) ... Thanks. Matt .