Conceivably the language could be a relatively simple and broad statement along the lines of: "Any type conversions needed for a language binding should occur before an API function is called, if a type conversion fails for any reason the call should be aborted"

However this doesn't address the issue of callbacks that throw exceptions, or returns incorrect types leading to an exception on type conversion, etc, etc

--Oliver

On Apr 21, 2009, at 11:46 PM, Cameron McCormack wrote:

Hi Garrett.

Cameron McCormack:
We could certainly add similar language for the Java language binding section too, though I think there’s less scope for those conversions to
throw exceptions (maybe ones like OutOfMemoryException).

Garrett Smith:
I'm not sure, but I think you might have meant OutOfMemoryError.

Yep that’s what I meant.

All Errors are unchecked in Java.

Indeed.

Java also has unchecked exceptions, though unlike Errors there are
exceptions that are checked at compile-time (checked exceptions).

All of the dom exceptions are runtime exceptions. (TYPE_MISMATCH_ERR,
for example)

Yeah, I’ve made those exceptions extend RuntimeException.

Which languages don't throw unchecked exceptions?

C, for example, which doesn’t have exceptions at all.

Until (unless) somebody writes up a Web IDL language binding for
Objective-C, the best you can hope for is for Obj-C implementations to
do something “sensible”.

Like throw a runtime error?

Perhaps; I don’t know Obj-C so I couldn’t say.

--
Cameron McCormack ≝ http://mcc.id.au/



Reply via email to