summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch11/11.4/11.4.5/S11.4.5_A1.js
blob: 5be2493ee19f02e2cabf6cb6854234e68f0b1af1 (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
56
57
58
59
60
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * White Space and Line Terminator between "--" and UnaryExpression are allowed
 *
 * @path ch11/11.4/11.4.5/S11.4.5_A1.js
 * @description Checking by using eval
 */

//CHECK#1
if (eval("var x = 1; --\u0009x") !== 0) {
  $ERROR('#1: var x = 1; --\\u0009x; x === 0. Actual: ' + (x));
}

//CHECK#2
if (eval("var x = 1; --\u000Bx") !== 0) {
  $ERROR('#2: var x = 1; --\\u000Bx; x === 0. Actual: ' + (x));  
}

//CHECK#3
if (eval("var x = 1; --\u000Cx") !== 0) {
  $ERROR('#3: var x = 1; --\\u000Cx; x === 0. Actual: ' + (x));
}

//CHECK#4
if (eval("var x = 1; --\u0020x") !== 0) {
  $ERROR('#4: var x = 1; --\\u0020x; x === 0. Actual: ' + (x));
}

//CHECK#5
if (eval("var x = 1; --\u00A0x") !== 0) {
  $ERROR('#5: var x = 1; --\\u00A0x; x === 0. Actual: ' + (x));
}

//CHECK#6
if (eval("var x = 1; --\u000Ax") !== 0) {
  $ERROR('#6: var x = 1; --\\u000Ax; x === 0. Actual: ' + (x));  
}

//CHECK#7
if (eval("var x = 1; --\u000Dx") !== 0) {
  $ERROR('#7: var x = 1; --\\u000Dx; x === 0. Actual: ' + (x));
}

//CHECK#8
if (eval("var x = 1; --\u2028x") !== 0) {
  $ERROR('#8: var x = 1; --\\u2028x; x === 0. Actual: ' + (x));
}

//CHECK#9
if (eval("var x = 1; --\u2029x") !== 0) {
  $ERROR('#9: var x = 1; --\\u2029x; x === 0. Actual: ' + (x));
}

//CHECK#10
if (eval("var x = 1; --\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029x") !== 0) {
  $ERROR('#10: var x = 1; --\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x; x === 0. Actual: ' + (x));
}