Only warn for properties that we find on our object, not on properties that we're overriding. bug 365869 and 371174, r=crowder

git-svn-id: svn://10.0.0.236/trunk@221061 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2007-02-28 04:04:15 +00:00
parent 75928b4ecf
commit c76f1731b0

View File

@@ -1773,6 +1773,9 @@ js_CheckRedeclaration(JSContext *cx, JSObject *obj, jsid id, uintN attrs,
}
if (attrs == JSPROP_INITIALIZER) {
/* Allow the new object to override properties. */
if (obj2 != obj)
return JS_TRUE;
report = JSREPORT_WARNING | JSREPORT_STRICT;
} else {
/* We allow redeclaring some non-readonly properties. */