1
0
mirror of https://github.com/golang/go synced 2024-11-24 04:00:13 -07:00
go/misc
rhysd 04d8d24960 misc/wasm: enable ECMAScript strict mode
Current wasm_exec.js does not enable ECMAScript strict mode. But it is
recommended to be enabled because it

1. eliminates some ECMAScript silent errors by changing them to throw
   errors
2. fixes mistakes that make it difficult for JavaScript engines to
   perform optimizations
3. prohibits some syntax likely to be defined in future versions of
   ECMAScript

This commit enables ECMAScript strict mode in wasm_exec.js following the
transition guide:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode

Fixes #47116

Change-Id: Ib8ffceee37e9127698fb51304241f1e429efe83e
Reviewed-on: https://go-review.googlesource.com/c/go/+/334269
Reviewed-by: Richard Musiol <neelance@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Richard Musiol <neelance@gmail.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-09-03 19:56:09 +00:00
..
android all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
arm
cgo cmd/cgo: fix unused parameter warnings in generated _cgo_main.c 2021-08-16 23:03:03 +00:00
chrome/gophertool docs: fix case of GitHub 2021-03-05 02:35:21 +00:00
ios all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
linkcheck all: update references to symbols moved from io/ioutil to io 2021-04-05 17:51:15 +00:00
reboot all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
swig
trace all: use HTML5 br tags 2021-03-13 03:38:42 +00:00
wasm misc/wasm: enable ECMAScript strict mode 2021-09-03 19:56:09 +00:00
editors
go.mod