try_catch_toplevel_expected.js 972 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original: try_catch.js
function blah() {
  try {
    try {
      var a = 10;
    } catch (e) {}

    try {
      console.log(a);
    } catch (e) {}
  } catch (e) {}

  try {
    label: for (var i = 0; i < 100; i++) {
      var b = 0;

      while (b < 10) {
        console.log(b);
        b += 2;
        continue label;
      }
    }
  } catch (e) {}
}

try {
  blah();
} catch (e) {}

try {
  blah();
} catch (e) {}

try {
  (function () {
    1;
    1;
  })();
} catch (e) {}

try {
  if (true) {
    2;
    2;
  } else {
    3;
    3;
  }
} catch (e) {}

let a = 0;

try {
  switch (a) {
    case 1:
      1;
  }
} catch (e) {}

try {
  with (Math) {
    cos(PI);
  }
} catch (e) {}

let module = function () {
  try {
    return new WebAssembly.Module(builder.toBuffer());
  } catch (e) {}
}();