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: LexicalConventions/regexp-literals-001.js michael@0: * ECMA Section: 7.8.5 michael@0: * Description: michael@0: * michael@0: * michael@0: * Author: christine@netscape.com michael@0: * Date: 11 August 1998 michael@0: */ michael@0: var SECTION = "LexicalConventions/regexp-literals-001.js"; michael@0: var VERSION = "ECMA_2"; michael@0: var TITLE = "Regular Expression Literals"; michael@0: michael@0: startTest(); michael@0: michael@0: // Regular Expression Literals may not be empty; // should be regarded michael@0: // as a comment, not a RegExp literal. michael@0: michael@0: s = //; michael@0: michael@0: "passed"; michael@0: michael@0: AddTestCase( michael@0: "// should be a comment, not a regular expression literal", michael@0: "passed", michael@0: String(s)); michael@0: michael@0: AddTestCase( michael@0: "// typeof object should be type of object declared on following line", michael@0: "passed", michael@0: (typeof s) == "string" ? "passed" : "failed" ); michael@0: michael@0: AddTestCase( michael@0: "// should not return an object of the type RegExp", michael@0: "passed", michael@0: (typeof s == "object") ? "failed" : "passed" ); michael@0: michael@0: test();