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

Side by Side Diff: test/mjsunit/compiler/literals-assignment.js

Issue 316009: Support for object literals in fast compiler.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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/fast-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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 })()"; 62 })()";
63 assertEquals(8, eval(code)); 63 assertEquals(8, eval(code));
64 64
65 65
66 code = "(function() {\ 66 code = "(function() {\
67 var x,y,z;\ 67 var x,y,z;\
68 return x = y = z = 8;\ 68 return x = y = z = 8;\
69 })()"; 69 })()";
70 assertEquals(8, eval(code)); 70 assertEquals(8, eval(code));
71 71
72 // Test object literals.
73 var a, b;
74 a = {x:8};
75 assertEquals(8, a.x);
76
77 b = {x:a, y:"abc"};
78 assertEquals(a, b.x);
79 assertEquals(8, b.x.x);
80 assertEquals("abc", b.y);
81
82 code = "({x:8, y:9}); 10";
83 assertEquals(10, eval(code));
84
85 code = "({x:8, y:9})";
86 assertEquals(9, eval(code+".y"));
87
88 a = {2:8, x:9};
89 assertEquals(8, a[2]);
90 assertEquals(8, a["2"]);
91 assertEquals(9, a["x"]);
92
93 // Test regexp literals.
94
95 a = /abc/;
96
97 assertEquals(/abc/, a);
98
99 code = "/abc/; 8";
100 assertEquals(8, eval(code));
OLDNEW
« no previous file with comments | « src/x64/fast-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698