mirror of
https://github.com/robertkrimen/otto.git
synced 2025-12-24 12:58:05 +08:00
10 lines
229 B
Go
10 lines
229 B
Go
package otto
|
|
|
|
func (runtime *_runtime) newErrorObject(message Value) *_object {
|
|
self := runtime.newClassObject("Error")
|
|
if message.IsDefined() {
|
|
self.WriteValue("message", toValue(toString(message)), false)
|
|
}
|
|
return self
|
|
}
|