summaryrefslogtreecommitdiff
path: root/test/language/line-terminators/S7.3_A1.1_T1.js
blob: bd0454128a47bfa84b655f40e79e1ecb9c12dedc (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
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: LINE FEED (U+000A) may occur between any two tokens
es5id: 7.3_A1.1_T1
description: Insert LINE FEED (\u000A and \n) between tokens of var x=1
---*/

// CHECK#1
eval("\u000Avar\u000Ax\u000A=\u000A1\u000A");
if (x !== 1) {
  $ERROR('#1: eval("\\u000Avar\\u000Ax\\u000A=\\u000A1\\u000A"); x === 1. Actual: ' + (x));
}

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

//CHECK#3
eval("\nvar\nx\n=\n1\n");
if (x !== 1) {
  $ERROR('#3: eval("\\nvar\\nx\\n=\\n1\\n"); x === 1. Actual: ' + (x));
}

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

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