1 Star 0 Fork 0

zfd81 / otto

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
type_error.go 697 Bytes
一键复制 编辑 原始数据 按行查看 历史
deoxxa 提交于 2015-11-28 09:27 . make call stacks aware of native functions
package otto
func (rt *_runtime) newErrorObject(name string, message Value, stackFramesToPop int) *_object {
self := rt.newClassObject("Error")
if message.IsDefined() {
msg := message.string()
self.defineProperty("message", toValue_string(msg), 0111, false)
self.value = newError(rt, name, stackFramesToPop, msg)
} else {
self.value = newError(rt, name, stackFramesToPop)
}
self.defineOwnProperty("stack", _property{
value: _propertyGetSet{
rt.newNativeFunction("get", "internal", 0, func(FunctionCall) Value {
return toValue_string(self.value.(_error).formatWithStack())
}),
&_nilGetSetObject,
},
mode: modeConfigureMask & modeOnMask,
}, false)
return self
}
Go
1
https://gitee.com/zfd81/otto.git
git@gitee.com:zfd81/otto.git
zfd81
otto
otto
v1.0.6

搜索帮助