Index: test/unittests/value-serializer-unittest.cc |
diff --git a/test/unittests/value-serializer-unittest.cc b/test/unittests/value-serializer-unittest.cc |
index ec2df077f57021ad0e12d6f4c7c68519bbcc12dd..06d93a53c831b05e0adfede6de544a70c1e9e25c 100644 |
--- a/test/unittests/value-serializer-unittest.cc |
+++ b/test/unittests/value-serializer-unittest.cc |
@@ -1501,6 +1501,16 @@ TEST_F(ValueSerializerTest, DecodeValueObjects) { |
EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof String")); |
EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b")); |
}); |
+ |
+ // String object containing a Latin-1 string. |
+ DecodeTest({0xff, 0x0c, 0x73, 0x22, 0x06, 'Q', 'u', 0xe9, 'b', 'e', 'c'}, |
+ [this](Local<Value> value) { |
+ EXPECT_TRUE(EvaluateScriptForResultBool( |
+ "Object.getPrototypeOf(result) === String.prototype")); |
+ EXPECT_TRUE(EvaluateScriptForResultBool( |
+ "result.valueOf() === 'Qu\\xe9bec'")); |
+ EXPECT_TRUE(EvaluateScriptForResultBool("result.length === 6")); |
+ }); |
} |
TEST_F(ValueSerializerTest, RoundTripRegExp) { |
@@ -1560,6 +1570,15 @@ TEST_F(ValueSerializerTest, DecodeRegExp) { |
EXPECT_TRUE(EvaluateScriptForResultBool("result.a instanceof RegExp")); |
EXPECT_TRUE(EvaluateScriptForResultBool("result.a === result.b")); |
}); |
+ |
+ // RegExp containing a Latin-1 string. |
+ DecodeTest( |
+ {0xff, 0x0c, 0x52, 0x22, 0x06, 'Q', 'u', 0xe9, 'b', 'e', 'c', 0x02}, |
+ [this](Local<Value> value) { |
+ ASSERT_TRUE(value->IsRegExp()); |
+ EXPECT_TRUE(EvaluateScriptForResultBool( |
+ "result.toString() === '/Qu\\xe9bec/i'")); |
+ }); |
} |
TEST_F(ValueSerializerTest, RoundTripMap) { |