mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
[INFER] Fix merge botch, only warn once for each script accessing undefined properties in contexts with the strict option set, bug 662393.
This commit is contained in:
parent
702ed9a730
commit
dab2052347
@ -946,7 +946,7 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
||||
js_profiling_chrome_str :
|
||||
js_profiling_content_str);
|
||||
PRBool useMethodJITAlways = Preferences::GetBool(js_methodjit_always_str);
|
||||
PRBool useTypeInference = !chromeWindow && nsContentUtils::GetBoolPref(js_typeinfer_str);
|
||||
PRBool useTypeInference = !chromeWindow && Preferences::GetBool(js_typeinfer_str);
|
||||
nsCOMPtr<nsIXULRuntime> xr = do_GetService(XULRUNTIME_SERVICE_CONTRACTID);
|
||||
if (xr) {
|
||||
PRBool safeMode = PR_FALSE;
|
||||
|
@ -5788,6 +5788,7 @@ js_GetPropertyHelperWithShapeInline(JSContext *cx, JSObject *obj, JSObject *rece
|
||||
flags = JSREPORT_ERROR;
|
||||
} else {
|
||||
if (!cx->hasStrictOption() ||
|
||||
cx->stack.currentScript()->warnedAboutUndefinedProp ||
|
||||
(op != JSOP_GETPROP && op != JSOP_GETELEM) ||
|
||||
js_CurrentPCIsInImacro(cx)) {
|
||||
return JS_TRUE;
|
||||
@ -5811,6 +5812,7 @@ js_GetPropertyHelperWithShapeInline(JSContext *cx, JSObject *obj, JSObject *rece
|
||||
}
|
||||
|
||||
flags = JSREPORT_WARNING | JSREPORT_STRICT;
|
||||
cx->stack.currentScript()->warnedAboutUndefinedProp = true;
|
||||
}
|
||||
|
||||
/* Ok, bad undefined property reference: whine about it. */
|
||||
|
@ -460,6 +460,9 @@ struct JSScript {
|
||||
bool warnedAboutTwoArgumentEval:1; /* have warned about use of
|
||||
obsolete eval(s, o) in
|
||||
this script */
|
||||
bool warnedAboutUndefinedProp:1; /* have warned about uses of
|
||||
undefined properties in this
|
||||
script */
|
||||
bool hasSingletons:1; /* script has singleton objects */
|
||||
bool isActiveEval:1; /* script came from eval(), and is still active */
|
||||
bool isCachedEval:1; /* script came from eval(), and is in eval cache */
|
||||
|
Loading…
Reference in New Issue
Block a user