@@ -87,7 +87,7 @@ func main() {
87
87
case '\r' :
88
88
toInsert = "\n "
89
89
start := codeArea .Prop ("selectionStart" ).Int ()
90
- code := scope .Get ("code" ).Str ()
90
+ code := scope .Get ("code" ).String ()
91
91
i := strings .LastIndex (code [:start ], "\n " ) + 1
92
92
for i < start {
93
93
c := code [i ]
@@ -104,7 +104,7 @@ func main() {
104
104
105
105
start := codeArea .Prop ("selectionStart" ).Int ()
106
106
end := codeArea .Prop ("selectionEnd" ).Int ()
107
- code := scope .Get ("code" ).Str ()
107
+ code := scope .Get ("code" ).String ()
108
108
scope .Apply (func () {
109
109
scope .Set ("code" , code [:start ]+ toInsert + code [end :])
110
110
})
@@ -120,7 +120,7 @@ func main() {
120
120
scope .Set ("output" , output )
121
121
pkgsToLoad = nil
122
122
123
- file , err := parser .ParseFile (fileSet , "prog.go" , []byte (scope .Get ("code" ).Str ()), parser .ParseComments )
123
+ file , err := parser .ParseFile (fileSet , "prog.go" , []byte (scope .Get ("code" ).String ()), parser .ParseComments )
124
124
if err != nil {
125
125
if list , ok := err .(scanner.ErrorList ); ok {
126
126
for _ , entry := range list {
@@ -208,7 +208,7 @@ func main() {
208
208
}()
209
209
210
210
scope .Set ("format" , func () {
211
- out , err := format .Source ([]byte (scope .Get ("code" ).Str ()))
211
+ out , err := format .Source ([]byte (scope .Get ("code" ).String ()))
212
212
if err != nil {
213
213
scope .Set ("output" , []Line {Line {"type" : "err" , "content" : err .Error ()}})
214
214
return
@@ -222,7 +222,7 @@ func main() {
222
222
req .ResponseType = xhr .ArrayBuffer
223
223
go func () {
224
224
// TODO: Send as binary?
225
- err := req .Send (scope .Get ("code" ).Str ())
225
+ err := req .Send (scope .Get ("code" ).String ())
226
226
if err != nil || req .Status != 200 {
227
227
scope .Apply (func () {
228
228
scope .Set ("output" , []Line {Line {"type" : "err" , "content" : `failed to share snippet` }})
@@ -236,7 +236,7 @@ func main() {
236
236
237
237
location .Hash = "#/" + id
238
238
239
- scope .Set ("shareUrl" , location .Str ())
239
+ scope .Set ("shareUrl" , location .String ())
240
240
scope .Set ("showShareUrl" , true )
241
241
// TODO: Do this better using AngularJS.
242
242
// Perhaps using http://stackoverflow.com/questions/14833326/how-to-set-focus-on-input-field/18295416.
0 commit comments