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

Unified Diff: test/mjsunit/harmony/proxies-integrity.js

Issue 1815773002: Remove runtime flags for Proxy and Reflect (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased 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/harmony/proxies-hash.js ('k') | test/mjsunit/harmony/proxies-is-extensible.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/proxies-integrity.js
diff --git a/test/mjsunit/harmony/proxies-integrity.js b/test/mjsunit/harmony/proxies-integrity.js
deleted file mode 100644
index 9ed6005d6b2ffcbff5d24b57e83dc7605292b4a5..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/proxies-integrity.js
+++ /dev/null
@@ -1,213 +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: --harmony-proxies --harmony-reflect
-
-
-
-function toKey(x) {
- if (typeof x === "symbol") return x;
- return String(x);
-}
-
-
-const noconf = {configurable: false};
-const noconf_nowrite = {configurable: false, writable: false};
-
-
-var symbol = Symbol();
-
-
-var log = [];
-var logger = {};
-var handler = new Proxy({}, logger);
-
-logger.get = function(t, trap, r) {
- return function() {
- log.push([trap, ...arguments]);
- return Reflect[trap](...arguments);
- }
-};
-
-
-(function Seal() {
- var target = [];
- var proxy = new Proxy(target, handler);
- log.length = 0;
-
- target.wurst = 42;
- target[0] = true;
- Object.defineProperty(target, symbol, {get: undefined});
-
- Object.seal(proxy);
- assertEquals(6, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["preventExtensions", target], log[0]);
- assertArrayEquals(
- ["ownKeys", target], log[1]);
- assertArrayEquals(
- ["defineProperty", target, toKey(0), noconf], log[2]);
- assertArrayEquals(
- ["defineProperty", target, toKey("length"), noconf], log[3]);
- assertArrayEquals(
- ["defineProperty", target, toKey("wurst"), noconf], log[4]);
- assertArrayEquals(
- ["defineProperty", target, toKey(symbol), noconf], log[5]);
-})();
-
-
-(function Freeze() {
- var target = [];
- var proxy = new Proxy(target, handler);
- log.length = 0;
-
- target.wurst = 42;
- target[0] = true;
- Object.defineProperty(target, symbol, {get: undefined});
-
- Object.freeze(proxy);
- assertEquals(10, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["preventExtensions", target], log[0]);
- assertArrayEquals(
- ["ownKeys", target], log[1]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(0)], log[2]);
- assertArrayEquals(
- ["defineProperty", target, toKey(0), noconf_nowrite], log[3]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey("length")], log[4]);
- assertArrayEquals(
- ["defineProperty", target, toKey("length"), noconf_nowrite], log[5]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey("wurst")], log[6]);
- assertArrayEquals(
- ["defineProperty", target, toKey("wurst"), noconf_nowrite], log[7]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(symbol)], log[8]);
- assertArrayEquals(
- ["defineProperty", target, toKey(symbol), noconf], log[9]);
-})();
-
-
-(function IsSealed() {
- var target = [];
- var proxy = new Proxy(target, handler);
-
- target.wurst = 42;
- target[0] = true;
- Object.defineProperty(target, symbol, {get: undefined});
-
- // Extensible.
-
- log.length = 0;
-
- Object.isSealed(proxy);
- assertEquals(1, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["isExtensible", target], log[0]);
-
- // Not extensible but not sealed.
-
- log.length = 0;
- Object.preventExtensions(target);
-
- Object.isSealed(proxy);
- assertEquals(3, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["isExtensible", target], log[0]);
- assertArrayEquals(
- ["ownKeys", target], log[1]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(0)], log[2]);
-
- // Sealed.
-
- log.length = 0;
- Object.seal(target);
-
- Object.isSealed(proxy);
- assertEquals(6, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["isExtensible", target], log[0]);
- assertArrayEquals(
- ["ownKeys", target], log[1]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(0)], log[2]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey("length")], log[3]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey("wurst")], log[4]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(symbol)], log[5]);
-})();
-
-
-(function IsFrozen() {
- var target = [];
- var proxy = new Proxy(target, handler);
-
- target.wurst = 42;
- target[0] = true;
- Object.defineProperty(target, symbol, {get: undefined});
-
- // Extensible.
-
- log.length = 0;
-
- Object.isFrozen(proxy);
- assertEquals(1, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["isExtensible", target], log[0]);
-
- // Not extensible but not frozen.
-
- log.length = 0;
- Object.preventExtensions(target);
-
- Object.isFrozen(proxy);
- assertEquals(3, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["isExtensible", target], log[0]);
- assertArrayEquals(
- ["ownKeys", target], log[1]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(0)], log[2]);
-
- // Frozen.
-
- log.length = 0;
- Object.freeze(target);
-
- Object.isFrozen(proxy);
- assertEquals(6, log.length)
- for (var i in log) assertSame(target, log[i][1]);
-
- assertArrayEquals(
- ["isExtensible", target], log[0]);
- assertArrayEquals(
- ["ownKeys", target], log[1]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(0)], log[2]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey("length")], log[3]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey("wurst")], log[4]);
- assertArrayEquals(
- ["getOwnPropertyDescriptor", target, toKey(symbol)], log[5]);
-})();
« no previous file with comments | « test/mjsunit/harmony/proxies-hash.js ('k') | test/mjsunit/harmony/proxies-is-extensible.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698