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

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

Issue 22799021: Fix hidden properties on object with frozen prototype. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/objects.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-2829.js
diff --git a/test/mjsunit/regress/regress-2717.js b/test/mjsunit/regress/regress-2829.js
similarity index 75%
copy from test/mjsunit/regress/regress-2717.js
copy to test/mjsunit/regress/regress-2829.js
index 4f8f7915b1c43e48235e7bd6bcb79f89957223cf..a046ae0395af59fb8f85bf762d1b43ef3e355405 100644
--- a/test/mjsunit/regress/regress-2717.js
+++ b/test/mjsunit/regress/regress-2829.js
@@ -25,27 +25,29 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Test re-initializing existing field which is already being tracked as
-// having double representation.
-(function() {
- function test1(a) {
- return { x: 1.5, x: a };
- };
+// Flags: --harmony-collections
- assertEquals({}, test1({}).x);
-})();
+(function test1() {
+ var wm1 = new WeakMap();
+ wm1.set(Object.prototype, 23);
+ assertTrue(wm1.has(Object.prototype));
+ Object.freeze(Object.prototype);
-// Test initializing new field which follows an existing transition to a
-// map that tracks it as having double representation.
-(function() {
- function test1(a) {
- return { y: a };
- };
+ var wm2 = new WeakMap();
+ var o = {};
+ wm2.set(o, 42);
+ assertEquals(42, wm2.get(o));
+})();
- function test2(a) {
- return { y: a };
- };
+(function test2() {
+ var wm1 = new WeakMap();
+ var o1 = {};
+ wm1.set(o1, 23);
+ assertTrue(wm1.has(o1));
+ Object.freeze(o1);
- assertEquals(1.5, test1(1.5).y);
- assertEquals({}, test2({}).y);
+ var wm2 = new WeakMap();
+ var o2 = Object.create(o1);
+ wm2.set(o2, 42);
+ assertEquals(42, wm2.get(o2));
})();
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698