зеркало из https://github.com/mozilla/gecko-dev.git
Bug 558541 - Simplify some code in js_SetPropertyHelper to make it more understandable. r=jorendorff
This commit is contained in:
Родитель
20b6ad5c8b
Коммит
1296402931
|
@ -5034,16 +5034,15 @@ js_SetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, uintN defineHow,
|
||||||
if (!sprop->writable()) {
|
if (!sprop->writable()) {
|
||||||
JS_UNLOCK_SCOPE(cx, scope);
|
JS_UNLOCK_SCOPE(cx, scope);
|
||||||
|
|
||||||
/* Strict mode: report a read-only strict warning. */
|
|
||||||
if (JS_HAS_STRICT_OPTION(cx))
|
|
||||||
return ReportReadOnly(cx, id, JSREPORT_STRICT | JSREPORT_WARNING);
|
|
||||||
|
|
||||||
/* Just return true per ECMA if not in strict mode. */
|
|
||||||
PCMETER((defineHow & JSDNP_CACHE_RESULT) && JS_PROPERTY_CACHE(cx).rofills++);
|
PCMETER((defineHow & JSDNP_CACHE_RESULT) && JS_PROPERTY_CACHE(cx).rofills++);
|
||||||
if (defineHow & JSDNP_CACHE_RESULT) {
|
if (defineHow & JSDNP_CACHE_RESULT) {
|
||||||
JS_ASSERT_NOT_ON_TRACE(cx);
|
JS_ASSERT_NOT_ON_TRACE(cx);
|
||||||
TRACE_2(SetPropHit, JS_NO_PROP_CACHE_FILL, sprop);
|
TRACE_2(SetPropHit, JS_NO_PROP_CACHE_FILL, sprop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Warn in strict mode, otherwise do nothing. */
|
||||||
|
if (JS_HAS_STRICT_OPTION(cx))
|
||||||
|
return ReportReadOnly(cx, id, JSREPORT_STRICT | JSREPORT_WARNING);
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
|
|
||||||
#ifdef JS_TRACER
|
#ifdef JS_TRACER
|
||||||
|
|
Загрузка…
Ссылка в новой задаче