js/src/tests/ecma_2/extensions/constructor-001.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma_2/extensions/constructor-001.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     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:          RegExp/constructor-001.js
    1.12 + *  ECMA Section:       15.7.3.3
    1.13 + *  Description:        Based on ECMA 2 Draft 7 February 1999
    1.14 + *
    1.15 + *  Author:             christine@netscape.com
    1.16 + *  Date:               19 February 1999
    1.17 + */
    1.18 +var SECTION = "RegExp/constructor-001";
    1.19 +var VERSION = "ECMA_2";
    1.20 +var TITLE   = "new RegExp()";
    1.21 +
    1.22 +startTest();
    1.23 +
    1.24 +/*
    1.25 + * for each test case, verify:
    1.26 + * - verify that [[Class]] property is RegExp
    1.27 + * - prototype property should be set to RegExp.prototype
    1.28 + * - source is set to the empty string
    1.29 + * - global property is set to false
    1.30 + * - ignoreCase property is set to false
    1.31 + * - multiline property is set to false
    1.32 + * - lastIndex property is set to 0
    1.33 + */
    1.34 +
    1.35 +RegExp.prototype.getClassProperty = Object.prototype.toString;
    1.36 +var re = new RegExp();
    1.37 +
    1.38 +AddTestCase(
    1.39 +  "new RegExp().__proto__",
    1.40 +  RegExp.prototype,
    1.41 +  re.__proto__
    1.42 +  );
    1.43 +
    1.44 +test()

mercurial