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); |
+})(); |