summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch12/12.9/S12.9_A2.js
blob: 177205dbb412d5b460f41cee656b3e1e64c468b4 (plain)
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
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * LineTerminator between return and Identifier_opt yields return without Identifier_opt
 *
 * @path ch12/12.9/S12.9_A2.js
 * @description Checking by using eval, inserting LineTerminator between return and Variable
 */

//CHECK#1
try{
  if (eval("(function(){var x = 1;return\u000Ax;var y=2;})()") !== undefined) {
    $ERROR("#1: LineTerminator(U-000A) between return and Identifier_opt yields return without Identifier_opt");	  
  }
} catch(e){
  $ERROR('#1: eval("(function(){var x = 1;return\\u000Ax;var y=2;})()") does not lead to throwing exception');
}




//CHECK#2
try{
  if (eval("(function(){var x = 1;return\u000Dx;var y=2;})()") !== undefined) {
    $ERROR("#1: LineTerminator(U-000D) between return and Identifier_opt yields return without Identifier_opt");    
  }
} catch(e){
  $ERROR('#2: eval("(function(){var x = 1;return\\u000Dx;var y=2;})()") does not lead to throwing exception');
}




//CHECK#3
try{
  if (eval("(function(){var x = 1;return\u2028x;var y=2;})()") !== undefined) {
    $ERROR("#1: LineTerminator(U-2028) between return and Identifier_opt yields return without Identifier_opt");    
  }
} catch(e){
  $ERROR('#3: eval("(function(){var x = 1;return\\u2028x;var y=2;})()") does not lead to throwing exception');
}




//CHECK#4
try{
  if (eval("(function(){var x =1;return\u2029x;var y=2;})()") !== undefined) {
    $ERROR("#1: LineTerminator(U-2029) between return and Identifier_opt yields return without Identifier_opt");    
  }
} catch(e){
  $ERROR('#4: eval("(function(){var x =1;return\\u2029x;var y=2;})()") does not lead to throwing exception');
}