Permalink
Browse files

Rephrase AddColorStop doc to say it panics on invalid input

"raised" is a JavaScript term that doesn't apply here.

Instead, document that a Go panic happens, and its type is a pointer
to https://godoc.org/github.com/gopherjs/gopherjs/js#Error.
  • Loading branch information...
dmitshur committed Nov 9, 2017
1 parent 9e184ff commit 97fdc88dd0dec465bb2738547fa309f28845186a
Showing with 2 additions and 2 deletions.
  1. +2 −2 dom.go
View
4 dom.go
@@ -1974,8 +1974,8 @@ type CanvasGradient struct {
}
// AddColorStop adds a new stop, defined by an offset and a color, to the gradient.
// If the offset is not between 0 and 1, an INDEX_SIZE_ERR is raised, if the color
// can't be parsed as a CSS <color>, a SYNTAX_ERR is raised.
// It panics with *js.Error if the offset is not between 0 and 1, or if the color
// can't be parsed as a CSS <color>.
//
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient/addColorStop.
func (cg *CanvasGradient) AddColorStop(offset float64, color string) {

0 comments on commit 97fdc88

Please sign in to comment.