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

Unified Diff: test/mjsunit/harmony/computed-property-names-classes.js

Issue 961823002: Fix issue with class name TDZ in computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment out strong test Created 5 years, 10 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/computed-property-names.js ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/computed-property-names-classes.js
diff --git a/test/mjsunit/harmony/computed-property-names-classes.js b/test/mjsunit/harmony/computed-property-names-classes.js
index 4e50f8a461a7cd10265792f7258609c500d5a3f7..8a2b778edd73087d71c63cb2094e845e2ac23949 100644
--- a/test/mjsunit/harmony/computed-property-names-classes.js
+++ b/test/mjsunit/harmony/computed-property-names-classes.js
@@ -388,3 +388,45 @@ function assertIteratorResult(value, done, result) {
assertIteratorResult(2, false, iter.next());
assertIteratorResult(undefined, true, iter.next());
})();
+
+
+(function TestExceptionInName() {
+ function MyError() {};
+ function throwMyError() {
+ throw new MyError();
+ }
+ assertThrows(function() {
+ class C {
+ [throwMyError()]() {}
+ }
+ }, MyError);
+ assertThrows(function() {
+ class C {
+ get [throwMyError()]() { return 42; }
+ }
+ }, MyError);
+ assertThrows(function() {
+ class C {
+ set [throwMyError()](_) { }
+ }
+ }, MyError);
+})();
+
+
+(function TestTdzName() {
+ assertThrows(function() {
+ class C {
+ [C]() {}
+ }
+ }, ReferenceError);
+ assertThrows(function() {
+ class C {
+ get [C]() { return 42; }
+ }
+ }, ReferenceError);
+ assertThrows(function() {
+ class C {
+ set [C](_) { }
+ }
+ }, ReferenceError);
+})();
« no previous file with comments | « test/mjsunit/harmony/computed-property-names.js ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698