1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16declare function print(str:any):string; 17 18class MyBoolean extends Boolean { 19 constructor(arg:boolean) { 20 super(arg); // stub path 21 } 22} 23let b = new MyBoolean(true); 24print(b instanceof MyBoolean); 25print(b instanceof Boolean); 26 27 28class MyNumber extends Number { 29 constructor(arg:number) { 30 super(arg); // stub path 31 } 32} 33 34let n = new MyNumber(1) 35print(n instanceof MyNumber); 36print(n instanceof Number); 37 38 39class MyDate extends Date { 40 constructor(arg:any) { 41 super(arg); 42 } 43} 44 45let d = new MyDate(16455456000) 46print(d instanceof MyDate); 47print(d instanceof Date); 48 49 50class MyArray extends Array { 51 constructor(arg:number) { 52 super(arg); 53 } 54} 55 56let a = new MyArray(1); 57print(a instanceof MyArray); 58print(a instanceof Array); 59 60