Skip to content

Commit a84f6ee

Browse files
Deleplacegopherbot
authored andcommitted
tour: call 'done' callback after Run, on message Kind 'system'
To restore the button Run and hide the button Kill (in A Tour of Go, not in the main Playground), writeInterceptor is expecting a call of Kind 'end'. However, on compilation error the last call emitted has Kind 'system'. Fixes golang/go#50921 Change-Id: I698331e477e79fef368550d5976b5b2fc0b03e83 Reviewed-on: https://go-review.googlesource.com/c/website/+/478415 Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Eno Compton <[email protected]> Auto-Submit: Carlos Amedee <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent f6415c7 commit a84f6ee

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

_content/js/playground.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ here's a skeleton implementation of a playground transport.
2424
// The output callback is called multiple times, and each time it is
2525
// passed an object of this form.
2626
var write = {
27-
Kind: 'string', // 'start', 'stdout', 'stderr', 'end'
27+
Kind: 'string', // 'start', 'stdout', 'stderr', 'end', 'system'
2828
Body: 'string' // content of write or end status message
2929
}
3030
3131
// The first call must be of Kind 'start' with no body.
3232
// Subsequent calls may be of Kind 'stdout' or 'stderr'
3333
// and must have a non-null Body string.
3434
// The final call should be of Kind 'end' with an optional
35-
// Body string, signifying a failure ("killed", for example).
35+
// Body string, signifying a failure ("killed", for example),
36+
// or be of Kind 'system'.
3637
3738
// The output callback must be of this form.
3839
// See PlaygroundOutput (below) for an implementation.

_content/tour/static/js/services.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ factory('run', ['$window', 'editor',
4545
}
4646
}
4747
writer(write);
48-
if (write.Kind == 'end') done();
48+
if (write.Kind == 'end' || write.Kind == 'system') done();
4949
};
5050
};
5151
return function(code, output, options, done) {

0 commit comments

Comments
 (0)