aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/unittests/value-serializer-unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/unittests/value-serializer-unittest.cc')
-rw-r--r--deps/v8/test/unittests/value-serializer-unittest.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/deps/v8/test/unittests/value-serializer-unittest.cc b/deps/v8/test/unittests/value-serializer-unittest.cc
index 77f609052a..2cc0bdc8a6 100644
--- a/deps/v8/test/unittests/value-serializer-unittest.cc
+++ b/deps/v8/test/unittests/value-serializer-unittest.cc
@@ -58,7 +58,7 @@ class ValueSerializerTest : public TestWithIsolate {
isolate_ = reinterpret_cast<i::Isolate*>(isolate());
}
- ~ValueSerializerTest() {
+ ~ValueSerializerTest() override {
// In some cases unhandled scheduled exceptions from current test produce
// that Context::New(isolate()) from next test's constructor returns NULL.
// In order to prevent that, we added destructor which will clear scheduled
@@ -228,7 +228,7 @@ class ValueSerializerTest : public TestWithIsolate {
Local<Script> script =
Script::Compile(deserialization_context_, source).ToLocalChecked();
Local<Value> value = script->Run(deserialization_context_).ToLocalChecked();
- EXPECT_TRUE(value->BooleanValue(deserialization_context_).FromJust());
+ EXPECT_TRUE(value->BooleanValue(isolate()));
}
Local<String> StringFromUtf8(const char* source) {
@@ -1870,6 +1870,22 @@ TEST_F(ValueSerializerTest, DecodeDataView) {
ExpectScriptTrue("Object.getPrototypeOf(result) === DataView.prototype");
}
+TEST_F(ValueSerializerTest, DecodeArrayWithLengthProperty1) {
+ ASSERT_DEATH_IF_SUPPORTED(
+ DecodeTest({0xff, 0x0d, 0x41, 0x03, 0x49, 0x02, 0x49, 0x04,
+ 0x49, 0x06, 0x22, 0x06, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x49, 0x02, 0x24, 0x01, 0x03}),
+ ".*LookupIterator::NOT_FOUND == it.state\\(\\).*");
+}
+
+TEST_F(ValueSerializerTest, DecodeArrayWithLengthProperty2) {
+ ASSERT_DEATH_IF_SUPPORTED(
+ DecodeTest({0xff, 0x0d, 0x41, 0x03, 0x49, 0x02, 0x49, 0x04,
+ 0x49, 0x06, 0x22, 0x06, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x6f, 0x7b, 0x00, 0x24, 0x01, 0x03}),
+ ".*LookupIterator::NOT_FOUND == it.state\\(\\).*");
+}
+
TEST_F(ValueSerializerTest, DecodeInvalidDataView) {
// Byte offset out of range.
InvalidDecodeTest(