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 16/* 17 * @tc.name:error_helper 18 * @tc.desc:test error 19 * @tc.type: FUNC 20 */ 21 22const v34 = [2147483648,238049746,1260900180,371215732,1655235460,-65536,-94405277,536870888,-1073741824,-65537]; 23class C37 { 24} 25const v40 = new C37(); 26try { 27v40.constructor(v40, v34, C37, v40); 28} catch(e45) { 29const v46 = e45.toString; 30const v50 = v46.call(v34); 31print(v50); 32} 33 34// Be sure to put this case at the end because this case will change prototype of error constructor 35try { 36 0(); 37} catch (err) { 38 err.constructor.prototype.name = 123456789; 39} 40try { 41 0(); 42} catch (error) {} 43 44Object.defineProperty(ReferenceError.prototype, "constructor", { 45 value: "x" 46}) 47try { 48 print(x13) 49} catch (e) { 50 print(e.name) 51} 52