Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 7e67c00aab5e21fff8a93054f654cbbb3b1ef481..8403ad15a8e3150a846606bd5d8dd4857a01649a 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -2839,12 +2839,16 @@ THREADED_TEST(NativeFunctionConstructCall) { |
static const char* exts[1] = { "functiontest" }; |
v8::ExtensionConfiguration config(1, exts); |
LocalContext context(&config); |
- CHECK_EQ(v8::Integer::New(8), |
- Script::Compile(v8_str("(new A()).data"))->Run()); |
- CHECK_EQ(v8::Integer::New(7), |
- Script::Compile(v8_str("(new B()).data"))->Run()); |
- CHECK_EQ(v8::Integer::New(6), |
- Script::Compile(v8_str("(new C()).data"))->Run()); |
+ for (int i = 0; i < 10; i++) { |
+ // Run a few times to ensure that allocation of objects doesn't |
+ // change behavior of a constructor function. |
+ CHECK_EQ(v8::Integer::New(8), |
+ Script::Compile(v8_str("(new A()).data"))->Run()); |
+ CHECK_EQ(v8::Integer::New(7), |
+ Script::Compile(v8_str("(new B()).data"))->Run()); |
+ CHECK_EQ(v8::Integer::New(6), |
+ Script::Compile(v8_str("(new C()).data"))->Run()); |
+ } |
} |