1 // -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // Any copyright is dedicated to the Public Domain.
3 // http://creativecommons.org/licenses/publicdomain/
5 function testRegExp(b) {
6 var a = deserialize(serialize(b));
7 assertEq(a === b, false);
8 assertEq(Object.getPrototypeOf(a), RegExp.prototype);
9 assertEq(Object.prototype.toString.call(a), "[object RegExp]");
11 throw new Error("cloned RegExp should have no enumerable properties");
13 assertEq(a.source, b.source);
14 assertEq(a.global, b.global);
15 assertEq(a.ignoreCase, b.ignoreCase);
16 assertEq(a.multiline, b.multiline);
17 assertEq(a.sticky, b.sticky);
18 assertEq("expando" in a, false);
21 testRegExp(RegExp(""));
23 testRegExp(/^(.*)$/gimy);
24 testRegExp(RegExp.prototype);
32 reportCompare(0, 0, 'ok');