From d58e780504bdba6c5897c48428fd984c5b5f96fe Mon Sep 17 00:00:00 2001 From: Chris Dickinson Date: Tue, 5 May 2015 13:48:55 -0700 Subject: deps: update v8 to 4.3.61.21 * @indutny's SealHandleScope patch (484bebc38319fc7c622478037922ad73b2edcbf9) has been cherry picked onto the top of V8 to make it compile. * There's some test breakage in contextify. * This was merged at the request of the TC. PR-URL: https://github.com/iojs/io.js/pull/1632 --- deps/v8/test/cctest/test-conversions.cc | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'deps/v8/test/cctest/test-conversions.cc') diff --git a/deps/v8/test/cctest/test-conversions.cc b/deps/v8/test/cctest/test-conversions.cc index b7881edcf6..789425119d 100644 --- a/deps/v8/test/cctest/test-conversions.cc +++ b/deps/v8/test/cctest/test-conversions.cc @@ -362,3 +362,58 @@ TEST(BitField64) { CHECK(x == MiddleBits::encode(3)); CHECK_EQ(3, MiddleBits::decode(x)); } + + +static void CheckNonArrayIndex(bool expected, const char* chars) { + auto isolate = CcTest::i_isolate(); + auto string = isolate->factory()->NewStringFromAsciiChecked(chars); + CHECK_EQ(expected, IsNonArrayIndexInteger(*string)); +} + + +TEST(NonArrayIndexParsing) { + auto isolate = CcTest::i_isolate(); + HandleScope scope(isolate); + CheckNonArrayIndex(false, ""); + CheckNonArrayIndex(false, "-"); + CheckNonArrayIndex(false, "0"); + CheckNonArrayIndex(false, "01"); + CheckNonArrayIndex(false, "-01"); + CheckNonArrayIndex(false, "4294967295"); + CheckNonArrayIndex(false, "429496.7295"); + CheckNonArrayIndex(false, "43s3"); + CheckNonArrayIndex(true, "-0"); + CheckNonArrayIndex(true, "-1"); + CheckNonArrayIndex(true, "4294967296"); + CheckNonArrayIndex(true, "-4294967296"); + CheckNonArrayIndex( + true, + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296"); + CheckNonArrayIndex( + true, + "-429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296" + "429496729642949672964294967296429496729642949672964294967296"); +} -- cgit v1.2.1