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

Unified Diff: test/mjsunit/strong/object-freeze-property.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/object-delete.js ('k') | test/mjsunit/strong/object-set-prototype.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/strong/object-freeze-property.js
diff --git a/test/mjsunit/strong/object-freeze-property.js b/test/mjsunit/strong/object-freeze-property.js
deleted file mode 100644
index e76af1bfc60f12665c1009c3226bed71f078b85c..0000000000000000000000000000000000000000
--- a/test/mjsunit/strong/object-freeze-property.js
+++ /dev/null
@@ -1,75 +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 --allow-natives-syntax
-
-// TODO(conradw): Track implementation of strong bit for other objects, add
-// tests.
-
-function getSloppyObjects() {
- return [(function(){}), ({})];
-}
-
-function getStrictObjects() {
- "use strict";
- return [(function(){}), ({})];
-}
-
-function getStrongObjects() {
- "use strong";
- // Strong functions can't have properties added to them.
- return [{}];
-}
-
-(function testStrongObjectFreezePropValid() {
- "use strict";
- let strongObjects = getStrongObjects();
-
- for (let o of strongObjects) {
- Object.defineProperty(o, "foo", { configurable: true, writable: true });
- assertDoesNotThrow(
- function() {
- "use strong";
- Object.defineProperty(o, "foo", {configurable: true, writable: false });
- });
- }
-})();
-
-(function testStrongObjectFreezePropInvalid() {
- "use strict";
- let sloppyObjects = getSloppyObjects();
- let strictObjects = getStrictObjects();
- let strongObjects = getStrongObjects();
- let weakObjects = sloppyObjects.concat(strictObjects);
-
- for (let o of weakObjects) {
- Object.defineProperty(o, "foo", { writable: true });
- assertDoesNotThrow(
- function() {
- "use strong";
- Object.defineProperty(o, "foo", { writable: false });
- });
- }
- for (let o of strongObjects) {
- function defProp(o) {
- Object.defineProperty(o, "foo", { writable: false });
- }
- function defProps(o) {
- Object.defineProperties(o, { "foo": { writable: false } });
- }
- function freezeProp(o) {
- Object.freeze(o);
- }
- Object.defineProperty(o, "foo", { writable: true });
- for (let func of [defProp, defProps, freezeProp]) {
- assertThrows(function(){func(o)}, TypeError);
- assertThrows(function(){func(o)}, TypeError);
- assertThrows(function(){func(o)}, TypeError);
- %OptimizeFunctionOnNextCall(func);
- assertThrows(function(){func(o)}, TypeError);
- %DeoptimizeFunction(func);
- assertThrows(function(){func(o)}, TypeError);
- }
- }
-})();
« no previous file with comments | « test/mjsunit/strong/object-delete.js ('k') | test/mjsunit/strong/object-set-prototype.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698