summaryrefslogtreecommitdiff
path: root/libdeno/libdeno_test.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-02-01 23:26:33 -0500
committerRyan Dahl <ry@tinyclouds.org>2019-02-02 16:46:31 -0500
commitdf54db77625e0e51b1d016fb8a1f89f7458a0584 (patch)
tree2d77f856e005cbad499708b68e59fa63a9e57a5a /libdeno/libdeno_test.cc
parent1770a77bca32a852892292406407ae52a0e29992 (diff)
Fix v8_str internalize bug
Diffstat (limited to 'libdeno/libdeno_test.cc')
-rw-r--r--libdeno/libdeno_test.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libdeno/libdeno_test.cc b/libdeno/libdeno_test.cc
index 282a124ba..b14b4758b 100644
--- a/libdeno/libdeno_test.cc
+++ b/libdeno/libdeno_test.cc
@@ -280,3 +280,12 @@ TEST(LibDenoTest, Shared) {
EXPECT_EQ(s[2], 44);
deno_delete(d);
}
+
+TEST(LibDenoTest, Utf8Bug) {
+ Deno* d = deno_new(deno_config{0, empty, empty, nullptr});
+ // The following is a valid UTF-8 javascript which just defines a string
+ // literal. We had a bug where libdeno would choke on this.
+ deno_execute(d, nullptr, "a.js", "x = \"\xEF\xBF\xBD\"");
+ EXPECT_EQ(nullptr, deno_last_exception(d));
+ deno_delete(d);
+}