Debian Codegraph @

js/src/jit-test/tests/explicit-resource-management/using-throw-cases.js

raw
1 // |jit-test| skip-if: !getBuildConfiguration("explicit-resource-management"); --enable-explicit-resource-management
2
3 load(libdir + "asserts.js");
4
5 function throwsOnNonObjectDisposable() {
6 using a = 1;
7 }
8 assertThrowsInstanceOf(throwsOnNonObjectDisposable, TypeError);
9
10 function throwsOnNonFunctionDispose() {
11 using a = { [Symbol.dispose]: 1 };
12 }
13 assertThrowsInstanceOf(throwsOnNonFunctionDispose, TypeError);