js/src/tests/ecma/LexicalConventions/7.1-2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/LexicalConventions/7.1-2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 +   File Name:          7.1-2.js
    1.12 +   ECMA Section:       7.1 White Space
    1.13 +   Description:        - readability
    1.14 +   - separate tokens
    1.15 +   - otherwise should be insignificant
    1.16 +   - in strings, white space characters are significant
    1.17 +   - cannot appear within any other kind of token
    1.18 +
    1.19 +   white space characters are:
    1.20 +   unicode     name            formal name     string representation
    1.21 +   \u0009      tab             <TAB>           \t
    1.22 +   \u000B      veritical tab   <VT>            ??
    1.23 +   \U000C      form feed       <FF>            \f
    1.24 +   \u0020      space           <SP>            " "
    1.25 +
    1.26 +   Author:             christine@netscape.com
    1.27 +   Date:               11 september 1997
    1.28 +*/
    1.29 +
    1.30 +var SECTION = "7.1-2";
    1.31 +var VERSION = "ECMA_1";
    1.32 +startTest();
    1.33 +var TITLE   = "White Space";
    1.34 +
    1.35 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.36 +
    1.37 +new TestCase( SECTION,    "'var'+'\u000B'+'MYVAR1=10;MYVAR1'",   10, eval('var'+'\u000B'+'MYVAR1=10;MYVAR1') );
    1.38 +new TestCase( SECTION,    "'var'+'\u0009'+'MYVAR2=10;MYVAR2'",   10, eval('var'+'\u0009'+'MYVAR2=10;MYVAR2') );
    1.39 +new TestCase( SECTION,    "'var'+'\u000C'+'MYVAR3=10;MYVAR3'",   10, eval('var'+'\u000C'+'MYVAR3=10;MYVAR3') );
    1.40 +new TestCase( SECTION,    "'var'+'\u0020'+'MYVAR4=10;MYVAR4'",   10, eval('var'+'\u0020'+'MYVAR4=10;MYVAR4') );
    1.41 +
    1.42 +test();

mercurial