code: func JSEscape(w io.Writer, b []byte) {
  	last := 0
  	for i := 0; i < len(b); i++ {
  		c := b[i]
  
  		if !jsIsSpecial(rune(c)) {
  			// fast path: nothing to do
  			continue
  		}
  		w.Write(b[last:i])
  
  		if c < utf8.RuneSelf {
  			// Quotes, slashes and angle brackets get quoted.
  			// Control characters get written as \u00XX.
  			switch c {
  			case '\\':
  				w.Write(jsBackslash)
  			case '\'':
  				w.Write(jsApos)
  			case '"':
  				w.Write(jsQuot)
  			case '<':
  				w.Write(jsLt)
  			case '>':
  				w.Write(jsGt)
  			default:
  				w.Write(jsLowUni)
  				t, b := c>>4, c&0x0f
  				w.Write(hex[t : t+1])
  				w.Write(hex[b : b+1])
  			}
  		} else {
  			// Unicode rune.
  			r, size := utf8.DecodeRune(b[i:])
  			if unicode.IsPrint(r) {
  				w.Write(b[i : i+size])
  			} else {
  				fmt.Fprintf(w, "\\u%04X", r)
  			}
  			i += size - 1
  		}
  		last = i + 1
  	}
  	w.Write(b[last:])
  }
docs: // JSEscape writes to w the escaped JavaScript equivalent of the plain text data b.