RangeError.prototype 属性表示 RangeError 构造函数的原型。
 
RangeError.prototype 属性的属性特性:
writable false
enumerable false
configurable false

描述

所有  RangeError 的实例都继承自 RangeError.prototype ,所以你可以使用这个属性来为所有的实例添加属性或方法。

属性

RangeError.prototype.constructor
指定了创建实例原型的函数
RangeError.prototype.message
错误信息。尽管 ECMA-262 规定了 RangeError 应该拥有一个 message 属性,但在 SpiderMonkey 中,该属性继承自 Error.prototype.message
RangeError.prototype.name
错误名字,继承自 Error
RangeError.prototype.fileName
引起该错误的文件路径,继承自 Error
RangeError.prototype.lineNumber
引起该错误的行号,继承自 Error
RangeError.prototype.columnNumber
引起该错误的列号,继承自 Error
RangeError.prototype.stack
堆栈跟踪记录,继承自 Error

方法

尽管 RangeError 原型对象自身没有包含任何方法,但是 RangeError 实例却通过原型链继承到了一些方法。

Specifications

Specification Status Comment
ECMAScript 3rd Edition (ECMA-262) Standard Initial definition.
ECMAScript 5.1 (ECMA-262)
NativeError.prototype
Standard Defined as NativeError.prototype.
ECMAScript 2015 (6th Edition, ECMA-262)
NativeError.prototype
Standard Defined as NativeError.prototype.
ECMAScript Latest Draft (ECMA-262)
NativeError.prototype
Draft Defined as NativeError.prototype.

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yesnodejs Full support Yes

Legend

Full support  
Full support

See also

文档标签和贡献者

此页面的贡献者: pea3nut
最后编辑者: pea3nut,