1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma/LexicalConventions/7.4.2-3-n.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 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.4.2-3-n.js 1.12 + ECMA Section: 7.4.2 1.13 + 1.14 + Description: 1.15 + The following tokens are ECMAScript keywords and may not be used as 1.16 + identifiers in ECMAScript programs. 1.17 + 1.18 + Syntax 1.19 + 1.20 + Keyword :: one of 1.21 + break for new var 1.22 + continue function return void 1.23 + delete if this while 1.24 + else in typeof with 1.25 + 1.26 + This test verifies that the keyword cannot be used as an identifier. 1.27 + Functioinal tests of the keyword may be found in the section corresponding 1.28 + to the function of the keyword. 1.29 + 1.30 + Author: christine@netscape.com 1.31 + Date: 12 november 1997 1.32 + 1.33 +*/ 1.34 +var SECTION = "7.4.2-3-n"; 1.35 +var VERSION = "ECMA_1"; 1.36 +startTest(); 1.37 +var TITLE = "Keywords"; 1.38 + 1.39 +writeHeaderToLog( SECTION + " "+ TITLE); 1.40 + 1.41 +DESCRIPTION = "var new = true"; 1.42 +EXPECTED = "error"; 1.43 + 1.44 +new TestCase( SECTION, "var new = true", "error", eval("var new = true") ); 1.45 + 1.46 +test();