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

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

Issue 159903008: Fix assignment of function name constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: changed test Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 (function f(){
6 assertEquals("function", typeof f);
7 })();
8
9 (function f(){
10 var f; // Variable shadows function name.
11 assertEquals("undefined", typeof f);
12 })();
13
14 (function f(){
15 var f;
16 assertEquals("undefined", typeof f);
17 with ({}); // Force context allocation of both variable and function name.
18 })();
19
20 assertEquals("undefined", typeof f);
21
22 // var initialization is intercepted by with scope.
23 (function() {
24 var o = { a: 1 };
25 with (o) {
26 var a = 2;
27 }
28 assertEquals("undefined", typeof a);
29 assertEquals(2, o.a);
30 })();
31
32 // const initialization is not intercepted by with scope.
33 (function() {
34 var o = { a: 1 };
35 with (o) {
36 const a = 2;
37 }
38 assertEquals(2, a);
39 assertEquals(1, o.a);
40 })();
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698