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

Side by Side Diff: test/mjsunit/strong/class-object-frozen.js

Issue 1316333002: [strong] weak classes can't inherit from strong ones (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: minor comment reorder Created 5 years, 3 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
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/strong/class-weak-extend.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --strong-mode 5 // Flags: --strong-mode
6 6
7 "use strict"; 7 "use strict";
8 8
9 function getClass() { 9 function getClass() {
10 class Foo { 10 class Foo {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 static get bar() { return 0 } 72 static get bar() { return 0 }
73 get bar() { return 0 } 73 get bar() { return 0 }
74 } 74 }
75 return Foo; 75 return Foo;
76 } 76 }
77 77
78 testStrongClass(classFunc); 78 testStrongClass(classFunc);
79 assertDoesNotThrow(function(){addProperty(parent)}); 79 assertDoesNotThrow(function(){addProperty(parent)});
80 assertDoesNotThrow(function(){convertPropertyToData(parent)}); 80 assertDoesNotThrow(function(){convertPropertyToData(parent)});
81 })(); 81 })();
82
83 // Check strong classes don't freeze their children.
84 (function() {
85 let parent = getClassStrong();
86
87 let classFunc = function() {
88 class Foo extends parent {
89 static get bar() { return 0 }
90 get bar() { return 0 }
91 }
92 return Foo;
93 }
94
95 assertThrows(function(){addProperty(parent)}, TypeError);
96 assertThrows(function(){convertPropertyToData(parent)}, TypeError);
97 testWeakClass(classFunc);
98 })();
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/strong/class-weak-extend.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698