js/src/tests/test262/ch12/12.14/S12.14_A18_T4.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_T4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     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_T4.js
    1.11 + * @description Catching string
    1.12 + */
    1.13 +
    1.14 +// CHECK#1
    1.15 +try{
    1.16 +  throw "exception #1";
    1.17 +}
    1.18 +catch(e){
    1.19 +  if (e!=="exception #1") $ERROR('#1: Exception ==="exception #1". Actual:  Exception ==='+ e  );
    1.20 +}
    1.21 +
    1.22 +// CHECK#2
    1.23 +try{
    1.24 +  throw "exception"+" #1";
    1.25 +}
    1.26 +catch(e){
    1.27 +  if (e!=="exception #1") $ERROR('#2: Exception ==="exception #1". Actual:  Exception ==='+ e  );
    1.28 +}
    1.29 +
    1.30 +// CHECK#3
    1.31 +var b="exception #1";
    1.32 +try{
    1.33 +  throw b;
    1.34 +}
    1.35 +catch(e){
    1.36 +  if (e!=="exception #1") $ERROR('#3: Exception ==="exception #1". Actual:  Exception ==='+ e  );
    1.37 +}
    1.38 +
    1.39 +// CHECK#4
    1.40 +var a="exception";
    1.41 +var b=" #1";
    1.42 +try{
    1.43 +  throw a+b;
    1.44 +}
    1.45 +catch(e){
    1.46 +  if (e!=="exception #1") $ERROR('#4: Exception ==="exception #1". Actual:  Exception ==='+ e  );
    1.47 +}
    1.48 +

mercurial