Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: test/mjsunit/regress/regress-crbug-135008.js

Issue 10698032: Fix lazy parsing heuristics to respect outer scope. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-135008.js
diff --git a/test/mjsunit/compiler/regress-toint32.js b/test/mjsunit/regress/regress-crbug-135008.js
similarity index 83%
copy from test/mjsunit/compiler/regress-toint32.js
copy to test/mjsunit/regress/regress-crbug-135008.js
index 54c2f76dd75a3006dd0b040f0ce31c28f0a7ec29..2be396e8055a916b1f7c7370ff32ff0d40eea762 100644
--- a/test/mjsunit/compiler/regress-toint32.js
+++ b/test/mjsunit/regress/regress-crbug-135008.js
@@ -25,21 +25,21 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax --noenable-sse3
+// Filler long enough to trigger lazy parsing.
+var filler = "//" + new Array(1024).join('x');
-var a = new Int32Array(1);
-var G = 0x80000000;
+var scope = { x:23 };
-function f(x) {
- var v = x;
- v = v + 1;
- a[0] = v;
- v = v - 1;
- return v;
-}
-
-assertEquals(G, f(G));
-assertEquals(G, f(G));
-%OptimizeFunctionOnNextCall(f);
-assertEquals(G, f(G));
+with(scope) {
+ eval(
+ "scope.f = (function outer() {" +
+ " function inner() {" +
+ " return x;" +
+ " }" +
+ " return inner;" +
+ "})();" +
+ filler
+ );
+};
+assertSame(23, scope.f());
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698