js/src/tests/test262/ch12/12.14/S12.14_A4.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_A4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     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 + * Sanity test for "catch(Indetifier) statement"
     1.9 + *
    1.10 + * @path ch12/12.14/S12.14_A4.js
    1.11 + * @description Checking if deleting an exception fails
    1.12 + * @noStrict
    1.13 + */
    1.14 +
    1.15 +// CHECK#1
    1.16 +try {
    1.17 +  throw "catchme";
    1.18 +  $ERROR('#1.1: throw "catchme" lead to throwing exception');
    1.19 +}
    1.20 +catch (e) {
    1.21 +  if (delete e){
    1.22 +    $ERROR('#1.2: Exception has DontDelete property');
    1.23 +  }
    1.24 +  if (e!=="catchme") {
    1.25 +    $ERROR('#1.3: Exception === "catchme". Actual:  Exception ==='+ e  );
    1.26 +  }
    1.27 +}
    1.28 +
    1.29 +// CHECK#2
    1.30 +try {
    1.31 +  throw "catchme";
    1.32 +  $ERROR('#2.1: throw "catchme" lead to throwing exception');
    1.33 +}
    1.34 +catch(e){}
    1.35 +try{
    1.36 +  e;
    1.37 +  $ERROR('#2.2: Deleting catching exception after ending "catch" block');
    1.38 +}
    1.39 +catch(err){}
    1.40 +

mercurial