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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 // Flags: --harmony-computed-property-names --harmony-classes 7 // Flags: --harmony-computed-property-names --harmony-classes
8 8
9 9
10 function ID(x) { 10 function ID(x) {
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 *['constructor']() { 381 *['constructor']() {
382 yield 1; 382 yield 1;
383 yield 2; 383 yield 2;
384 } 384 }
385 } 385 }
386 var iter = new C4().constructor(); 386 var iter = new C4().constructor();
387 assertIteratorResult(1, false, iter.next()); 387 assertIteratorResult(1, false, iter.next());
388 assertIteratorResult(2, false, iter.next()); 388 assertIteratorResult(2, false, iter.next());
389 assertIteratorResult(undefined, true, iter.next()); 389 assertIteratorResult(undefined, true, iter.next());
390 })(); 390 })();
391
392
393 (function TestExceptionInName() {
394 function MyError() {};
395 function throwMyError() {
396 throw new MyError();
397 }
398 assertThrows(function() {
399 class C {
400 [throwMyError()]() {}
401 }
402 }, MyError);
403 assertThrows(function() {
404 class C {
405 get [throwMyError()]() { return 42; }
406 }
407 }, MyError);
408 assertThrows(function() {
409 class C {
410 set [throwMyError()](_) { }
411 }
412 }, MyError);
413 })();
414
415
416 (function TestTdzName() {
417 assertThrows(function() {
418 class C {
419 [C]() {}
420 }
421 }, ReferenceError);
422 assertThrows(function() {
423 class C {
424 get [C]() { return 42; }
425 }
426 }, ReferenceError);
427 assertThrows(function() {
428 class C {
429 set [C](_) { }
430 }
431 }, ReferenceError);
432 })();
OLDNEW
« 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