Login
002-050-catch.s2 at [428464d569]
Login

File s2/unit/002-050-catch.s2 artifact f809931e55 part of check-in 428464d569



assert undefined === catch {1+3};
var ex;
//ex = catch -> ",";
ex = catch -> {","};
//ex = catch{,}
//return ex;

assert 'exception' === typename ex;
assert 'string' === typename ex.script;
assert 'integer' === typename ex.line;
assert 'integer' === typename ex.column;
assert 'integer' === typename ex.code;
//print(typename ex,':',ex);

assert 'CWAL_RC_TYPE' === catch{var x; x.foo}.codeString();
assert 'CWAL_RC_NOT_FOUND' === catch{unknownVar}.codeString();

ex = catch [1,2,3].get(-1);
assert 'exception' === typename ex;
assert 303 === ex.code;
ex;