summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/subclass/builtin-objects/Boolean/regular-subclassing.js
blob: e296c1d4e3b0aa26efa4d7699aa479b83b070698 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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.3.1
description: Subclassing Function
info: |
  19.3.1 The Boolean Constructor

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

class Bln extends Boolean {}

var b1 = new Bln(1);

assert.notSameValue(b1, true, 'b1 is an Boolean object');
assert.sameValue(b1.valueOf(), true);

var b2 = new Bln(0);
assert.notSameValue(b2, false, 'bln is an Boolean object');
assert.sameValue(b2.valueOf(), false);

reportCompare(0, 0);