From 15ee8e389b18772bdf6cd8469b35dc0552553186 Mon Sep 17 00:00:00 2001 From: "pschwartau%netscape.com" Date: Tue, 17 Dec 2002 01:54:54 +0000 Subject: [PATCH] Adding more comments. --- js/tests/js1_5/Scope/regress-185485.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/tests/js1_5/Scope/regress-185485.js b/js/tests/js1_5/Scope/regress-185485.js index 913d17600a12..fc0118bc1f04 100644 --- a/js/tests/js1_5/Scope/regress-185485.js +++ b/js/tests/js1_5/Scope/regress-185485.js @@ -38,6 +38,23 @@ * SUMMARY: Testing |with (x) {function f() {}}| when |x.f| already exists * See http://bugzilla.mozilla.org/show_bug.cgi?id=185485 * +* The idea is this: if |x| does not already have a property named |f|, +* a |with| statement cannot be used to define one. See, for example, +* +* http://bugzilla.mozilla.org/show_bug.cgi?id=159849#c11 +* http://bugzilla.mozilla.org/show_bug.cgi?id=184107 +* +* +* However, if |x| does have a property |f|, a |with| statement can be +* used to modify the value it contains. This should work even if we use +* a |var| statement, like this: +* +* with (x) {var f = 1;} +* +* or a function statement, like this: +* +* with (x) {function f() {}} +* */ //----------------------------------------------------------------------------- var UBound = 0;