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

Side by Side Diff: test/mjsunit/regress/regress-3138.js

Issue 1819123002: Remove support for legacy const, part 1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased, deleted one more file Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/regress/regress-186.js ('k') | test/mjsunit/regress/regress-436896.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --legacy-const
6
7 (function f(){ 5 (function f(){
8 assertEquals("function", typeof f); 6 assertEquals("function", typeof f);
9 })(); 7 })();
10 8
11 (function f(){ 9 (function f(){
12 var f; // Variable shadows function name. 10 var f; // Variable shadows function name.
13 assertEquals("undefined", typeof f); 11 assertEquals("undefined", typeof f);
14 })(); 12 })();
15 13
16 (function f(){ 14 (function f(){
17 var f; 15 var f;
18 assertEquals("undefined", typeof f); 16 assertEquals("undefined", typeof f);
19 with ({}); // Force context allocation of both variable and function name. 17 with ({}); // Force context allocation of both variable and function name.
20 })(); 18 })();
21 19
22 assertEquals("undefined", typeof f); 20 assertEquals("undefined", typeof f);
23 21
24 // var initialization is intercepted by with scope. 22 // var initialization is intercepted by with scope.
25 (function() { 23 (function() {
26 var o = { a: 1 }; 24 var o = { a: 1 };
27 with (o) { 25 with (o) {
28 var a = 2; 26 var a = 2;
29 } 27 }
30 assertEquals("undefined", typeof a); 28 assertEquals("undefined", typeof a);
31 assertEquals(2, o.a); 29 assertEquals(2, o.a);
32 })(); 30 })();
33
34 // const initialization is not intercepted by with scope.
35 (function() {
36 var o = { a: 1 };
37 with (o) {
38 const a = 2;
39 }
40 assertEquals(2, a);
41 assertEquals(1, o.a);
42 })();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-186.js ('k') | test/mjsunit/regress/regress-436896.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698