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
authorJeff Walden <jwalden@mit.edu>
Fri, 13 Jun 2014 18:44:14 -0700
changeset 188741 ac74a1815c6676bfdc338e0241ea086fcfb0cb22
parent 188740 14950c172444160c21691193fddd2599b05ce097
child 188742 6bcbb6d0915d102eeb66a7302ee275df57227b4b
push id44898
push userjwalden@mit.edu
push dateSat, 14 Jun 2014 03:48:32 +0000
treeherdermozilla-inbound@6bcbb6d0915d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
js/src/tests/browser.js
js/src/tests/ecma_6/LexicalEnvironment/browser.js
js/src/tests/ecma_6/LexicalEnvironment/shell.js
js/src/tests/ecma_6/LexicalEnvironment/with-global-ignores-global-let-variables.js
--- a/js/src/tests/browser.js
+++ b/js/src/tests/browser.js
@@ -335,16 +335,20 @@ function jsTestDriverBrowserInit()
     else if (properties.test.match(/^js1_7/))
     {
       properties.version = '1.7';
     }
     else if (properties.test.match(/^js1_8/))
     {
       properties.version = '1.8';
     }
+    else if (properties.test.match(/^ecma_6\/LexicalEnvironment/))
+    {
+      properties.version = '1.8';
+    }
   }
 
   // default to language=type;text/javascript. required for
   // reftest style manifests.
   if (!properties.language)
   {
     properties.language = 'type';
     properties.mimetype = 'text/javascript';
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/LexicalEnvironment/shell.js
@@ -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);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/LexicalEnvironment/with-global-ignores-global-let-variables.js
@@ -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");