summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/latin1/structured-clone.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/latin1/structured-clone.js')
-rw-r--r--js/src/jit-test/tests/latin1/structured-clone.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/latin1/structured-clone.js b/js/src/jit-test/tests/latin1/structured-clone.js
new file mode 100644
index 000000000..d7ad815a5
--- /dev/null
+++ b/js/src/jit-test/tests/latin1/structured-clone.js
@@ -0,0 +1,19 @@
+// Latin1
+var s = deserialize(serialize("foo123\u00EE"));
+assertEq(s, "foo123\u00EE");
+assertEq(isLatin1(s), true);
+
+var o = deserialize(serialize(new String("foo\u00EE")));
+assertEq(typeof o, "object");
+assertEq(o.valueOf(), "foo\u00EE");
+assertEq(isLatin1(o.valueOf()), true);
+
+// TwoByte
+var s = deserialize(serialize("foo123\u00FF\u1234"));
+assertEq(s, "foo123\u00FF\u1234");
+assertEq(isLatin1(s), false);
+
+var o = deserialize(serialize(new String("foo\uEEEE")));
+assertEq(typeof o, "object");
+assertEq(o.valueOf(), "foo\uEEEE");
+assertEq(isLatin1(o.valueOf()), false);