Index: test/mjsunit/regress/regress-2980.js |
diff --git a/test/cctest/test-cpu.cc b/test/mjsunit/regress/regress-2980.js |
similarity index 68% |
copy from test/cctest/test-cpu.cc |
copy to test/mjsunit/regress/regress-2980.js |
index 06966c68c86296e510edb8899f4d7deb0343f108..071a73353a79aec11091cc97c117710d2fb36414 100644 |
--- a/test/cctest/test-cpu.cc |
+++ b/test/mjsunit/regress/regress-2980.js |
@@ -25,31 +25,40 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#include "v8.h" |
- |
-#include "cctest.h" |
-#include "cpu.h" |
- |
-using namespace v8::internal; |
+function test(expected, holder) { |
+ assertEquals(expected, holder.property); |
+} |
-TEST(FeatureImplications) { |
- // Test for features implied by other features. |
- CPU cpu; |
+var holder = {} |
+holder.__proto__ = null; |
+holder.property = "foo"; |
+delete holder.property; |
+test(undefined, holder); |
+test(undefined, holder); |
+test(undefined, holder); |
+holder.property = "bar"; |
+test("bar", holder); |
+test("bar", holder); |
- // ia32 and x64 features |
- CHECK(!cpu.has_sse() || cpu.has_mmx()); |
- CHECK(!cpu.has_sse2() || cpu.has_sse()); |
- CHECK(!cpu.has_sse3() || cpu.has_sse2()); |
- CHECK(!cpu.has_ssse3() || cpu.has_sse3()); |
- CHECK(!cpu.has_sse41() || cpu.has_sse3()); |
- CHECK(!cpu.has_sse42() || cpu.has_sse41()); |
+// Now the same thing with a nontrivial prototype chain. |
- // arm features |
- CHECK(!cpu.has_vfp3_d32() || cpu.has_vfp3()); |
+function test2(expected, holder) { |
+ assertEquals(expected, holder.prop2); |
} |
+var holder2 = {} |
+holder2.prop2 = "foo"; |
+holder2.__proto__ = null; |
+function Receiver() {} |
+Receiver.prototype = holder2; |
-TEST(NumberOfProcessorsOnline) { |
- CHECK_GT(CPU::NumberOfProcessorsOnline(), 0); |
-} |
+var rec2 = new Receiver(); |
+delete holder2.prop2; |
+ |
+test2(undefined, rec2); |
+test2(undefined, rec2); |
+test2(undefined, rec2); |
+holder2.prop2 = "bar"; |
+test2("bar", rec2); |
+test2("bar", rec2); |