Backout 7887ace84c7d (bug 786801) due to mochitest-other orange.

This commit is contained in:
Ryan VanderMeulen 2012-09-04 22:36:50 -04:00
parent 87e07fd1fd
commit a15ca6b6bd
2 changed files with 16 additions and 25 deletions

View File

@ -22,8 +22,6 @@ Tests for document.all
<a id="id3">E</a>
<a id="id3">F</a>
</div>
<iframe id="subframe" src="data:text/html,<span id='x'></span>"
style="display: none"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">
@ -140,14 +138,6 @@ elementNames.forEach(function (name) {
});
is(hasName.length, 0, "found all names");
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
var subdoc = $("subframe").contentDocument;
is(subdoc.all.x, subdoc.body.firstChild,
"document.all should work in a subdocument");
SimpleTest.finish();
});
// Utility functions
function rC(node) {
node.parentNode.removeChild(node);

View File

@ -2401,13 +2401,16 @@ js_CreateThisForFunction(JSContext *cx, HandleObject callee, bool newType)
* checking whether document.all is defined.
*/
static bool
Detecting(JSContext *cx, JSScript *script, jsbytecode *pc)
Detecting(JSContext *cx, jsbytecode *pc)
{
/* General case: a branch or equality op follows the access. */
JSOp op = JSOp(*pc);
if (js_CodeSpec[op].format & JOF_DETECTING)
return true;
JSAtom *atom;
JSScript *script = cx->stack.currentScript();
jsbytecode *endpc = script->code + script->length;
JS_ASSERT(script->code <= pc && pc < endpc);
@ -2429,7 +2432,7 @@ Detecting(JSContext *cx, JSScript *script, jsbytecode *pc)
* about a local variable named |undefined| shadowing the immutable
* global binding...because, really?
*/
JSAtom *atom = script->getAtom(GET_UINT32_INDEX(pc));
atom = script->getAtom(GET_UINT32_INDEX(pc));
if (atom == cx->runtime->atomState.typeAtoms[JSTYPE_VOID] &&
(pc += js_CodeSpec[op].length) < endpc) {
op = JSOp(*pc);
@ -2447,26 +2450,24 @@ Detecting(JSContext *cx, JSScript *script, jsbytecode *pc)
unsigned
js_InferFlags(JSContext *cx, unsigned defaultFlags)
{
/*
* Use ScriptFrameIter since we intentionally want to look across
* compartment boundaries in the case of cross-compartment property access.
*/
ScriptFrameIter i(cx);
if (i.done())
const JSCodeSpec *cs;
uint32_t format;
unsigned flags = 0;
jsbytecode *pc;
JSScript *script = cx->stack.currentScript(&pc);
if (!script || !pc)
return defaultFlags;
jsbytecode *pc = i.pc();
JSScript *script = i.script();
const JSCodeSpec *cs = &js_CodeSpec[*pc];
uint32_t format = cs->format;
unsigned flags = 0;
cs = &js_CodeSpec[*pc];
format = cs->format;
if (JOF_MODE(format) != JOF_NAME)
flags |= JSRESOLVE_QUALIFIED;
if (format & JOF_SET) {
flags |= JSRESOLVE_ASSIGNING;
} else if (cs->length >= 0) {
pc += cs->length;
if (pc < script->code + script->length && Detecting(cx, script, pc))
if (pc < script->code + script->length && Detecting(cx, pc))
flags |= JSRESOLVE_DETECTING;
}
return flags;
@ -4357,7 +4358,7 @@ js_GetPropertyHelperInline(JSContext *cx, HandleObject obj, HandleObject receive
/* Do not warn about tests like (obj[prop] == undefined). */
if (cx->resolveFlags == RESOLVE_INFER) {
pc += js_CodeSpec[op].length;
if (Detecting(cx, script, pc))
if (Detecting(cx, pc))
return JS_TRUE;
} else if (cx->resolveFlags & JSRESOLVE_DETECTING) {
return JS_TRUE;