Debian Codegraph @

rhino/testsrc/tests/ecma/LexicalConventions/7.1-1.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = '7.1-1.js';
7
8 /**
9 File Name: 7.1-1.js
10 ECMA Section: 7.1 White Space
11 Description: - readability
12 - separate tokens
13 - otherwise should be insignificant
14 - in strings, white space characters are significant
15 - cannot appear within any other kind of token
16
17 white space characters are:
18 unicode name formal name string representation
19 \u0009 tab <TAB> \t
20 \u000B veritical tab <VT> \v
21 \U000C form feed <FF> \f
22 \u0020 space <SP> " "
23
24 Author: [email protected]
25 Date: 11 september 1997
26 */
27
28 var SECTION = "7.1-1";
29 var VERSION = "ECMA_1";
30 startTest();
31 var TITLE = "White Space";
32
33 writeHeaderToLog( SECTION + " "+ TITLE);
34
35 // whitespace between var keyword and identifier
36
37 new TestCase( SECTION, 'var'+'\t'+'MYVAR1=10;MYVAR1', 10, eval('var'+'\t'+'MYVAR1=10;MYVAR1') );
38 new TestCase( SECTION, 'var'+'\f'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\f'+'MYVAR2=10;MYVAR2') );
39 new TestCase( SECTION, 'var'+'\v'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\v'+'MYVAR2=10;MYVAR2') );
40 new TestCase( SECTION, 'var'+'\ '+'MYVAR2=10;MYVAR2', 10, eval('var'+'\ '+'MYVAR2=10;MYVAR2') );
41
42 // use whitespace between tokens object name, dot operator, and object property
43
44 new TestCase( SECTION,
45 "var a = new Array(12345); a\t\v\f .\\u0009\\000B\\u000C\\u0020length",
46 12345,
47 eval("var a = new Array(12345); a\t\v\f .\u0009\u0020\u000C\u000Blength") );
48
49 test();