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