1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_2/LexicalConventions/regexp-literals-001.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 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: LexicalConventions/regexp-literals-001.js 1.12 + * ECMA Section: 7.8.5 1.13 + * Description: 1.14 + * 1.15 + * 1.16 + * Author: christine@netscape.com 1.17 + * Date: 11 August 1998 1.18 + */ 1.19 +var SECTION = "LexicalConventions/regexp-literals-001.js"; 1.20 +var VERSION = "ECMA_2"; 1.21 +var TITLE = "Regular Expression Literals"; 1.22 + 1.23 +startTest(); 1.24 + 1.25 +// Regular Expression Literals may not be empty; // should be regarded 1.26 +// as a comment, not a RegExp literal. 1.27 + 1.28 +s = //; 1.29 + 1.30 + "passed"; 1.31 + 1.32 +AddTestCase( 1.33 + "// should be a comment, not a regular expression literal", 1.34 + "passed", 1.35 + String(s)); 1.36 + 1.37 +AddTestCase( 1.38 + "// typeof object should be type of object declared on following line", 1.39 + "passed", 1.40 + (typeof s) == "string" ? "passed" : "failed" ); 1.41 + 1.42 +AddTestCase( 1.43 + "// should not return an object of the type RegExp", 1.44 + "passed", 1.45 + (typeof s == "object") ? "failed" : "passed" ); 1.46 + 1.47 +test();