EvalError.prototype
EvalError.prototype 属性是EvalError原型构造函数.
| EvalError.prototype的属性特性 |
|:----|
| Writable | no |
| Enumerable | no |
| Configurable | no |
描述
EvalError全部实例都继承自EvalError.prototype. 你可以通过prototype去添加方法和属性.
属性
EvalError.prototype.constructor指定创建实例原型的函数.
EvalError.prototype.message错误信息. 从 ECMA-262 开始EvalError提供 message (继承自Error.prototype.message)属性, 详见 SpiderMonkey.
EvalError.prototype.name错误名称.继承自Error.
EvalError.prototype.fileName引发错误的文件路径. 继承自Error.
EvalError.prototype.lineNumber引发错误所在行.继承自 Error.
EvalError.prototype.columnNumber引发错误所在的列. 继承自Error.
方法
虽然EvalError自己的属性方法较少, 但是通过原型链继承了很多有用的方法.
规范
Specification | Status | Comment |
|---|---|---|
ECMAScript 3rd Edition (ECMA-262) | 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 | Defined as NativeError.prototype. |
浏览器兼容性
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) |
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

