mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
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:
parent
beb4fd14be
commit
47e30a2677
@ -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
|
||||
|
0
js/src/tests/ecma_6/LexicalEnvironment/browser.js
Normal file
0
js/src/tests/ecma_6/LexicalEnvironment/browser.js
Normal file
5
js/src/tests/ecma_6/LexicalEnvironment/shell.js
Normal file
5
js/src/tests/ecma_6/LexicalEnvironment/shell.js
Normal 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);
|
@ -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");
|
Loading…
Reference in New Issue
Block a user