js/src/tests/test262/ch12/12.14/S12.14_A18_T3.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/test262/ch12/12.14/S12.14_A18_T3.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +// Copyright 2009 the Sputnik authors.  All rights reserved.
     1.5 +// This code is governed by the BSD license found in the LICENSE file.
     1.6 +
     1.7 +/**
     1.8 + * Catching objects with try/catch/finally statement
     1.9 + *
    1.10 + * @path ch12/12.14/S12.14_A18_T3.js
    1.11 + * @description Catching boolean
    1.12 + */
    1.13 +
    1.14 +// CHECK#1
    1.15 +try{
    1.16 +  throw true;
    1.17 +}
    1.18 +catch(e){
    1.19 +  if (e!==true) $ERROR('#1: Exception ===true. Actual:  Exception ==='+ e  );
    1.20 +}
    1.21 +
    1.22 +// CHECK#2
    1.23 +try{
    1.24 +  throw false;
    1.25 +}
    1.26 +catch(e){
    1.27 +  if (e!==false) $ERROR('#2: Exception ===false. Actual:  Exception ==='+ e  );
    1.28 +}
    1.29 +
    1.30 +// CHECK#3
    1.31 +var b=false;
    1.32 +try{
    1.33 +  throw b;
    1.34 +}
    1.35 +catch(e){
    1.36 +  if (e!==false) $ERROR('#3: Exception ===false. Actual:  Exception ==='+ e  );
    1.37 +}
    1.38 +
    1.39 +// CHECK#4
    1.40 +var b=true;
    1.41 +try{
    1.42 +  throw b;
    1.43 +}
    1.44 +catch(e){
    1.45 +  if (e!==true) $ERROR('#4: Exception ===true. Actual:  Exception ==='+ e  );
    1.46 +}
    1.47 +
    1.48 +// CHECK#5
    1.49 +var b=true;
    1.50 +try{
    1.51 +  throw b&&false;
    1.52 +}
    1.53 +catch(e){
    1.54 +  if (e!==false) $ERROR('#5: Exception ===false. Actual:  Exception ==='+ e  );
    1.55 +}
    1.56 +
    1.57 +// CHECK#5
    1.58 +var b=true;
    1.59 +try{
    1.60 +  throw b||false;
    1.61 +}
    1.62 +catch(e){
    1.63 +  if (e!==true) $ERROR('#6: Exception ===true. Actual:  Exception ==='+ e  );
    1.64 +}
    1.65 +

mercurial