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

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

Issue 8888006: Make more JS files beter match the coding standard. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 9 years 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 | « test/mjsunit/regress/regress-798.js ('k') | test/mjsunit/regress/regress-815.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 x = 5; 42 x = 5;
43 assertEquals(7, x); 43 assertEquals(7, x);
44 })(); 44 })();
45 45
46 46
47 // const variables may be declared but never initialized, in which case 47 // const variables may be declared but never initialized, in which case
48 // their value is undefined. 48 // their value is undefined.
49 49
50 (function (sel) { 50 (function (sel) {
51 if (sel == 0) 51 if (sel == 0) {
52 with ({ x: 42 }) { 52 with ({ x: 42 }) {
53 const x; 53 const x;
54 } 54 }
55 else 55 } else {
56 x = 3; 56 x = 3;
57 }
57 x = 5; 58 x = 5;
58 assertTrue(typeof x == 'undefined'); 59 assertTrue(typeof x == 'undefined');
59 })(1); 60 })(1);
60 61
61 62
62 // const variables may be initialized to undefined. 63 // const variables may be initialized to undefined.
63 (function () { 64 (function () {
64 with ({ x: 42 }) { 65 with ({ x: 42 }) {
65 const x = undefined; 66 const x = undefined;
66 } 67 }
67 x = 5; 68 x = 5;
68 assertTrue(typeof x == 'undefined'); 69 assertTrue(typeof x == 'undefined');
69 })(); 70 })();
70 71
71 72
72 // const variables may be accessed in inner scopes like any other variable. 73 // const variables may be accessed in inner scopes like any other variable.
73 (function () { 74 (function () {
74 function bar() { 75 function bar() {
75 assertEquals(7, x); 76 assertEquals(7, x);
76 } 77 }
77 with ({ x: 42 }) { 78 with ({ x: 42 }) {
78 const x = 7; 79 const x = 7;
79 } 80 }
80 x = 5 81 x = 5;
81 bar(); 82 bar();
82 })(); 83 })();
83 84
84 85
85 // const variables may be declared via 'eval' 86 // const variables may be declared via 'eval'
86 (function () { 87 (function () {
87 with ({ x: 42 }) { 88 with ({ x: 42 }) {
88 eval('const x = 7'); 89 eval('const x = 7');
89 } 90 }
90 x = 5; 91 x = 5;
91 assertEquals(7, x); 92 assertEquals(7, x);
92 })(); 93 })();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-798.js ('k') | test/mjsunit/regress/regress-815.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698