libtrycatch  Check-in [0a653c9820]

Overview
Comment:Demonstrate rethrow in the example
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0a653c9820708b41d673576ab1dd8a46eee297c8a45087c3a0c77fa98013045c
User & Date: js 2017-01-22 15:55:48
Context
2017-01-22
15:56
Properly declare dependencies in the Makefile Leaf check-in: 34a019c3c5 user: js tags: trunk
15:55
Demonstrate rethrow in the example check-in: 0a653c9820 user: js tags: trunk
15:55
Never issue a warning if the exception is unused check-in: d6132d89e1 user: js tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to example.c.

35
36
37
38
39
40
41






42
43
44
45
46
47
48
49
50
51
52
		puts("try1");

		try {
			puts("try2");
		} catch (ex) {
			puts("this should not be called");
		}







		throw(5);
	} catch (ex) {
		printf("caught %d (should be 5)\n", ex);
	}

	try {
		throw(1);
		return 1;
	} catch (ex) {
	}







>
>
>
>
>
>



|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
		puts("try1");

		try {
			puts("try2");
		} catch (ex) {
			puts("this should not be called");
		}

		try {
			throw(7);
		} catch (ex) {
			rethrow;
		}

		throw(5);
	} catch (ex) {
		printf("caught %d (should be 7)\n", ex);
	}

	try {
		throw(1);
		return 1;
	} catch (ex) {
	}