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

Unified Diff: test/mjsunit/regress/regress-5669.js

Issue 2610343002: Fix: KeyedStoreGeneric must check for writable array length (Closed)
Patch Set: introduce IsSetSmi(smi, mask) Created 3 years, 11 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/ic/keyed-store-generic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-5669.js
diff --git a/test/mjsunit/regress/regress-5669.js b/test/mjsunit/regress/regress-5669.js
new file mode 100644
index 0000000000000000000000000000000000000000..05f917fa235e92afbb5ef595c037399a1bb0a634
--- /dev/null
+++ b/test/mjsunit/regress/regress-5669.js
@@ -0,0 +1,21 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function f(a, i, v) { a[i] = v; }
+f("make it generic", 0, 0);
+
+var a = new Array();
+Object.defineProperty(a, "length", {value: 3, writable: false});
+print(JSON.stringify(Object.getOwnPropertyDescriptor(a, "length")));
+assertEquals(3, a.length);
+f(a, 3, 3);
+assertFalse(Object.getOwnPropertyDescriptor(a, "length").writable);
+assertEquals(3, a.length);
+
+var b = new Array();
+b.length = 3;
+Object.freeze(b);
+assertEquals(3, b.length);
+f(b, 3, 3);
+assertEquals(3, b.length);
« no previous file with comments | « src/ic/keyed-store-generic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698