js/src/tests/test262/ch12/12.9/S12.9_A2.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * LineTerminator between return and Identifier_opt yields return without Identifier_opt
     6  *
     7  * @path ch12/12.9/S12.9_A2.js
     8  * @description Checking by using eval, inserting LineTerminator between return and Variable
     9  */
    11 //CHECK#1
    12 try{
    13   if (eval("(function(){var x = 1;return\u000Ax;var y=2;})()") !== undefined) {
    14     $ERROR("#1: LineTerminator(U-000A) between return and Identifier_opt yields return without Identifier_opt");	  
    15   }
    16 } catch(e){
    17   $ERROR('#1: eval("(function(){var x = 1;return\\u000Ax;var y=2;})()") does not lead to throwing exception');
    18 }
    23 //CHECK#2
    24 try{
    25   if (eval("(function(){var x = 1;return\u000Dx;var y=2;})()") !== undefined) {
    26     $ERROR("#1: LineTerminator(U-000D) between return and Identifier_opt yields return without Identifier_opt");    
    27   }
    28 } catch(e){
    29   $ERROR('#2: eval("(function(){var x = 1;return\\u000Dx;var y=2;})()") does not lead to throwing exception');
    30 }
    35 //CHECK#3
    36 try{
    37   if (eval("(function(){var x = 1;return\u2028x;var y=2;})()") !== undefined) {
    38     $ERROR("#1: LineTerminator(U-2028) between return and Identifier_opt yields return without Identifier_opt");    
    39   }
    40 } catch(e){
    41   $ERROR('#3: eval("(function(){var x = 1;return\\u2028x;var y=2;})()") does not lead to throwing exception');
    42 }
    47 //CHECK#4
    48 try{
    49   if (eval("(function(){var x =1;return\u2029x;var y=2;})()") !== undefined) {
    50     $ERROR("#1: LineTerminator(U-2029) between return and Identifier_opt yields return without Identifier_opt");    
    51   }
    52 } catch(e){
    53   $ERROR('#4: eval("(function(){var x =1;return\\u2029x;var y=2;})()") does not lead to throwing exception');
    54 }

mercurial