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

Side by Side Diff: test/mjsunit/regress/regress-3462.js

Issue 417793002: Fix issue with setters and their holders in accessors.cc (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleanup SetFunctionPrototype as well Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/es7/object-observe.js ('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
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5
6 function TestFunctionPrototypeSetter() {
7 var f = function() {};
8 var o = {__proto__: f};
9 o.prototype = 42;
10 assertEquals(42, o.prototype);
11 assertTrue(o.hasOwnProperty('prototype'));
12 }
13 TestFunctionPrototypeSetter();
14
15
16 function TestFunctionPrototypeSetterOnValue() {
17 var f = function() {};
18 var fp = f.prototype;
19 Number.prototype.__proto__ = f;
20 var n = 42;
21 var o = {};
22 n.prototype = o;
23 assertEquals(fp, n.prototype);
24 assertEquals(fp, f.prototype);
25 assertFalse(Number.prototype.hasOwnProperty('prototype'));
26 }
27 TestFunctionPrototypeSetterOnValue();
28
29
30 function TestArrayLengthSetter() {
31 var a = [1];
32 var o = {__proto__: a};
33 o.length = 2;
34 assertEquals(2, o.length);
35 assertEquals(1, a.length);
36 assertTrue(o.hasOwnProperty('length'));
37 }
38 TestArrayLengthSetter();
39
40
41 function TestArrayLengthSetterOnValue() {
42 Number.prototype.__proto__ = [1];
43 var n = 42;
44 n.length = 2;
45 assertEquals(1, n.length);
46 assertFalse(Number.prototype.hasOwnProperty('length'));
47 }
48 TestArrayLengthSetterOnValue();
OLDNEW
« no previous file with comments | « test/mjsunit/es7/object-observe.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698