37 } else { |
38 } else { |
38 fail("expected SecurityException, got " + e); |
39 fail("expected SecurityException, got " + e); |
39 } |
40 } |
40 } |
41 } |
41 |
42 |
|
43 try { |
|
44 Java.extend(Java.type('java.lang.ClassLoader')); |
|
45 fail("should have thrown SecurityException"); |
|
46 } catch (e) { |
|
47 if (e instanceof java.lang.SecurityException) { |
|
48 print(e); |
|
49 } else { |
|
50 fail("expected SecurityException, got " + e); |
|
51 } |
|
52 } |
|
53 |
|
54 try { |
|
55 Java.extend(Java.type("javax.management.loading.MLet")); |
|
56 fail("should have thrown SecurityException"); |
|
57 } catch (e) { |
|
58 if (e instanceof java.lang.SecurityException) { |
|
59 print(e); |
|
60 } else { |
|
61 fail("expected SecurityException, got " + e); |
|
62 } |
|
63 } |