summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/subclass/builtin-objects/Function/regular-subclassing.js
blob: d68fb28206d5726cabcd0425a6f896ea17efac4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 19.2.1
description: Subclassing Function
info: |
  19.2.1 The Function Constructor

  ...

  The Function constructor is designed to be subclassable. It may be used as the
  value of an extends clause of a class definition.
  ...
---*/

class Fn extends Function {}

var fn = new Fn('a', 'return a * 2');

assert.sameValue(fn(42), 84);

reportCompare(0, 0);