Add a test for top-level let not creating a variable that'd show up in |with (global)| scope. No bug, r=jorendorff over IRC

--HG--
extra : rebase_source : 50e9ec9c7a97ec83f597fd07f3db57fc80c604c3
This commit is contained in:
Jeff Walden 2014-06-13 18:44:14 -07:00
parent beb4fd14be
commit 47e30a2677
4 changed files with 27 additions and 0 deletions

View File

@ -340,6 +340,10 @@ function jsTestDriverBrowserInit()
{
properties.version = '1.8';
}
else if (properties.test.match(/^ecma_6\/LexicalEnvironment/))
{
properties.version = '1.8';
}
}
// default to language=type;text/javascript. required for

View File

@ -0,0 +1,5 @@
// NOTE: This only turns on 1.8.5 in shell builds. The browser requires the
// futzing in js/src/tests/browser.js (which only turns on 1.8, the most
// the browser supports).
if (typeof version != 'undefined')
version(185);

View File

@ -0,0 +1,18 @@
// |reftest| fails-if(Function("try{Function('let\x20x=5;');return(1,eval)('let\x20x=3;\\'x\\'\x20in\x20this');}catch(e){return(true);}")()) -- needs bug 589199 fix (top-level let not same as var)
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
let v = "global-v";
function f(v, global)
{
with (global)
return v;
}
assertEq(f("argument-v", this), "argument-v");
if (typeof reportCompare === "function")
reportCompare(true, true);
print("Tests complete");