go.tools/playground: provide script-safe option for playground
go.tools/playground: provide script-safe option for playground

This change allows code to be sent safely to a partially sandboxed playground using the Native Client environment.

Execution of non-Go code is blocked when the RunScripts is false to prevent inclusion of code that might escape by virtue of being under a different runtime environment.

Two options for communicating whether to prevent non-Go code were considered: as has been done here and alternatively, using a message field. The latter was not chosen to close that as an attack option.

Another will be follow that adds a -nacl flag to the present command to allow sandboxing of playground code in presentations.

See discussion here: https://groups.google.com/d/topic/golang-dev/Hy-7PBP-T4Q/

LGTM=adg
R=adg, dave
CC=golang-codereviews
https://codereview.appspot.com/74740045

Committer: Andrew Gerrand <395a7d33bec8475c9b83b7d440f141bcbd994aa5@golang.org>

t-yuki/go.tools.old,t-yuki/go.tools.old,t-yuki/go.tools.old