summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testDeepPropertyShadowing.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/jit-test/tests/basic/testDeepPropertyShadowing.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testDeepPropertyShadowing.js b/js/src/jit-test/tests/basic/testDeepPropertyShadowing.js
new file mode 100644
index 0000000000..65dbf8d5eb
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testDeepPropertyShadowing.js
@@ -0,0 +1,17 @@
+function testDeepPropertyShadowing()
+{
+ function h(node) {
+ var x = 0;
+ while (node) {
+ x++;
+ node = node.parent;
+ }
+ return x;
+ }
+ var tree = {__proto__: {__proto__: {parent: null}}};
+ h(tree);
+ h(tree);
+ tree.parent = {};
+ assertEq(h(tree), 2);
+}
+testDeepPropertyShadowing();