| Index: test/mjsunit/harmony/new-target.js
|
| diff --git a/test/mjsunit/harmony/new-target.js b/test/mjsunit/harmony/new-target.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..24258e104e7fbf048ca0cebce36cf15cda2d87af
|
| --- /dev/null
|
| +++ b/test/mjsunit/harmony/new-target.js
|
| @@ -0,0 +1,26 @@
|
| +// Copyright 2014 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-classes --harmony-new-target
|
| +
|
| +'use strict';
|
| +
|
| +(function TestBasics() {
|
| + var calls = 0;
|
| + class Base {}
|
| + class Derived extends Base {
|
| + constructor(expected) {
|
| + super();
|
| + assertEquals(expected, new.target);
|
| + calls++;
|
| + }
|
| + }
|
| + new Derived(Derived);
|
| + assertEquals(1, calls);
|
| +
|
| + class Derived2 extends Derived {}
|
| + calls = 0;
|
| + new Derived2(Derived2);
|
| + assertEquals(1, calls);
|
| +})();
|
|
|