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

Unified Diff: test/mjsunit/harmony/class-fields-proxy.js

Issue 2330473002: Class fields, part 3 (backends)
Patch Set: bytecode test Created 4 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 side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/harmony/class-fields-proxy.js
diff --git a/test/mjsunit/harmony/class-fields-proxy.js b/test/mjsunit/harmony/class-fields-proxy.js
new file mode 100644
index 0000000000000000000000000000000000000000..b4e8be3addeac63d2f40017e440d333da91348e5
--- /dev/null
+++ b/test/mjsunit/harmony/class-fields-proxy.js
@@ -0,0 +1,54 @@
+// Copyright 2016 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-class-fields
+
+{
+ let effects = [];
+ let handler = {
+ defineProperty(){
+ effects.push(0);
+ return true;
+ },
+ get(){
+ throw 'called get';
+ },
+ set(){
+ throw 'called set';
+ }
+ };
+
+ class Base {
+ constructor(){
+ return new Proxy({}, handler);
+ }
+ }
+
+ class Derived extends Base {
+ a = 0;
+ }
+
+ new Derived;
+ assertArrayEquals([0], effects);
+}
+
+{
+ let handler = {
+ defineProperty(){
+ throw new Error;
+ }
+ };
+
+ class Base {
+ constructor(){
+ return new Proxy({}, handler);
+ }
+ }
+
+ class Derived extends Base {
+ a = 0;
+ }
+
+ assertThrows(() => new Derived);
+}
« no previous file with comments | « test/mjsunit/harmony/class-fields-function-name-inference.js ('k') | test/mjsunit/harmony/class-fields-scoping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698