Bug 1144802 part 4. Stop returning true from ByteCodeEmitter::needsImplicitThis based on the compileAndGo flag. r=luke

This commit is contained in:
Boris Zbarsky 2015-03-20 00:34:08 -04:00
parent 9c20b629b0
commit 36f4c22c40
4 changed files with 19 additions and 4 deletions

View File

@ -183,3 +183,4 @@ skip-if = buildapp == 'b2g' || e10s
support-files =
bug1096146_embedded.html
[test_offsetxy.html]
[test_eventhandler_scoping.html]

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Test for event handler scoping</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var queryResult;
test(function() {
var d = document.createElement("div");
d.setAttribute("onclick", "queryResult = querySelector('span')");
var s = document.createElement("span");
d.appendChild(s);
d.dispatchEvent(new Event("click"));
assert_equals(queryResult, s, "Should have gotten the right object");
}, "Test for bareword calls in an event handler using the element as 'this'");
</script>

View File

@ -2158,9 +2158,6 @@ BytecodeEmitter::checkSingletonContext()
bool
BytecodeEmitter::needsImplicitThis()
{
if (!script->compileAndGo())
return true;
if (sc->isFunctionBox()) {
if (sc->asFunctionBox()->inWith)
return true;

View File

@ -29,7 +29,7 @@ namespace js {
*
* https://developer.mozilla.org/en-US/docs/SpiderMonkey/Internals/Bytecode
*/
static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 262;
static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 263;
static const uint32_t XDR_BYTECODE_VERSION =
uint32_t(0xb973c0de - XDR_BYTECODE_VERSION_SUBTRAHEND);