Add test for preserveWrapperCallback

This commit is contained in:
Manish Goregaokar 2015-09-23 21:58:37 +05:30
parent ca31b2d749
commit ed30923156
2 changed files with 28 additions and 0 deletions

View file

@ -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",

View file

@ -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>