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

Unified Diff: test/mjsunit/object-literal-overwrite.js

Issue 22982005: Fix overwriting order of object literal properties for MATERIALIZED_LITERALs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add crankshaft testcase Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/object-literal-overwrite.js
diff --git a/test/mjsunit/object-literal-overwrite.js b/test/mjsunit/object-literal-overwrite.js
index 5a3584df8ae853da36577b19376ba51692e0e2eb..4d19d35d12bd68c214c57bf29bda471f1864a48a 100644
--- a/test/mjsunit/object-literal-overwrite.js
+++ b/test/mjsunit/object-literal-overwrite.js
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --allow-natives-syntax
+
// Check that constants and computed properties are overwriting each other
// correctly, i.e., the last initializer for any name is stored in the object.
@@ -49,7 +51,7 @@ var foo3 = {
var foo4 = {
bar: function(b){},
- bar: 7,
+ bar: 4,
bar: function(){return 7},
};
@@ -68,6 +70,14 @@ var foo7 = {
15: 7
}
+function foo8(i) {
+ var obj = {
+ x: {a: i},
+ x: 7
+ };
+ return obj.x;
+};
+
assertEquals(7, foo1.bar);
assertEquals(7, foo2.bar);
assertEquals(7, foo3.bar);
@@ -76,6 +86,12 @@ assertEquals(7, foo5[13]);
assertEquals(7, foo6[14.31]);
assertEquals(7, foo7[15]);
+assertEquals(7, foo8(1));
+assertEquals(7, foo8(1));
+%OptimizeFunctionOnNextCall(foo8);
+assertEquals(7, foo8(1));
+
+
// Test for the classic code generator.
function fun(x) {
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698