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

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

Issue 1773653002: [strong] Remove all remainders of strong mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oversight Created 4 years, 9 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 | « test/mjsunit/strong/class-literals.js ('k') | test/mjsunit/strong/classes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/strong/class-object-frozen.js
diff --git a/test/mjsunit/strong/class-object-frozen.js b/test/mjsunit/strong/class-object-frozen.js
deleted file mode 100644
index 2c442c0d5168258986211dd297b7ac05907b459f..0000000000000000000000000000000000000000
--- a/test/mjsunit/strong/class-object-frozen.js
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2015 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.
-
-// Flags: --strong-mode
-
-"use strict";
-
-function getClass() {
- class Foo {
- static get bar() { return 0 }
- get bar() { return 0 }
- }
- return Foo;
-}
-
-function getClassExpr() {
- return (class { static get bar() { return 0 } get bar() { return 0 } });
-}
-
-function getClassStrong() {
- "use strong";
- class Foo {
- static get bar() { return 0 }
- get bar() { return 0 }
- }
- return Foo;
-}
-
-function getClassExprStrong() {
- "use strong";
- return (class { static get bar() { return 0 } get bar() { return 0 } });
-}
-
-function addProperty(o) {
- o.baz = 1;
-}
-
-function convertPropertyToData(o) {
- assertTrue(o.hasOwnProperty("bar"));
- Object.defineProperty(o, "bar", { value: 1 });
-}
-
-function testWeakClass(classFunc) {
- assertDoesNotThrow(function(){addProperty(classFunc())});
- assertDoesNotThrow(function(){addProperty(classFunc().prototype)});
- assertDoesNotThrow(function(){convertPropertyToData(classFunc())});
- assertDoesNotThrow(function(){convertPropertyToData(classFunc().prototype)});
-}
-
-function testStrongClass(classFunc) {
- assertThrows(function(){addProperty(classFunc())}, TypeError);
- assertThrows(function(){addProperty(classFunc().prototype)}, TypeError);
- assertThrows(function(){convertPropertyToData(classFunc())}, TypeError);
- assertThrows(function(){convertPropertyToData(classFunc().prototype)},
- TypeError);
-}
-
-testWeakClass(getClass);
-testWeakClass(getClassExpr);
-
-testStrongClass(getClassStrong);
-testStrongClass(getClassExprStrong);
-
-// Check strong classes don't freeze their parents.
-(function() {
- let parent = getClass();
-
- let classFunc = function() {
- "use strong";
- class Foo extends parent {
- static get bar() { return 0 }
- get bar() { return 0 }
- }
- return Foo;
- }
-
- testStrongClass(classFunc);
- assertDoesNotThrow(function(){addProperty(parent)});
- assertDoesNotThrow(function(){convertPropertyToData(parent)});
-})();
-
-// Check strong classes don't freeze their children.
-(function() {
- let parent = getClassStrong();
-
- let classFunc = function() {
- class Foo extends parent {
- static get bar() { return 0 }
- get bar() { return 0 }
- }
- return Foo;
- }
-
- assertThrows(function(){addProperty(parent)}, TypeError);
- assertThrows(function(){convertPropertyToData(parent)}, TypeError);
- testWeakClass(classFunc);
-})();
« no previous file with comments | « test/mjsunit/strong/class-literals.js ('k') | test/mjsunit/strong/classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698