michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 7.1-1.js michael@0: ECMA Section: 7.1 White Space michael@0: Description: - readability michael@0: - separate tokens michael@0: - otherwise should be insignificant michael@0: - in strings, white space characters are significant michael@0: - cannot appear within any other kind of token michael@0: michael@0: white space characters are: michael@0: unicode name formal name string representation michael@0: \u0009 tab \t michael@0: \u000B veritical tab \v michael@0: \U000C form feed \f michael@0: \u0020 space " " michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 11 september 1997 michael@0: */ michael@0: michael@0: var SECTION = "7.1-1"; michael@0: var VERSION = "ECMA_1"; michael@0: startTest(); michael@0: var TITLE = "White Space"; michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: // whitespace between var keyword and identifier michael@0: michael@0: new TestCase( SECTION, 'var'+'\t'+'MYVAR1=10;MYVAR1', 10, eval('var'+'\t'+'MYVAR1=10;MYVAR1') ); michael@0: new TestCase( SECTION, 'var'+'\f'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\f'+'MYVAR2=10;MYVAR2') ); michael@0: new TestCase( SECTION, 'var'+'\v'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\v'+'MYVAR2=10;MYVAR2') ); michael@0: new TestCase( SECTION, 'var'+'\ '+'MYVAR2=10;MYVAR2', 10, eval('var'+'\ '+'MYVAR2=10;MYVAR2') ); michael@0: michael@0: // use whitespace between tokens object name, dot operator, and object property michael@0: michael@0: new TestCase( SECTION, michael@0: "var a = new Array(12345); a\t\v\f .\\u0009\\000B\\u000C\\u0020length", michael@0: 12345, michael@0: eval("var a = new Array(12345); a\t\v\f .\u0009\u0020\u000C\u000Blength") ); michael@0: michael@0: test();