首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

TypeError.prototype

TypeError.prototype属性表示TypeError构造函数的原型。

描述

所有TypeError实例都继承自TypeError.prototype。您可以使用原型向所有实例添加属性或方法

属性

TypeError.prototype.constructor指定创建实例原型的函数。

TypeError.prototype.message错误信息。虽然ECMA-262规定TypeError应该提供自己的message财产,在SpiderMonkey中,它继承Error.prototype.message

TypeError.prototype.name错误名称。继承Error

TypeError.prototype.fileName引发此错误的文件路径。继承Error

TypeError.prototype.lineNumber引发此错误的文件中的行号。继承Error

TypeError.prototype.columnNumber引发此错误的列号。继承Error

TypeError.prototype.stack堆栈跟踪。继承Error

方法

尽管TypeError不包含任何自己的方法, 但TypeError的实例通过原型链继承了一些方法。

规范

Specification

Status

Comment

ECMAScript 3rd Edition (ECMA-262)The definition of 'NativeError.prototype' in that specification.

Standard

Initial definition

ECMAScript 5.1 (ECMA-262)The definition of 'NativeError.prototype' in that specification.

Standard

Defined as NativeError.prototype.

ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'NativeError.prototype' in that specification.

Standard

Defined as NativeError.prototype.

ECMAScript Latest Draft (ECMA-262)The definition of 'NativeError.prototype' in that specification.

Living Standard

?

浏览器兼容性

Feature

Chrome

Edge

Firefox

Internet Explorer

Opera

Safari

Basic Support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

Feature

Android

Chrome for Android

Edge mobile

Firefox for Android

IE mobile

Opera Android

iOS Safari

Basic Support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com