Author: [email protected]
Date: Tue Jul 14 02:31:48 2009
New Revision: 2454

Modified:
    branches/bleeding_edge/test/cctest/test-api.cc

Log:
Add regression test case for http://crbug.com/16276. Crashes
in both debug and release mode before r2435, but not after.
Review URL: http://codereview.chromium.org/155491

Modified: branches/bleeding_edge/test/cctest/test-api.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-api.cc      (original)
+++ branches/bleeding_edge/test/cctest/test-api.cc      Tue Jul 14 02:31:48 2009
@@ -7081,3 +7081,21 @@
    obj_clone->Set(foo_string, v8::String::New("Hello"));
    CHECK(!obj->Get(foo_string)->IsUndefined());
  }
+
+
+// Regression test for http://crbug.com/16276.
+THREADED_TEST(Regress16276) {
+  v8::HandleScope scope;
+  LocalContext context;
+  // Force the IC in f to be a dictionary load IC.
+  CompileRun("function f(obj) { return obj.x; }\n"
+             "var obj = { x: { foo: 42 }, y: 87 };\n"
+             "var x = obj.x;\n"
+             "delete obj.y;\n"
+             "for (var i = 0; i < 5; i++) f(obj);");
+  // Detach the global object to make 'this' refer directly to the
+  // global object (not the proxy), and make sure that the dictionary
+  // load IC doesn't mess up loading directly from the global object.
+  context->DetachGlobal();
+  CHECK_EQ(42, CompileRun("f(this).foo")->Int32Value());
+}

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to