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

Side by Side Diff: test/mjsunit/property-load-across-eval.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/override-read-only-property.js ('k') | test/mjsunit/property-object-key.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 12 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 // Tests loading of properties across eval calls. 28 // Tests loading of properties across eval calls.
29 29
30 var x = 1; 30 var x = 1;
31 function global_function() { return 'global'; } 31 function global_function() { return 'global'; }
32 const const_uninitialized; 32 const const_uninitialized;
33 const const_initialized = function() { return "const_global"; } 33 const const_initialized = function() { return "const_global"; };
34 34
35 // Test loading across an eval call that does not shadow variables. 35 // Test loading across an eval call that does not shadow variables.
36 function testNoShadowing() { 36 function testNoShadowing() {
37 var y = 2; 37 var y = 2;
38 function local_function() { return 'local'; } 38 function local_function() { return 'local'; }
39 const local_const_uninitialized; 39 const local_const_uninitialized;
40 const local_const_initialized = function() { return "const_local"; } 40 const local_const_initialized = function() { return "const_local"; };
41 function f() { 41 function f() {
42 eval('1'); 42 eval('1');
43 assertEquals(1, x); 43 assertEquals(1, x);
44 try { typeof(asdf); } catch(e) { assertUnreachable(); } 44 try { typeof(asdf); } catch(e) { assertUnreachable(); }
45 assertEquals(2, y); 45 assertEquals(2, y);
46 assertEquals('global', global_function()); 46 assertEquals('global', global_function());
47 assertEquals('local', local_function()); 47 assertEquals('local', local_function());
48 var exception = false; 48 var exception = false;
49 try { 49 try {
50 const_uninitialized(); 50 const_uninitialized();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 assertEquals(4, y); 132 assertEquals(4, y);
133 assertEquals('new_nonglobal', global_function()); 133 assertEquals('new_nonglobal', global_function());
134 assertEquals('new_local', local_function()); 134 assertEquals('new_local', local_function());
135 } 135 }
136 g(); 136 g();
137 } 137 }
138 f(); 138 f();
139 } 139 }
140 140
141 testShadowing(); 141 testShadowing();
OLDNEW
« no previous file with comments | « test/mjsunit/override-read-only-property.js ('k') | test/mjsunit/property-object-key.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698