diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js')
-rw-r--r-- | dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js b/dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js new file mode 100644 index 0000000000..b457fd2d2f --- /dev/null +++ b/dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js @@ -0,0 +1,62 @@ +function* getTestContent() { + yield "hello"; + yield 2 + 3; + yield 12; + yield null; + yield "complex" + "string"; + yield new Object(); + yield new Date(1306113544); + yield [1, 2, 3, 4, 5]; + let obj = new Object(); + obj.foo = 3; + obj.bar = "hi"; + obj.baz = new Date(1306113544); + obj.boo = obj; + yield obj; + + let recursiveobj = new Object(); + recursiveobj.a = recursiveobj; + recursiveobj.foo = new Object(); + recursiveobj.foo.bar = "bar"; + recursiveobj.foo.backref = recursiveobj; + recursiveobj.foo.baz = 84; + recursiveobj.foo.backref2 = recursiveobj; + recursiveobj.bar = new Object(); + recursiveobj.bar.foo = "foo"; + recursiveobj.bar.backref = recursiveobj; + recursiveobj.bar.baz = new Date(1306113544); + recursiveobj.bar.backref2 = recursiveobj; + recursiveobj.expando = recursiveobj; + yield recursiveobj; + + obj = new Object(); + obj.expando1 = 1; + obj.foo = new Object(); + obj.foo.bar = 2; + obj.bar = new Object(); + obj.bar.foo = obj.foo; + obj.expando = new Object(); + obj.expando.expando = new Object(); + obj.expando.expando.obj = obj; + obj.expando2 = 4; + obj.baz = obj.expando.expando; + obj.blah = obj.bar; + obj.foo.baz = obj.blah; + obj.foo.blah = obj.blah; + yield obj; + + let diamond = new Object(); + obj = new Object(); + obj.foo = "foo"; + obj.bar = 92; + obj.backref = diamond; + diamond.ref1 = obj; + diamond.ref2 = obj; + yield diamond; + + let doubleref = new Object(); + obj = new Object(); + doubleref.ref1 = obj; + doubleref.ref2 = obj; + yield doubleref; +} |