Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1081)

Unified Diff: test/mjsunit/regress/regress-1217.js

Issue 8041015: Make the RegExp.prototype object be a RegExp object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated test expectations. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/bugs/bug-1217.js ('k') | test/sputnik/sputnik.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-1217.js
diff --git a/test/mjsunit/bugs/bug-1217.js b/test/mjsunit/regress/regress-1217.js
similarity index 68%
rename from test/mjsunit/bugs/bug-1217.js
rename to test/mjsunit/regress/regress-1217.js
index e6a03a457b7942d8eb2302aee6f061dc6089ac5a..65305498645644acd5118309e5b8b29aff4136b2 100644
--- a/test/mjsunit/bugs/bug-1217.js
+++ b/test/mjsunit/regress/regress-1217.js
@@ -25,8 +25,26 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Check conformity to ECMA-262 15.10.6.
-// The class of RegExp's prototype is RegExp.
+// Check that RegExp.prototype is itself a RegExp object.
-var prototype_class = ({}).toString.call(RegExp.prototype);
-assertEquals("[object RegExp]", prototype_class);
+var proto = RegExp.prototype;
+assertEquals("[object RegExp]", Object.prototype.toString.call(proto));
+
+assertEquals("", proto.source);
+assertEquals(false, proto.global);
+assertEquals(false, proto.multiline);
+assertEquals(false, proto.ignoreCase);
+assertEquals(0, proto.lastIndex);
+
+assertEquals("/(?:)/", proto.toString());
+
+var execResult = proto.exec("argle");
+assertEquals(1, execResult.length);
+assertEquals("", execResult[0]);
+assertEquals("argle", execResult.input);
+assertEquals(0, execResult.index);
+
+assertTrue(proto.test("argle"));
+
+// We disallow re-compiling the RegExp.prototype object.
+assertThrows(function(){ proto.compile("something"); }, TypeError);
« no previous file with comments | « test/mjsunit/bugs/bug-1217.js ('k') | test/sputnik/sputnik.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698