1 <script src=
"../../resources/js-test.js"></script>
4 description("This page tests what happens when a getter / setter on the window object conflicts with another property or declared variable");
8 window
.__defineGetter__("x", function() { return "window.x __getter__"; });
9 } catch(e
) { debug(e
); }
11 shouldBe("window.x", "1");
12 shouldBe("typeof window.__lookupGetter__('x')", "'undefined'");
13 shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'x').get", "'undefined'");
18 window
.__defineSetter__("x", function() { debug("window.x __setter__ called"); });
19 } catch(e
) { debug(e
); }
22 shouldBe("window.x", "2");
23 shouldBe("typeof window.__lookupGetter__('x')", "'undefined'");
24 shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'x').get", "'undefined'");
30 window
.__defineGetter__("y", function() { return "window.y __getter__"; });
31 } catch(e
) { debug(e
); }
33 shouldBe("window.y", "'window.y __getter__'");
34 shouldBe("typeof window.__lookupGetter__('y')", "'function'");
35 shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'y').get", "'function'");
40 window
.__defineSetter__("y", function() { "window.y __setter__ called"; });
41 } catch(e
) { debug(e
); }
44 shouldBe("window.y", "'window.y __getter__'");
45 shouldBe("typeof window.__lookupGetter__('y')", "'function'");
46 shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'y').get", "'function'");
51 window
.__defineSetter__("z", function() { "window.z __setter__ called"; });
52 } catch(e
) { debug(e
); }
55 shouldBeUndefined("window.z");
56 shouldBe("typeof window.__lookupSetter__('z')", "'function'");
57 shouldBe("typeof Object.getOwnPropertyDescriptor(window, 'z').set", "'function'");