mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add test for preserveWrapperCallback
This commit is contained in:
parent
ca31b2d749
commit
ed30923156
2 changed files with 28 additions and 0 deletions
|
@ -749,6 +749,12 @@
|
|||
"url": "/_mozilla/mozilla/parentnodes.html"
|
||||
}
|
||||
],
|
||||
"mozilla/preserve_wrapper_callback.html": [
|
||||
{
|
||||
"path": "mozilla/preserve_wrapper_callback.html",
|
||||
"url": "/_mozilla/mozilla/preserve_wrapper_callback.html"
|
||||
}
|
||||
],
|
||||
"mozilla/proxy_setter.html": [
|
||||
{
|
||||
"path": "mozilla/proxy_setter.html",
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="a">
|
||||
<script>
|
||||
test(function() {
|
||||
x = new WeakMap();
|
||||
x.set(document.getElementById("a"), 2);
|
||||
assert_equals(x.get(document.getElementById("a")), 2);
|
||||
}, "WeakMaps with DOM objects");
|
||||
test(function() {
|
||||
x = new WeakMap();
|
||||
y = {};
|
||||
x.set(y, 2);
|
||||
assert_equals(x.get(y), 2);
|
||||
}, "WeakMaps with objects");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue