mirror of https://github.com/swig/swig
javascript: replace exceptions with SWIG_exit
When building SWIG for Android, there is no support for C++ exceptions. In the cases there is "Illegal state", it seems more like an internal error, so we can replace the throw calls with a debug print and exit immediately. Closes #1858
This commit is contained in:
parent
46e17f1458
commit
4d844a8dc2
|
@ -1575,7 +1575,8 @@ void JSCEmitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Ma
|
|||
Printf(arg, "argv[%d]", i);
|
||||
break;
|
||||
default:
|
||||
throw "Illegal state.";
|
||||
Printf(stdout, "Illegal state.");
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
tm = emitInputTypemap(n, p, wrapper, arg);
|
||||
Delete(arg);
|
||||
|
@ -2212,7 +2213,8 @@ void V8Emitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Mar
|
|||
Printf(arg, "args[%d]", i);
|
||||
break;
|
||||
default:
|
||||
throw "Illegal state.";
|
||||
Printf(stdout, "Illegal state.");
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
tm = emitInputTypemap(n, p, wrapper, arg);
|
||||
|
|
Loading…
Reference in New Issue